ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Low battery indicator for a computer mouse. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Computers Microsoft's wireless computer mouse is powered by two galvanic cells or batteries. Here are the measured values of the current consumed from the batteries: 36,6 mA - with the active work of the "mouse"; 3,9 mA - at the end of active work; less than 1,1 mA - a few minutes after that; 80 ... 92 µA - in the "sleep" state (to restore activity, you must click on any button of the "mouse"). This manipulator is built on the NT82M72 microcontroller, equipped with a built-in 27 MHz transmitter. According to the description, the microcontroller is operational at a voltage of 2 ... 3,3 V. I can confirm that as long as the voltage of each of the two batteries installed in the "mouse" exceeds 1 V, it really works without failures. But often, especially after prolonged use, the batteries are discharged unevenly. Although one of them still retains a sufficient charge, the voltage of the second has already dropped well below 1 V. This also happens when using galvanic cells. Usually, when the "mouse" supply voltage is unacceptably low, its cursor on the computer screen starts to twitch, and then randomly jump from place to place. But to determine which of the batteries is too low, you can not do without a voltmeter.
Based on the need to control the degree of charge of both elements, I developed and built an indicator into the "mouse". It contains a minimum number of components and is built on an ATtiny25V-10SU microcontroller capable of operating from a voltage of 1,8 V. The indicator circuit is shown in fig. 1, and the configuration of the microcontroller, which must be set when programming it, is in Table. 1. At the time of programming, the microcontroller pins are connected to the programmer in the following order: 1 - RST, 4 - GND, 5 - MOSI, 6 - MISO, 7 - SCK, 8 - VCC. It is better to turn off the HA1 piezo sound emitter for this time, the rest of the programming elements will not interfere. When the signaling device is operating, the supply voltage to the microcontroller DD1 is supplied from the same elements G1 and G2 as to the mouse controller. LEDs HL1 and HL2 begin to flash periodically when the voltage of elements with the same serial numbers is less than 1 V. Resistors R2 and R3 set the LED current. Piezo sound emitter HA1 will signal the unacceptable discharge of any of the batteries. Applied LEDs KP-1608MGC - for surface mounting green glow. They can be replaced by any other, suitable in color and brightness of the glow and size. To reduce the current consumed by the signaling device, the DD1 microcontroller is clocked from the built-in generator with a frequency of 128 kHz and most of the time is in the "sleep" mode. At the signal of the watchdog timer, the microcontroller “wakes up” every 2 s, starts the ADC built into it, which measures the voltage at pins 2 and 3, and compares the obtained values with the valid ones stored in memory. The average current consumed by the microcontroller during the operation of the ADC and the execution of calculations is 9 μA. When a signal is applied (one LED is on and the sound emitter HA1 is working), the current increases to 1 mA. At the end of the signal, the microcontroller "falls asleep" again and the current consumed decreases to 6,5 μA. With the simultaneous discharge of the elements to 1 V, their total voltage at the power outputs of the DD1 microcontroller will become 2 V, which is 0,2 V more than the minimum allowable. However, in the case when one element was discharged before the second, and the signal about this was ignored, the total voltage may become less than 1,8 V, which will lead to failures, or even to a complete stop of the DD1 microcontroller. The signaling device in this situation will behave unpredictably. Therefore, timely replacement of galvanic cells or battery charging should not be neglected. The ATtiny25 microcontroller has a built-in reference voltage source of 1,1 ± 0,1 V. This is the maximum threshold value that can be set, at the intersection of which a signal about the battery discharge is given. The smallest possible threshold is 0,9 V. This is half the minimum supply voltage. By writing the corresponding constants to the non-volatile memory of the microcontroller, you can set any threshold level in this interval. The voltage measurement on the batteries G1 and G2 is performed in different ADC operating modes. The voltage on the G2 element is measured in a non-differential mode relative to the common wire (pin 4 of the microcontroller). The total voltage on the two elements, since it exceeds the reference voltage (1,1 V), cannot be measured in this mode. Therefore, the program switches the ADC to differential mode, and the voltage on the G1 element is measured as the difference between the voltage values at pins 2 and 3. In the instance of the microcontroller used by the author, by writing to the EEPROM the codes from Table. 2, discharge thresholds of 1 V were set for both batteries. When writing the same codes to other instances, the threshold levels will most likely turn out to be different. First of all, due to the spread in the values of the internal reference voltage.
In order to enter the values of constants that correctly set the thresholds into the EEPROM of the microcontroller of the manufactured signaling device, it is necessary, first of all, to set voltage values between pins 3 and 2 (for G1), 2 and 4 (for G2) equal to the desired thresholds. This can be done in two ways. The first is to apply to the microcontroller according to the circuit shown in Fig. 2 from a separate supply voltage equal to twice the desired threshold level. For example, 2 V for a threshold of 1 V. The batteries G1 and G2 must be disconnected.
Resistive divider R4R5 divides the supply voltage in half. Its resistors must be selected the same with the greatest possible accuracy. The second method (the circuit in Fig. 3) does not require an accurate setting of the voltage of an external power source. It can reach 5 V, but still it should not be made much larger than the sum of the set thresholds. This may reduce the accuracy of their installation. The desired voltage values between pins 2 and 4, 3 and 2 of the microcontroller are achieved by trimming resistors R6 and R7. To write constants in EEPROM, it is enough to supply the signaling device with a programmed microcontroller with a supply voltage and thresholds according to one of the considered schemes, it requires an accurate setting of the voltage of an external power source. It can reach 5 V, but still it should not be made much larger than the sum of the set thresholds. This may reduce the accuracy of their installation. The desired voltage values between pins 2 and 4, 3 and 2 of the microcontroller are achieved by trimming resistors R6 and R7. To write constants in EEPROM, it is enough to supply the signaling device with a programmed microcontroller with a supply voltage and thresholds according to one of the considered schemes, connect its pin 1 (RST) to pin 4 (GND), and then connect it to pin 4 and pin 5 (PBO). After a short period of time, pins 1 and 4, followed by pins 5 and 4, can be opened. Using a programmed microcontroller, the supply voltage and thresholds according to one of the considered schemes, connect its pin 1 (RST) to pin 4 (GND), and then connect it to pin 4 and pin 5 (PBO). After a short period of time, pins 1 and 4, followed by pins 5 and 4, can be opened. A flash of both LEDs will confirm that the threshold values have been written to the non-volatile memory. It remains to fix the assembled signaling device inside the "mouse" housing by placing the LEDs in the existing technological or specially drilled holes in the housing. The piezo emitter HA1 for better audibility of its signals is glued to one of the walls of the case. After connecting to the "mouse" batteries, the signaling device is ready for operation. The microcontroller program can be downloaded hence. Author: A. Balakhtar, Pervouralsk, Sverdlovsk Region; Publication: radioradar.net See other articles Section Computers. Read and write useful comments on this article. Latest news of science and technology, new electronics: Artificial leather for touch emulation
15.04.2024 Petgugu Global cat litter
15.04.2024 The attractiveness of caring men
14.04.2024
Other interesting news: ▪ The laser will take the missile away from the target News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site For a beginner radio amateur. Article selection ▪ article Every creature in pairs. Popular expression ▪ Which countries did Alexander the Great conquer? Detailed answer ▪ article Repairman. Standard instruction on labor protection ▪ article Converter for electric shaver. Encyclopedia of radio electronics and electrical engineering
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |