View Full Version : Question Voltage readout
jswayze
Sep 01, 2004, 04:59 PM
Hello electronic gurus,
I'd like to make a "recording voltmeter" that I can attach to a battery while it is being charged. I'd use a PIC with some EEPROM in it and sample the voltage every second or so, store the result and dump it to my computer.
Is there a chip or a circuit out there that would do the A/D for me, or even just a voltage sensor (0-12 volts or so) that a 16F88 could convert to digital? Ideally I'd like to get temperature and current, but that's not required in my initial circuit.
I found some chips from Maxxim (or National.. can't remember) that through a 1-wire bus provide the info I'm looking for but the current and voltage they read are below what I need. They advertise the sensors as being for battery chargers (imagine that! :rolleyes: )
Any thoughts on this?
Thanks,
Jeff
Dan Baldwin
Sep 01, 2004, 05:25 PM
Probably the easiest way to do it is to use the PIC 12F675. You can get a programmer for it including software for $36.00 from Mouser (579-DV164101). The chip has a built in 10 bit 4 input A/D, and it has some flash ram available for voltage measurement storage.
Dan
jswayze
Sep 01, 2004, 07:13 PM
I've got some experience programming PICs, but just nothing around voltage/current measurement. I was hoping for some tips in that direction...
Thanks,
Jeff
Dan Baldwin
Sep 01, 2004, 07:38 PM
Measuring voltage with the PIC I mentioned above is really easy. All you need to do is scale the voltage down to below 5 volts with a 2 resistor voltage divider. Measuring current is trickier because you want to minimize the voltage drop of your current measuring system. You basically have to measure the voltage across a VERY small resistor in series with the load (perhaps .05 ohm). The pic can't directly measure voltages that small, so you have to use an op amp circuit to get the voltage up to a value that the pic can measure.
I dunno if that helps.
Dan
Comatose
Sep 01, 2004, 10:22 PM
As much as I love PICs, AVRs are the better micro for current measurements, because their A/Ds have selectable gain. Saves you an op amp.
Basically, to measure voltage you just read it into an analog pin on the microcontroller. To measure voltage, you convert it to a small voltage and then read that. Also, if you do go the PIC route, the pic16f676 is a better choice than the pic12f675. They have exactly the same core and almost the same price (10 cents difference) but more pins.
Second point. A pic's internal EEPROM isn't really what you want for short-term storage. On the low end pics its usually 128 bytes or so, so with a 10 bit ADC stored as two bytes per data sample, and two samples per second (voltage and current) you'll run out of space in 32 seconds. If its convenient cabling wise, why not just directly dump the data to your computer as soon as you sample it?
Miami Mike
Sep 01, 2004, 10:41 PM
I'd like to make a "recording voltmeter"...Radio Shack (http://www.radioshack.com/product.asp?catalog%5Fname=CTLG&category%5Fname=CTLG%5F011%5F008%5F002%5F000&product%5Fid=22%2D812) has one for $69.99.
http://www.radioshack.com/images/ProductCatalog/ProductImage/22/22-812.jpg
Chippie
Sep 02, 2004, 06:50 AM
Second point. A pic's internal EEPROM isn't really what you want for short-term storage. On the low end pics its usually 128 bytes or so, so with a 10 bit ADC stored as two bytes per data sample, and two samples per second (voltage and current) you'll run out of space in 32 seconds. If its convenient cabling wise, why not just directly dump the data to your computer as soon as you sample it?
So why not use the joystick port suitably configured with some software(VB ? ) and a bit of hardware and sample in real time ? I'm sure a search of the net would reveal a program that turns the soundcard/joystick port into a dvm.... ;)
Dan Baldwin
Sep 02, 2004, 10:24 AM
As much as I love PICs, AVRs are the better micro for current measurements, because their A/Ds have selectable gain. Saves you an op amp.
Also, if you do go the PIC route, the pic16f676 is a better choice than the pic12f675. They have exactly the same core and almost the same price (10 cents difference) but more pins.
I need to be able to measure small voltages fairly often, so I'll take a look at the AVR mocrocontrollers. Great tip.
The PIC 16F676 is a great chip because it has more IO, but there is something irresistable about a full function microcontroller that looks like a 555
Dan
_AC_
Nov 28, 2004, 12:34 AM
data aquisition module (http://www.dataq.com/194.htm)
The drawback to this is that you have to have a computer running the whole time you're collecting data.... but it is cheap and works great!
jswayze
Nov 28, 2004, 01:03 AM
Wow, $25 for an 4-channel acquisition unit? I think I'll get one just to have around!
Thanks for the tip!
-Jeff
PS... I took Dan's advice and used a simple voltage divider to scale down my input voltage so my 'F88 could swallow it... seems to be working fine!
_AC_
Nov 28, 2004, 02:37 AM
Yeah the DATAQ cheapie is unbelievable... you can use it as a slow sweeping digital storage scope. It can be a very handy tool.
They also have software ($99) that allows you to import the raw data into Excel so you can manipulate it. There's a demo that works for 30 days or so.
Glad you found a way to accomplish your original goal... I'll try to be a little quicker next time ;)
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.