I found a new example of circuit bending grade electronics engineering in my postbox: the XH-M188. It's advertised as "XH-M188 numerical control voltage regulation module" and it's rated "0-12V 1.5A 18W", and last time I checked there was exactly nothing on Google about this cheap board. Now there is ;-)
As expected the board has a STM8S003F3 µC - there was no way to know that for sure, but call it gut-feeling ;-). The
PD1/SWIM on the ICP interface is free, but all other GPIOs are all used for either 7S-LED, keys, or the "numerical control" (and one seems to be unconnected).
I did a quick check. Here are the fun facts:
- the "numerical control" is just a 4.5 kHz PWM signal with duty cycle setting through "+" and "-" key
- the control part is indeed analog (LM358 with a TIP142)
- the display value represents "duty cycle * X". There is no feedback whatsoever.
- the output voltage can be adjusted with the help of a trimmer potentiometer
- the LED multiplex clock is about 16xPWM cycles
Due to a bug in the PMW code, every 16th cycle is only about half. This obviously leads to an analog ripple with about 280 Hz, and more importantly to an offset (which can't be compensated with a trimmer). However, the resulting inaccuracy doesn't really matter since the "voltage reference" is a trusty LM7805.
The maximum output voltage seems to be 11.4 V (at the rated supply voltage of 15 V). The accuracy drops considerable from just below 11V.
All this doesn't mean that the board is good for nothing. At $4.75 it's not exactly an expensive piece of lab equipment for home-brew test automation, and I had planned to write
half-duplex Rx/Tx synchronous bus protocol code for a GPIO with interrupt before ;-)
- a preliminary µC pin connection list is in the project GitHub Wiki
- as expected, the ratio of display value to PWM duty-cycle appears to be constant
- I forgot to mention that the 7S-LED display is socketed. When you remove it 11 GPIO can be used without soldering