BS2 Voltmeter

Has anyone designed and built a voltmeter using a BS2 and a liquid crystal display?

I have a simple application to display voltage and display the value in integers from 0 to 10 in 1 volt increments.

If you have...would you provide the code?




  • Have a look at EMESystems' website for lots of examples. There's a section on measuring battery voltage using the RCTIME statement. It may not be quite what you want because it doesn't work below the switching threshold of the Stamp's I/O pins (about 1.3V). You may want to use an external analog to digital converter (ADC) (look under documentation here). There are lots of sample programs for this and for the liquid crystal display that Parallax sells (look under documentation here). Look at the Nuts and Volts columns on Parallax's website for other examples (here's vol 1)
  • Discovery,

    Chapter 3 of Basic Analog and Digital starting on page 41 [51 of the PDF] shows how to "Build Your Own Digital DC Voltmeter" using the ADC0831 that Mike mentioned.

    Chapter 1 of Smart Sensors and Application shows how to use the Parallax Serial LCD.

    StampWorks has a whole section of using a Parallel LCD, and as Mike mentioned there are numerous Nuts & Volts articles on LCDs including saving pins by using a '595.

    Nuts and Volts

  • Thank you very much...I am on it!

  • The method of using a BS2xp with the internal voltage comparator gave me an idea. Since I have a BS2, digital potentiomer, and comparator chips on hand...I will make a tracking voltmeter.

    The digital potentiometer comes up at half-scale so the output of the voltage comparator tells the BS2 program which way to slew the digital potentiometer to reach the input voltage quickly. Once the comparator trips is now a tracking voltmeter.

    Parts are a BS2, LM111, and an AD5220.

    The BS2 program generates the clock and U/D direction for the digital potentiometer. The comparator generates the logic state for the tracking servo.


  • Discovery,

    Before you go "down the rabbit hole" as Dave Jones would say, what is your application?
  • This device will be used to indicate the throttle position of a locomotive from 0% to 100% scaled from a voltage ranging from 0 vdc to 10 vdc. The display can be a liquid crystal display showing the measured voltage as a percentage or ten LEDs showing steps of 10%. The device is being bread boarded with LEDs since it is the simplest approach. The liquid crystal display is a possibility when I get one on which to experiment.

  • By the way of information. I use the AD5220 Digital Potentiometer in several circuits.

    I found that these devices are very susceptible to electromagnetic pulses and will jump the output voltage when a pulse passes through the device. I located a relay next to an AD5220 on a printed circuit board and was surprised when the output changed for no apparent reason. The problem was found by instrumenting a scope to various signals. The solution to the problem was to shield the AD5220 with copper on the top and on the sides of the device. After adding the shielding...the device worked flawlessly.

  • Discovery,

    Do you have a kickback diode across the relay and decoupling capacitors across the AD5220 power pins?
  • Of course.

  • Fortunately, I found some very old parts in my parts stores...HP 5082-7300 Red LED numerical displays. I used the BS2 to generate the BCD codes for driving the displays. The tracking voltmeter with percentage display works perfectly.

  • ercoerco Posts: 19,376
    Good to hear you got her going. Good project and WOW, that's the easiest scaling job ever, getting a display to show 0-100% of 0-10V. Me, I'd probably just grab a dollar DVM and black out the decimal point. :)
    "When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

    - Pablo Picasso
Sign In or Register to comment.