Close

A DC/DC Converter with a Voltmeter?

A project log for eForth for cheap STM8S gadgets

Turn cheap stuff from AliExpress into interactive development kits!

ThomasThomas 12/31/2016 at 12:224 Comments

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:

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!

Possible applications (with more or less soldering effort) :

For hacking the boards are just right. I ordered two more.

Discussions

Martin wrote 03/20/2017 at 08:19 point

I have found a similar principle in a car (cigarette lighter socket) USB power supply. This had a display of input voltage, output current and temperature. Each of the analog inputs were connected to one of the display multiplex pins over resistor or voltage divider. The analog input voltages were scaled down to a range of 1V. Between the digits were brief pauses of 100µs were the pins were tri-stated and the ADC conversion was done. It was very confusing at first to have ~3,65V on the tap of a 33k / 2k2 voltage divider with 12V input - until I took the scope out.

So perhaps a similar strategy could be used with the button which shorts a segment out: Use a series resistor of several kOhm in series with the button and use a pull up (or down, depending on configuration) of several 10k Ohm. Then you can read the button in a short pause of the multiplexing.

  Are you sure? yes | no

Thomas wrote 03/20/2017 at 17:38 point

Hi Martin, you're right, double use of LED MPX with keys or analog sensors works well if designed properly, and at first glance such a circuit can be a bit confusing, too. 

I'm sure that it wouldn't be difficult to improve the circuit, but in this project I would only consider it if it's an easily repeatable modification. In the case of the both the Chinese DCDC converters the copper traces are either rather narrow, or hidden under the LED display. However, I found that the usability impact of the LED display imperfection isn't really important.

If someone were to redesign the PCB considering a change like the one you proposed would be one of the first things on the agenda :-)

  Are you sure? yes | no

Thomas wrote 01/01/2017 at 00:16 point

That was a mistake :-) PD2 and PD3 are the voltage inputs. PD1 still has two or even three functions, though. Some boards don't have the all-but-useless key anymore, then it's two functions.

Edit: fixed PD1/PD2/PD3

  Are you sure? yes | no

jaromir.sukuba wrote 12/31/2016 at 21:28 point

Good work, though I don't understand this:

"PD1/SWIM drives segment G" and "PD1 and PD2 are the voltage inputs"

The PD1 has somehow two functions?

  Are you sure? yes | no