Motorcycle Voltmeter Build Question

IronJungle

Senior Member
I did a search and was surprised no to find some clues on this. Feel free to link page me with a thread URL if this has been covered.

I'm considering the use of a three color (RGB) LED to indicate the battery voltage on my motorcycle. You know, RED for under a certain voltage; GREEN means all good, etc.
Anyone that is familiar with PICAXE knows that the project code is very straight forward.

As I see it, the voltage into the PICAXE needs to be 'level', consistent, not changing, stable at, say 5VDC. If the voltage into the PICAXE is not stable then the ADC reading of the motorcycle battery voltage will not be accurate.

What is suggested to bring 12VDC to 5VDC? To me, I think the 'traditional' 7805 would not be a stable enough reference.
Any suggestions on the voltage divider to knock the motorcycle battery voltage (~10 to 15V range) to a 0-5VDC level the PICAXE can handle?

Thanks,
 

Jakob2803

Senior Member
I did a search and was surprised no to find some clues on this. Feel free to link page me with a thread URL if this has been covered.

I'm considering the use of a three color (RGB) LED to indicate the battery voltage on my motorcycle. You know, RED for under a certain voltage; GREEN means all good, etc.
Anyone that is familiar with PICAXE knows that the project code is very straight forward.

As I see it, the voltage into the PICAXE needs to be 'level', consistent, not changing, stable at, say 5VDC. If the voltage into the PICAXE is not stable then the ADC reading of the motorcycle battery voltage will not be accurate.

What is suggested to bring 12VDC to 5VDC? To me, I think the 'traditional' 7805 would not be a stable enough reference.
Any suggestions on the voltage divider to knock the motorcycle battery voltage (~10 to 15V range) to a 0-5VDC level the PICAXE can handle?

Thanks,
A voltage divider made with two resistors, I will return with a diagram and some more data.

Okay go to this link and punch in some data. You need 3 variables. The input is what comes from the battery. Wouldn't this be around 13-14v when engine is charging it? And the output is the 5v for the Picaxe. You need to write in one of the resistances. I tried 10K in the first, and the second one became around 5,5K ohm.
http://www.raltron.com/cust/tools/voltage_divider.asp

Edit: Make sure to write the resistance in ohms, not Kiloohms.
 
Last edited:

BCJKiwi

Senior Member
Suggest a fuse plus an LM2940 with the data sheet specified capacitors - this is designed for Automotive use with all the necessary protections built in.
 

Phil bee

Member
If you need a good stable 5volt output why not use a 7808 followed by a 7805 but use a pair of good smoothing caps on the inputs.
 

Jakob2803

Senior Member
I might have misunderstood your post. If you want to know how to get 5v for the v+, you should use a voltage regulator and some caps. For the voltage measurement use a voltage divider with power directly from the battery, not from the regulator.
 

IronJungle

Senior Member
I might have misunderstood your post. If you want to know how to get 5v for the v+, you should use a voltage regulator and some caps. For the voltage measurement use a voltage divider with power directly from the battery, not from the regulator.
No, you got it right. It would seem for the voltage divider I need high power and precision resistors. High power because they will be connected straight to the 12DC battery (I'm thinking I want large values). Also something that is stable in resistance over a temperature range?
 

MPep

Senior Member
@IJ,

Just think about this in a logical way. You want to measure upto 16V (a realistic maximum voltage).
The PICAXE must work at 5V.

Say the lower resistor is 1kR. This must have no more than 5V across it (input to the PICAXE). Therefore you have 5mA flowing through it (at the maximum).
Now you must have 11V across the top resistor, at 5mA. This then requires a resistor of 11/0.005 = 2.2kR.

However, this may be a bit low, therefore use say 2.7kR.

Now for the power of the resistors, P = V*V/R, therefore 5*5/1000 = 25mW. And 11*11/5 = 55mW. Certainly not high power resistors at all. :)

Hope this helps.
MPep
 

bluejets

Senior Member
Don't really need a micro, there is a fairly simple circuit floating around on the internet that uses the fact that different colored LEDs have a different voltage drop across them.

I modifed the circuit once for an early model 750 Yamaha to give me some indication that the battery was charging. Used a single LED and it turned off when the voltage went over about 12.6V.

http://cdselectronics.com/Kits/voltmeter.htm
 
Last edited:

Reloadron

Senior Member
While using a PIC is a nice concept there are little devices like this one out there quite reasonably priced that afford a pretty accurate actual digital reading. The linked to unit being just an example.

Ron
 

RexLan

Senior Member
Unless you're trying to do this to .01 Vdc a simple 7805 is more than stable enough. When it becomes unstable your battery is already shot. A voltage divider with resistors will not be stable.

And, if you are trying for some magic precision your lights will flicker unless you code in some hysteresis ... so what's the point.
 

Dippy

Moderator
I agree with Rexlan.
Using a divider for a power supply is not good at all , for numerous reasons, when everything (supply and load) can vary.

