OT: How to measure voltage with 2313 ?

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi -

Given that the 2313 doesn't have an ADC, what would be the best way to measure a voltage fairly accurately ? I know about using the resistor/cap combo and timing the charge/discharge cycle for it, but how accurate and calibrated can you get with that ? How would you actually calibrate it, and keep it calibrated ?

Another method is using one port as an R2R ladder DAC into the comparator against the voltage being measured. This would require high-accuracy resistors for the R2R - Bourns has some R2R resistor networks (4116R-R2R-503), as do other manufacturers.

I have a ton of 2313's on hand, and would like to use them up :)

Actually, I need to build a small calibration tool for another project. This would produce a square wave at a given freq, displaying it on 4 LED displays. That part is pretty easy, using a good crystal.

I also need to provide a known voltage, accurate to at least 0.1V, preferable to 0.05V, over 12V (8 bits). Given that the voltage would probably be a little bit off, I want to be able to display exactly what is being provided.

This way the calibrator can be sent out to be plugged into the other project. A switch selects between displaying freq or voltage being applied, and another selects between two voltages.

Dean.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd start over with a Mega8 or one of the Tinys with ADC. Any extra parts added (like an external A/D) to a '2313 design will make up for the cost. And you save the pennies for a crystal if you can use the internal oscillator. :)

That failing, and if you are only going to do 1 or 2 pieces, sign up at Maxim & TI & Analog Devices for appropriate ADC samples. :D

Save your '2313s for LCD driving (it makes a cool character LCD driver since it has enough I/O pins and can be driven "blind" if desired with just the UART TX pin of your main board sending it commands) or timers/function generators (overclock the heck out of it & see how fast it will run).

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why don't you attach a liitle ADC chip to the 2313 (1 wire or spi or I2C) - maxim/dallas have a great samples policy.

Good Luck

Klaus :x

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I hope you don't have too many :?

Some of the Atmel prices seem to be in a nose-dive. Just read that the Tiny11 can be had for 56 cents, and the Mega8 in dip is just under $3 (single quantities :!: )

Maybe clearing house in readiness for the Tiny13, Tiny2313, Mega48, etc. :?:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

For the voltage refernce why not just buy one that is accurate enough? From Digikey a 4.096V ref is $3.69 (CDN) in qty 1, accurate to 0.1% (=0.005V). They have lots of other values as well in that same price range.

Regards,

-Colin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't even really NEED to use an AVR here. It would just be a little cooler to have a display to provide feedback. My original lashup uses a small 12V battery to an LM317 set to 8.3V or so with an LM4040-8.2. That gives an accurate 8.2V for the high measurement.

That also feeds another LM317 set to about 3.4V with an LM4120-3.3. Nice accurate 3.3V. A 555 timer provides the freq output. This all works fine, and is accurate, as my meters show.

But there's that trust factor in there ... When you toss the calibration box to someone to use to calibrate something else, they have to trust that as they adjust to 8.2V and 3.3V, what they are adjusting against really is accurate. It is, but being able to SEE what voltage is being provided provides a warm fuzzy for them ...

The 2313s are left over from other projects - I have about 40 left in the drawer I think. I thought about using one of those little lcd panel voltmeters which would be easy and clean, but $35 is just a little too silly compared to a free (as in surplus) 2313 and a few dirtcheap 7-seg leds. I don't plan on making more than a handful of these.

Dean.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, any hints on the best/accurate way to do a voltmeter on a bare 2313 ? I'm leaning towards using one port (8 bits) and an r2r chip from Bourns, though I also have a bunch of 1% resistors of all kinds of values here, so I suppose I could really do it manually.

Using the charging time for a cap needs an accurate crystal and low-variation cap I think. Though it would sure be easier to wire up.

I'm still not sure how to calibrate either method here.

Dean.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey, Chancy, I still think you are trying to make a silk purse out of a sow's ear, but check this out:

Quote:

www.circuitcellar.com CIRCUIT CELLAR® Issue 162 January 2004 43
Single-Pin Analog-to-Digital Conversion Techniques
Picture this: you need to add an analog input to a design, but you have only one digital I/O pin remaining. This month, Ingo presents an intelligent, cost-effective solution.
FEATURE ARTICLE by Ingo Cyliax

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Heh, yeah, I suppose so.

That's the resistor/capacitor method I was talking about earlier. Accuracy doesn't look to be the best ...

I think using one port as output to an r2r ladder is the most accurate, particularly here. Can use a couple of small tables of values, since there are only two voltages to be measured, and they should already be quite accurate.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)