Searching \ for '[EE:] Voltage measurement' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/power.htm?key=voltage
Search entire site for: 'Voltage measurement'.

Exact match. Not showing close matches.
PICList Thread
'[EE:] Voltage measurement'
2003\12\01@185557 by Matt Redmond

picon face
Hi All,

I need to measure the voltage present at a car battery -
but this is simpler (I think/hope) than a full-blown
voltmeter type thing.

Basically I care about only three states:  A total lack of
power (e.g., V-no_battery = 0V), the engine is not running
(V-battery = about 12V) and the engine is running
(V-alternator = about 13-14V).

Any way I can do this by using just two inputs on my PIC?
I'd like to avoid a chip that has an a/d converter if
possible.

I'm not necessarily looking for someone to hand me a
complete solution - a point in the right direction would
be most useful.  I'll learn alot if I just know what such
a circuit is called - I can Google for the rest.

Thanks!

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@190844 by Matt Redmond

picon face
Awesome - thanks for the help!




On Tue, 2 Dec 2003 11:00:34 +1100
 Jake Anderson <.....grooveeeKILLspamspam@spam@OPTUSHOME.COM.AU> wrote:
>use a schmit trigger buffer combined with risistor
>dividor networks
>IE set it up so that one IO line is high when voltage is
>> say 10, one when
>> 13
>if both are off then there is no power ;->
>
>{Original Message removed}

2003\12\01@191712 by Jake Anderson

flavicon
face
actually check your datasheet
many PICs have schmid trigger inputs

(just be carefull, digital logic has 3 states, on off and screwed. my
understanding is schmidt trigger should keep you out of zone 3)

{Original Message removed}

2003\12\01@193549 by Matt Redmond

picon face
Herbert,

I'm trying to use t5he smallest PIC possible for my
application and also don't want to burn up ports
needlessly.  Of course, if the cost of external components
required to support this makes a bigger PIC the more
attractive option then that's what I'll do.

-matt

On Mon, 1 Dec 2003 19:22:03 -0500
 Herbert Graf <mailinglistspamKILLspamFARCITE.NET> wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@195407 by Herbert Graf

flavicon
face
> Herbert,
>
> I'm trying to use t5he smallest PIC possible for my
> application and also don't want to burn up ports
> needlessly.  Of course, if the cost of external components
> required to support this makes a bigger PIC the more
> attractive option then that's what I'll do.

       Hmm, ok, fair enough, how small? The 12F629 has comparators on board and
it's 8 pins? There is of course the 14pin version (can't recall the part
number at the moment... 16F630? If you need more the 18pin 16F628 would be
my choice. TTYL

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@200652 by Russell McMahon

face
flavicon
face
> I need to measure the voltage present at a car battery -
> but this is simpler (I think/hope) than a full-blown
> voltmeter type thing.
> Any way I can do this by using just two inputs on my PIC?

You could use a zener diode that pulled a port pin high when 12v was present
and a slightly higher value one that pulled the 2nd pin high when say 13v
was present. Distinguishing between the two with non-precision thresholds
(either zener or Schmitt) could be slightly tricky.

If pins used were more important than components you COULD do this with 1
PIC pin. Have a cct that clamped the pin low when at say 12v, high when at
say 13+ v and float when << 12v. The PIC can then detect hi/low/float easily
enough.

Another approach to consider is that there will be voltages that change when
the motor runs - eg alternator output, detecting their presence would give
you a separate motor run indication. Also, direction of current flow will
swap in some locations when alternator runs and be zero when power is off.

Using a VCO (voltage to frequency converter) would allow the PIC to
determine voltage from frequency. An eg 555 or similar would do for this. No
voltage  = no signal. This has the advantage of giving you somewhat more
information than just the simple go/no go system that you propose. Odds are
that this will prove useful in due course.



       RM

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@204509 by Jinx

face picon face
> was present. Distinguishing between the two with non-precision
> thresholds (either zener or Schmitt) could be slightly tricky

And don't forget that an auto environment is not always a happy
place for a PIC. There are spikes and voltage fluctuations that
could give false readings if too simple an interface is used. You
should consider an RC filter at least, with external Schottky diodes
to protect the pins. The PIC's PSU should be well-buffered and
smoothed too, to avoid resets and other unwanted glitches coming
through Vcc or ground. Depending where the measurement is to
be done, it might even pay to metal-shield the circuit to stop eg
alternator / ignition noise or, as I've come across lately and had to
fix, interference from RT's that severely and adversely affected s/w

A comparator input will do what's needed

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@205340 by steve

flavicon
face
> Basically I care about only three states:  A total lack of
> power (e.g., V-no_battery = 0V), the engine is not running
> (V-battery = about 12V) and the engine is running
> (V-alternator = about 13-14V).

> I'm not necessarily looking for someone to hand me a
> complete solution - a point in the right direction would
> be most useful.  I'll learn alot if I just know what such
> a circuit is called - I can Google for the rest.

The magic term you are looking for is "window comparator".