I would add a little noise & transient protection before the regulator and probably a fuse of some type.
And pot-div and RC to the voltage sample input to the ADC.
And add hysteresis & delay to cover the comment made by Rexlan as you don't want every dip and spike to show on your LEDs.
And then get PICAXE to play 'Happy Days are here again' every time the battery is charged fully.
I assume you won't be connecting PICAXE circuit power supply directly to battery?
 

IronJungle

Senior Member
RexLan/Dippy: Thanks for the 7805 vs voltage divider comments. The voltage divider would be a pain to implement. And Dippy, I would never put +12VDC into the PICAXE unless I was going to purposely do a "smoke test".

All that said, it may be for naught. I think I see this as the solution: (http://www.ebay.com/itm/0-36-in-Panel-Meter-30-21mm-DC-Voltmeter-0-100V-LED-Red-3-digit-3603R-W-b-/200741672944?pt=LH_DefaultDomain_0&hash=item2ebd22d7f0#ht_4361wt_1118)

I hang my head in shame as I stimulate the Chinese economy once again.
 

MartinM57

Moderator
If you have to use special resistors to handle the power of a potential divider (to measure the battery voltage, not to power the PICAXE from - A Bad Plan Indeed), and not get hot...then you almost certainly have completely the wrong idea/design for what a battery measuring potential divider should be.

Such a potential divider would be more like a battery flattener than a battery measurer :)
 

Jakob2803

Senior Member
If you have to use special resistors to handle the power of a potential divider (to measure the battery voltage, not to power the PICAXE from - A Bad Plan Indeed), and not get hot...then you almost certainly have completely the wrong idea/design for what a battery measuring potential divider should be.

Such a potential divider would be more like a battery flattener than a battery measurer :)
True, but it is the only way to measure the voltage with the Picaxe. :D Maybe turn it on momentarily to check the power level then turn it off again to prevent draining the battery.
 

Reloadron

Senior Member
The maximum source impedance for the PIC I believe is 10K Ohm. The max voltage you will likely see is 15 volts. That said I would just make a simple 3:1 voltage divider using 3 each 10 K Ohm resistors. 10 K is very common and can be had in 1% precision resistors very easily. Doing this will yield a total resistance in the divider string of 30 K Ohm. The max current through the divider would be 15 volts / 30,000 ohms = 500 uA which is nothing and will not run the battery down. If that is a concern and you want system voltage then just connect to the Acc (Accessory) line so the divider is only active when the key is On. You only need 1/4 watt resistors, there is no need for power resistors.

I would use a single LM7805 (or similar) voltage regulator. The PIC requires very little current, even with the LEDs in the circuit I doubt maximum current draw will exceed 100 mA (.1 Amp). Even with a 15 volt input and 5 volts out you get 15 - 5 = 10 volts at .1 Amp = 1.5 watts the regulator needs to dissipate as heat which is really nothing. Place a small clip on tabbed heat sink on the LM7805 if you are worried about it. Configure the LM7805 per the data sheet.

I can give a schematic if need be.

Ron
 

IronJungle

Senior Member
I think I 'jinxed' by bike. Today the battery, as a sign of total defiance to my consideration on this thread, died.

That said, I agree with all the PICAXE voltage divider, battery drain issues, etc. I'm getting a "store bought" solution.
 

Axel87

Senior Member
The maximum source impedance for the PIC I believe is 10K Ohm. The max voltage you will likely see is 15 volts. That said I would just make a simple 3:1 voltage divider using 3 each 10 K Ohm resistors. 10 K is very common and can be had in 1% precision resistors very easily. Doing this will yield a total resistance in the divider string of 30 K Ohm. The max current through the divider would be 15 volts / 30,000 ohms = 500 uA which is nothing and will not run the battery down. If that is a concern and you want system voltage then just connect to the Acc (Accessory) line so the divider is only active when the key is On. You only need 1/4 watt resistors, there is no need for power resistors.

I would use a single LM7805 (or similar) voltage regulator. The PIC requires very little current, even with the LEDs in the circuit I doubt maximum current draw will exceed 100 mA (.1 Amp). Even with a 15 volt input and 5 volts out you get 15 - 5 = 10 volts at .1 Amp = 1.5 watts the regulator needs to dissipate as heat which is really nothing. Place a small clip on tabbed heat sink on the LM7805 if you are worried about it. Configure the LM7805 per the data sheet.

I can give a schematic if need be.

Ron
Old Thread, but looking for some help.
@ Reloadron- Would you be able to provide a schematic that you mentioned?
Thank you
 

westaust55

Moderator
Old Thread, but looking for some help.
@ Reloadron- Would you be able to provide a schematic that you mentioned?
Thank you
@Axel87,
The post you quoted by forum member Reloadron was, as at today, the last he has posted here (30 June 2012) which is now 8 months ago.
Unless Reloadron is a quiet lurker on this forum your chances of a reply from Reloadron is very low. But I could be proven wrong.
 
Top