Recently I bought a little gizmo called as “USB Charger Doctor” from an online store. The little usb bus powered device features a passthrough usb connection to connect the usb source port and usb device, and a 7-segment LED display driven by an on-board microcontroller to indicate the voltage and current. As usual, I have an irresistible temptation to know how this device works, and just after 3 days from its arrival, I tried out the circuit surgery!
The USB Charger Doctor holds an OTP microcontroller, Voltage and Current Sensors, and one 7-segment LED display unit. The internal electronics is powered by an onboard voltage regulator, which regulates the usb bus power to a stable 2.5 volt dc supply. Here is the system diagram of the USB Charger Doctor for your quick reference:
Why an OTP MCU? As designers look for ways to reduce the cost of their embedded systems without compromising the availability of peripherals or system performance, a potential solution to explore is the option of using one-time programmable (OTP) microcontrollers (MCUs) in their designs. OTP-based MCUs often provide the same peripherals and functionality as those found on flash-based devices, but at a reduced cost, or they can exceed the performance and functionality of flash-based MCUs at the same cost!
In the device, a “USB A-Male” connector is used for plugging into the usb port, and a “USB A-Female” socket for plugging the usb device into. Three digits of the 7-segment/4-digit red LED display shows the measurement value, and the last digit indicates volts (U) or amps (A). These voltage and current reading automatically alternates (between U and V) every 3 seconds or so. The 16-pin MCU – re-marked as 00F015 – is probably an HT series OTP (from Holtek). The current sensing element (Isense) is a 0.05R/2W shunt resistor, and a 2-resistor network (voltage divider) is wired as the voltage sensor (Vsense). The voltage regulator (Vreg) is built around the popular 3-pin adjustable shunt regulator chip TL431.
The LED display unit is a 12-pin common cathode 7-segment/4-digit type with the following pins:
Pin 1: E, Pin 2: D, Pin 3: DP, Pin 4: C, Pin 5: G, Pin 6: d4
Pin 7: B, Pin 8: d3, Pin 9: d2, Pin 10: F, Pin 11: A, Pin 12: d1
Where A to G are Segments, and d1 to d4 are Digits (cathodes) of the LED display unit. DP denotes Decimal Point. Part number of this display is CL3641AH.
Here is the indicative schematic circuit diagram of the usb charger doctor, drawn by me. Voltage measured at various points, when powered by my lab power supply (dialed to 5.0 Vdc), is also included in the drawing as a ready reckoner for all interested guys.
All the pins except 3, 4, 5, 12 and 13 of the 16-pin MCU (U2) are routed to the LED display unit – Pin 1 drives B, Pin 2 drives d3, etc. Pin 3 of the MCU is connected to the Vsense circuit, and Pin 4 is connected to the Isense circuit. Pin 5 is the ground and pin 13 is the VDD of the MCU. Note that the output from the Vreg circuit is also attached to the decimal point (pin 3) of the LED display. Have a look at the MCU to DISPLAY wiring, clearly shown in the following table:
Obviously, at the heart of this design is a low voltage (2.5V or less) MCU with built-in ADC and internal clock oscillator. This great design work amazes me because I already designed/published many digital voltmeter/ammeter circuits based on popular 5v/3.3v microcontrollers like AVR and PIC, but never tried an OTP MCU that works on < 2.5v, till date! Backwash
One week after this circuit surgery, I found another usb charger doctor circuit built around the Holtek OTP MCU HT46R064B (Enhanced A/D Type 8-Bit OTP MCU), circuit board and circuit diagram of which is shown below. Here, the major difference I noticed is in the power supply connections of the MCU; its pin 12 is connected to the +2.5V supply (VDD) rail. Besides, total 12 pins of the MCU are fully reserved for the display unit.
OTP MCU Programming!
Flash MCUs are very familiar to us, but how to program a Holtek OTP MCU? It’s another question! The eWriterPro (from Holtek) can be used not only as a programming tool for all of Holtek’s OTP and Flash devices during the development stage but can also be used for small to medium volume production purposes. The eWriterPro must be used together with a corresponding eSocket according to the package type of the MCU that is to be programmed. Devices with the same package type require only a single eSocket, thus reducing the problem of changing different adaptors for different IC part numbers. More details: http://www.holtek.com/english/tech/tool/MainPage1.htm
Note: While every endeavor has been made to ensure accuracy of the contents of this article, some errors may exist. If you find any errors or if you have your own findings, please notify the author/site owner!