However, are you sure this is what you want to be looking for ?
Do you want to know if the engine is running or do you want to know
what state the battery is in ? If you put your fingers near the fanbelt, you
will learn that they are different things.
You can expect the battery voltage to be high just after you turn the
engine off and you can also expect the battery voltage to be low just
after if first starts, especially if it was hard to start on a cold morning and
has a slow idle. Just something to think about.

If you power your circuit from the battery, then the battery not present is
solved because your circuit won't run. If the light is of ......


Steve.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@210831 by Lucas Hartmann

flavicon
face
You could measure the battery voltage using a RC circuit. The battery
voltage charges the capacitor through a resistor.



Connect the capacitor positive terminal to an input of the pic, so that,
based on how long it takes for the pin to go to HIGH you can approximate the
battery level. To discharge the capacitor, make the pin an output in LOW
logic level.



You will need a diode to prevent the capacitor from charging to 12V and
damaging the input pin.



(CAP+)  ----|>|--- (+5v)



If using PIC12F629 you could use the T1G pin, so Timer1 count will be
proportional to the voltage.



Lucas Hartmann

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2003\12\01@220652 by Bob Blick

face
flavicon
face
How about 1 pin and a 555 timer? Can you measure a pulsewidth?

http://www.bobblick.com/techref/projects/a2d555/a2d555.html

Cheers,

Bob

> I need to measure the voltage present at a car battery -
> but this is simpler (I think/hope) than a full-blown
> voltmeter type thing.
>
> Basically I care about only three states:  A total lack of
> power (e.g., V-no_battery = 0V), the engine is not running
> (V-battery = about 12V) and the engine is running
> (V-alternator = about 13-14V).

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\12\02@082330 by Olin Lathrop

face picon face
Matt Redmond wrote:
> Basically I care about only three states:  A total lack of
> power (e.g., V-no_battery = 0V), the engine is not running
> (V-battery = about 12V) and the engine is running
> (V-alternator = about 13-14V).
>
> Any way I can do this by using just two inputs on my PIC?
>  I'd like to avoid a chip that has an a/d converter if
> possible.

Why?  Two resistors and a capacitor tied to an A/D input seems like the
obvious and simple answer.  Many PICs have a built in A/D, and there is
usually at least one in a subfamily.

You could do this with a couple of opamps or comparators.  Since you don't
need high accuracy, you could use bipolar transistors instead as
comparators.

Another option is use a 12F675 to look at the voltage with its A/D, then
output the two digital signals you want.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamTakeThisOuTmitvma.mit.edu

2003\12\02@082332 by Olin Lathrop

face picon face
Matt Redmond wrote:
> Jake Anderson <grooveeeEraseMEspam.....OPTUSHOME.COM.AU> wrote:
>> use a schmit trigger buffer combined with risistor
>> dividor networks IE set it up so that one IO line is
>> high when voltage is say 10, one when 13
>> if both are off then there is no power ;->
>
> Awesome

Not really.  Check the data sheet for the schmitt triggers and note that
very large range where the output could flip.  It will be tough to guarantee
you can detect the different between 12 and 14 volts.  Also, the hysterisis
will be working against you, not for you as in normal schmitt trigger
useage.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu

2003\12\02@112207 by Tim Hart

flavicon
face
One more thing to watch out for.  A dead Lead Acid battery is not 0V.  It's 12.00V or so.  Each cell is about  2.0 to 2.2 volts....6 cells and it's 13.2 for fully charged and 12.0 for empty.  
And I'm with the group on this one....a resister division network and a PIC with A/D is the way to go....

Tim

>>> RemoveMEolin_piclistEraseMEspamEraseMEEMBEDINC.COM 12/02/03 06:39AM >>>
Matt Redmond wrote:
> Basically I care about only three states:  A total lack of
> power (e.g., V-no_battery = 0V), the engine is not running
> (V-battery = about 12V) and the engine is running
> (V-alternator = about 13-14V).
>
> Any way I can do this by using just two inputs on my PIC?
>  I'd like to avoid a chip that has an a/d converter if
> possible.

Why?  Two resistors and a capacitor tied to an A/D input seems like the
obvious and simple answer.  Many PICs have a built in A/D, and there is
usually at least one in a subfamily.

You could do this with a couple of opamps or comparators.  Since you don't
need high accuracy, you could use bipolar transistors instead as
comparators.

Another option is use a 12F675 to look at the voltage with its A/D, then
output the two digital signals you want.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspamspammitvma.mit.edu

2003\12\02@121948 by Matt Redmond

picon face
Okay, thanks Tim & everyone else.  I'll digest all of
these responses and figure out how to do it.

Tim - gotcha on the 'dead' battery.  It's actually a
missing battery I'm worried about - fairly certain that
will be 0v  :-).

It sounds like the most difficult thing is going to be
differentiating between engine on and engine off.  Perhaps
I can set up a calibration routine where the chip measures
and stores the voltage readings during known engine-on and
engine-off states & thus is calibrated for that particular
alternator/battery.

