$1 Digital Voltmeter Becomes One-Pin LED Display

erco

Senior Member
I wanted to retask some of the dollar (ten for $10) digital voltmeters I got off Ebay. Ignoring the decimal place, these voltmeters can make general purpose 3-digit LED displays, using just ONE I/O pin. I did some curve-fitting and came up with a linear conversion to make a variable into its corresponding voltage. That is, value 1=0.01V, 37=0.37V, 127=1.27V, etc. It's surprisingly accurate over the whole range, 0-2.55V.

 

premelec

Senior Member
Response a bit lagged and looks good - I presume you are using a 3 wire DVM - I've found some of these cheap units have poor resolution even if advertised that they read 10mv they don't read better than 100mv - whatever works!
 

erco

Senior Member
Yes, a 3-wire DVM. I continue to be surprised at the accuracy/repeatability. Until the batteries weaken and my calibration fails. Displaying Sony IR codes here:


Code:
do				
irin 3,w1
w0=w1*215/100+12
sertxd (#w1,13,10)
pwmout pwmdiv4, 2, 249, w0
loop
 

julianE

Senior Member
Love it. Have you a link to the ebay listing, I'm having a hard time finding a 3 wire one at a good price, majority is 2 wire, I'm assuming you are using the 30 volt range types.
 

julianE

Senior Member
Not as easy to find in a 0-30 range tho I suspect 0-100 will work fine. I do like how conditioned we are for bargains, I'll spend 10 minutes to save a fraction of a dollar. These products are absurdly inexpensive $1.29 for a complex product shipped from China...but I want it for $ .99 :)
 

AndyGadget

Senior Member
The old schoolboy pastime

Of course, inverting the display will give you a selection of 34 words you can display : http://tinyurl.com/pq33aut
Oh, the fun we had when the Sinclair Cambridge arrived :)

Edit - Actually not, as max range is 255. Sigh.
 
Last edited:

erco

Senior Member
Clever. 71077345 works best on a 7 segment display. And not at all on an autorotate tablet. :)
 

erco

Senior Member
Displaying ADC results on the DVM with good correlation. Round trip: analog to digital to analog.


Code:
#picaxe 08m2              ' PWM voltmeter counter
#no_data
pause 100                 ' brief pause on powerup
do
readadc 1,b2
w0=b2*215/100+12
sertxd (#b2,13,10)
pwmout pwmdiv4, 2, 249, w0
pause 1000
loop
 

Attachments

Last edited:

IronJungle

Senior Member
I like this idea. It would have greatly simplified the BOM for my motorcycle gear position indication. Plus, I could have switched the display into "voltmeter mode".

Nice.
 

erco

Senior Member
Glad you like it, IJ. I'll be building up about 6 units for a class soon, it will be interesting to see how closely they function. I'm sure each one will have to be individually calibrated.
 

techElder

Well-known member
Last edited:

premelec

Senior Member
And these multiple Lipo indicator units have a low battery squeeker that can be used to disconnect the battery and prevent over discharge [not recommended on a flying model... :) ]
 

ZOR

Senior Member
I cannot let everyone have fun, just ordered 3. Should give a good visual readout on my 18650 battery as well as many other projects. Thanks all, just keep the projects rolling in.
 

JPB33

Senior Member
Hi This looks a really good idea! As a novice up to now I have alway looked upon a picaxe output as 1 or 0 rather like ttl etc. However this post has made me think I am wrong as I found readdac command which sets which set the output level? However the code shown in this post appears to use pwm out drive to the led voltmeter?

Can someone clarify it for me please?

Thanks Peter
 

JimPerry

Senior Member
READDAC converts input voltage to a number- Picaxe code can generate a PWM signal proportional to the number - bit like a light dimmer. With a bit of electronic "smoothing" using a capacitor & resistor then the PWM output is another voltage which can be read by the display :cool:
 

hippy

Technical Support
Staff member
DACSETUP and DACLEVEL control DAC output.

READDAC and READDAC10 allow the DAC output level to be read.

PWMOUT generates a continuous PWM output which can be passed through a resistor and capacitor to create a controllable voltage.
 

erco

Senior Member
PWMOUT generates a continuous PWM output which can be passed through a resistor and capacitor to create a controllable voltage.
That's the gospel truth. In this case, I connected the PWM output pin directly to the DVM module, whose input/sample characteristics worked surprisingly well with the first PWM frequency I tried. In this age of sophistication and high-tech wizardry, don't discount dumb luck. :)
 

JPB33

Senior Member
Thats a neat trick, makes sense with the explanation thanks. Was hoping to use the idea for a temp display perhaps with a thermister but got some DS18B20 to hand. More thinking needed---but back to gardening---yuk!
 
Top