Yup, a voltage divider is the way to go.
Do a search on this forum and what you are planning has been talked about.
The link I referred to was more for the ADC explanation part and not the circuit.
Yup, a voltage divider is the way to go.
Do a search on this forum and what you are planning has been talked about.
The link I referred to was more for the ADC explanation part and not the circuit.
Dave
Always wear safety glasses while programming.
I always surface mount everything on prototype boards.
I like to have one flat side sitting on the desk.
I have a working Voltmeter unit now
It also has an interrupt/timer driven real time clock.
I guess the next thing is to start the logging, and make it smarter.
The only issue I'd complain about now is that the ADC result used for the
Voltage readout is not stable where an off the shelf Multimeter/Voltmeter would be.
This doesn't seem to happen if the pic circuit is powered by a separate battery.
I used a voltage divider to scale down the input voltage from the battery as
described in the quote (from another forum) in one of my above posts.
What does it mean when it says "Set the A-D ref volt to 5V" ?
Cheers, Art.
Try a capacitor of maybe 10 to 22uF from the ADC pin to the zero rail. Should help smooth things out.
VREF needs to be stable/steady. If the voltage swings the ADC will also. Some will power the pic at 5.2 or so. If that is the case then the VREF needs addressed.
Many times if I am powering the PIC at ~5 volt I will have the VREF at 3 or 4 volts. That way if VDD changes a little it will not cause a problem with the ADC reading.
Dave
Always wear safety glasses while programming.
Thanks, I'll try adding the capacitor.
By VREF, you mean pin 5?
Should I connect it to the 5 Volt rail?
I imagine the 5 Volt power supply should be stable since it is now powered from the 7805.
Do I need to do anything to tell the pic that I'm providing the + 5 Volt reference voltage?
The red wire currently connects the battery to the ADC pin.
Cheers, Art.
I would have to check the data sheet to see which pin the ADC VREF is on. But if you did not tell the PIC different it will use VDD as a VREF. Show use you code and we can be exact.
Just for giggles check the voltage from the 7805 to see if it swings under a load. It probably is not 5 volt to begin with but if it is stable it might be close enough.
Dave
Always wear safety glasses while programming.
Bookmarks