Thanks!

-matt


On Tue, 2 Dec 2003 11:21:29 -0500
 Tim Hart <EraseMETim.HartspamspamspamBeGoneHAWORTH.COM> wrote:
>One more thing to watch out for.  A dead Lead Acid
>battery is not 0V.  It's 12.00V or so.  Each cell is
>about  2.0 to 2.2 volts....6 cells and it's 13.2 for
>fully charged and 12.0 for empty.
>
>And I'm with the group on this one....a resister division
>network and a PIC with A/D is the way to go....
>
>Tim

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestKILLspamspammitvma.mit.edu

2003\12\02@141849 by Tim Hart

flavicon
face
Detecting the engine being on should be really easy....there are lots of ways...  Hall effect sensor (or even reed relay) and a Magnet on a shaft.  Lights that come on.  Many things come on with the Key...in the case of car.  Noise is easy to detect.  Temperature sensor?  Air flow sensor in the intake?  The exhaust could spin a fan.  I'd say noise would the easiest....that's the preferred method my brain uses....

Missing Battery?  You might lose it?  Someone stealing them?

Tell us a bit more about your project....we all love finding solutions :)

Tim

>>> mdredmondSTOPspamspamspam_OUTCHARTER.NET 12/02/03 11:18AM >>>
Okay, thanks Tim & everyone else.  I'll digest all of
these responses and figure out how to do it.

Tim - gotcha on the 'dead' battery.  It's actually a
missing battery I'm worried about - fairly certain that
will be 0v  :-).

It sounds like the most difficult thing is going to be
differentiating between engine on and engine off.  Perhaps
I can set up a calibration routine where the chip measures
and stores the voltage readings during known engine-on and
engine-off states & thus is calibrated for that particular
alternator/battery.

Thanks!

-matt


On Tue, 2 Dec 2003 11:21:29 -0500
 Tim Hart <spamBeGoneTim.HartSTOPspamspamEraseMEHAWORTH.COM> wrote:
>One more thing to watch out for.  A dead Lead Acid
>battery is not 0V.  It's 12.00V or so.  Each cell is
>about  2.0 to 2.2 volts....6 cells and it's 13.2 for
>fully charged and 12.0 for empty.
>
>And I'm with the group on this one....a resister division
>network and a PIC with A/D is the way to go....
>
>Tim

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamEraseMEmitvma.mit.edu

2003\12\02@154751 by Russell McMahon

face
flavicon
face
> It sounds like the most difficult thing is going to be
> differentiating between engine on and engine off.  Perhaps
> I can set up a calibration routine where the chip measures
> and stores the voltage readings during known engine-on and
> engine-off states & thus is calibrated for that particular
> alternator/battery.


Highest "engine off" voltage is almost certainly going to be higher than
lowest "engine on" voltage. The former at some period of running with a
light electrical load and the latter soon after starting. Also state of
battery over time will make the ranges vary, especially if the battery is
not well maintained.

There will be other points in the system other than the battery itself where
the conditions will be much better defined.


       RM

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu

2003\12\03@084601 by rco.genovesi

flavicon
face
Engine on: a possible idea..

wrap a small coil around one of the spark cables (ignition).
When the engine is on, probably (?) you can detect high voltage spikes that can sensed as a frequency by the PIC (before this, is necessary to convert these pulses to a lower voltage and to a clean wave with a simple circuit).
But if the engine is "Diesel" type..


regards
Marco



---------- Initial Header -----------

From      : "pic microcontroller discussion list" spamBeGonePICLISTspamKILLspamMITVMA.MIT.EDU
To          : .....PICLISTspam_OUTspamMITVMA.MIT.EDU
Cc          :
Date      : Tue, 2 Dec 2003 12:18:18 -0500
Subject : Re: [EE:]  Voltage measurement

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\12\03@085151 by Hulatt, Jon

flavicon
face
> >
> > Tim - gotcha on the 'dead' battery.  It's actually a
> > missing battery I'm worried about - fairly certain that
> > will be 0v  :-).
> >
> > It sounds like the most difficult thing is going to be
> differentiating
> > between engine on and engine off.

The alternator "no charge" warning lamp signal should be good enough. you'll
need to condition it a bit because it'll be a mucky 12 volts.

Jon

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\12\03@100814 by Alessandro Queri
flavicon
face
> Engine on/off:

Once I saw you can measure rpm via a magnetic pickup on the
alternator. Just add an opamp to square the signal.

Ale

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\12\03@110811 by Bob Ammerman

flavicon
face
I got the assumption that the OP was trying to determine the three states:

1: No battery
2: Engine off
3: Engine running

By only looking at a +12v line in the car, without any other sensors.

I would think that 2 vs. 3 could be distinguished easily by the amount/type
of noise on the line over a short period of time.

Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\12\03@144912 by gtyler

flavicon
face
Use thw "AUX" terminal on the alternator, +- 2v when the engine is not
running, = bat. voltage when it is running.

George

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...