Digital voltmeters are popular: they give the user the feeling of getting an accurate measurement. However, accuracy has a price (e.g components with stable parameters, temperature compensation, reference voltage...). They say "you get what you pay for".
Different sellers at Chinese outlets offer LM2596 DC/DC converters with a voltmeter that, depending on a key press, shows the input or the output voltage. The price for such a module starts at $1.55 (including shipping halfway around the globe).
This has a smell of cheap µC although there is no ICP connector to be seen. I ordered one out of curiosity.
Of course, the only place where a µC could be hidden is below the display. I put it aside because removing it with a suction pump didn't work. Yesterday I played with a LED torch and in the bright light I spotted a TSSOP 20 package. Bingo! This time, it didn't take long to remove the LED display :-)
As expected the µC is a cheap STM8S003F3P6.I traced the wires and noticed the following:
- The NRST pin isn't connected (hence no ICP connector)
- PD1/SWIM drives segment G
- key "in" uses PD1/SWIM, too (I had noticed that when you press a key the display goes blank, now I know why)
- the LEDs "in" and "out" are segments A and B of a 4th digit (MPX PC3)
- key "out" uses PC3 (same as key "in" on PD1)
- PD2 and PD3 are the voltage inputs (or general GPIO)
- PB4 and PB5 (pins 11 and 12) are unused
Pin 5 of the LM2596 (/ENABLE) is connected to ground. It would have been easy to connect it to one of the unused µC pins. With thev ability to controll the converter key "in" wouldn't be useless (right now, it switches the voltmeter on or off while the output voltage is remains on).
Actually, that's is worse than useless - it's ridiculous!
You get what you pay for: assembled components without the engineering. I reckon that either the software was copied from some other circuit, or the SW-engineer isn't on the payroll anymore!
It goes without saying that I heated my soldering iron a second time: now PB5 controls pin 5 (/ENABLE) of the LM2596, and NRST is connected to the free pin 6 of the LED display socket. It turned out that the STM8S003F3P6 is read protected - but who cares?
Now what do we have? A bunch of assembled components that can be hacked into something useful!
- a relatively decent buck converter (even if the caps are of poor quality)
- a µC that can run Forth
- with an LM317 as a linear power supply
- with a 3 digit LED display
- with two keys (OK, pressing one of them will short-circuit the G segment)
- with two analog inputs (after removal of two resistors handily accessible on pads)
Possible applications (with more or less soldering effort) :
- a thermostat ;-)
- a battery charge controller
- on/off CV motor or solenoid control
For hacking the boards are just right. I ordered two more.