Don’t worry Jim I’ll definitely be checking out the Golf cart battery and how it is charged.
I doubt the Lions Club spent a million bucks on a lithium battery for a bbq starter
Hi James
The buggies you walk behind were usually 12V GEL type. Sonnerheim were a good and popular brand some years ago but later more modern units are now Lithium, mainly for the difference in size and weight. The Sonnerheim were large and heavy, also expensive.
The ride on carts you see running around indeed are (or were) 48V, a bank of 4 x 12V batteries in series. Probably lithium these days, I am not sure.
I think the cost versus quality curve is pretty linear. I have a larger “Wish” board fitted with banana sockets on the base plate for the connection of external power. Relatively expensive in its day but it must be close to 20 years old now and still going.
The “springiness” is the bit that is not up to it. They should be “tin plated” as against “tinning” which is usually associated with a layer of solder.
If I need to use header pins on a less than ideal board I try to confine their use to one section of board and avoid that area for general components. Anyway it is not hard to “feel” that you have a decent connection.
Cheers Bob
Here is my first proof of concept result.
Now I have to wait for me LoRa hardware to arrive but I already have an understanding on how that works from a previous project so I should be able to reuse a lot of code.
The only connection change I made from the picture above was to connect “Analog GND” to the negative rail on my bread board then I ran the following code.
from machine import ADC
from time import sleep
import machine
# Adjust this value depending on the resistors you have used until the
# values returned match your current (actual) battery voltage as shown on a multimeter
voltageAdjustment = 4.82
analogIn = ADC(27) # ADC 1 or GP27
minutes = 0
seconds = 0
led = machine.Pin("LED", machine.Pin.OUT) # Pico Wifi Board (make sure you have PICO W version of micropython installed)
# led = machine.Pin(25, machine.Pin.OUT) # Pico Non Wifi Board
while True:
led.toggle()
sensorValue = analogIn.read_u16()
sensorVoltage = sensorValue * (3.3 / 65535)
batteryVoltage = sensorVoltage * voltageAdjustment
print((str(minutes) + "," + str(seconds) + "," + str(round(batteryVoltage,2))))
seconds += 1
if (seconds == 60):
seconds = 0
minutes += 1
sleep(1)
Which produced the following output
0,0,12.83
0,1,12.79
0,2,12.78
0,3,12.79
0,4,12.78
0,5,12.79
0,6,12.79
0,7,12.81
0,8,12.81
0,9,12.78
0,10,12.79
Hi David
I don’t profess to know anything much about Pico and less about Python (or MicroPython).but this should not be required
This figure should be simply the division ratio of your resistive divider. In this case 4.79. which would be the entry for “voltageAdjustment”.
This should be as accurate as you could expect given you will have errors affecting absolute accuracy. Among those will be the ADC resolution and multimeter measurement error. Believe it or not a DMM is not the holy grail of accuracy. The best you will do is one with a fresh battery and has just been calibrated using equipment which you or I would not have (I used to have access to a standards lab when working full time). The DMM will have a ± percentage tolerance plus an allowable error on the last couple of digits. But nevertheless most DMMs in practice are good if you realise some limitations. Some (probably good for marketing) boast super resolution but in reality when you apply the last digits tolerance don’t mean that much. For instance my DMM on the 20V scale has a resolution of 1mV (3 decimal places) but I disregard the fact that the last digit could really be anything and indeed it dances around a bit.
I think what you are trying to do here is do some compensating to adjust what you see returned to what you see on YOUR meter, believing that to be the most accurate. This means that anyone copying your measuring system would be adjusting to THEIR meter and no 2 would be alike. In fact if you changed YOUR DMM you would probably be adjusting this number again.
I guess what i am saying here is for the sake of repeatability the calculated ratio number is the way to go. It will be as accurate as you will get with what you have
Finally I notice you have used 5% resistors. If you factor in worst case here you are not doing too bad at all. For your final product you should use at least 1% devices. You will also find that your selection of preferred values is far greater. You could probably come down to a total of 20k without making a significant difference to your battery load. You don’t have to be too fussy about the actual ratio as long as you get within your measurement range and calculate what the actual ratio is.
Cheers Bob
Hi Bob,
Yes I realise it’s all a moving target with the accuracy of my meter and the accuracy of my resistors. I have had the resistors so long I had forgotten what the tolerance was. They are at least 20+ years old. I have already ordered a set of 1% resistors from Core. (I have obviously had a few gaps in my electronics training )
It’s just going to be a comparative result when it comes down to it.
Someone will check the reading once a week or so and a decision will be made if it’s going to last another week or if it needs a charge. They will soon adjust the output in their head to know when decision time is. It will also show the “shit someone has jammed the button again result”.
I’m planning to charge my little test battery up to 14.4v and check the result again. Then let it naturally sag back down to ~13v and test again with my DMM.
Thanks so much for your very detailed input. I wasn’t sure if I was just fudging up the answer (a programmer would never do that)
David
Hi David
Ha Ha. Worked alongside programmers (if I couldn’t get out of it) when I worked full time. Seem to live in their own bubble.Some pretty smart people among them but if you gave them a soldering iron I think about 80% would pick up the hot end.
No reflection on present company of course
Cheers Bob
Hi, I built a diesel engine starter some time back, and included 12V Lead Acid battery monitoring. From a circuit perspective, I would recommend adding reverse connection protection, not a series diode as that will upset your voltage setting but one reverse biased between ADC input and AGND and another reverse biased between ADC input and 3V3.
Finally, a small film capacitor in parallel with the lower resistor on your voltage divider will stop unwanted noise from disturbing the ADC input. As you’re effectively measuring DC, the capacitor can be one that gives about a 0.2 seconds or so RC constant to eliminate most sources of noise (AC, lightning, etc.) and inductive spikes from battery connection/disconnection. t=Reff.C where Reff is parallel resistance of upper and lower resistor (in ohms) and C is capacitor (in farads).
Hi Andrew, David
A good idea for a bit of insurance. Help prevent damage to ADC pin.
David,
I believe this is what Andrew means.
If the 12V battery is connected in reverse the bottom diode will forward bias and short the ADC signal to ground. R1 will limit the diode current to about 1mA. The exact value will depend on the value of R1 but is not critical and will be low enough to not damage the diode. The top diode is to prevent any negative volts getting back to the 3.3V supply.
Cheers Bob
PS. I will be away and pretty much off grid until next Wednesday
Thanks Guys,
That’s very interesting. I don’t think I need to worry about noise as it’s going to be installed in the middle of a park. Nothing else in the enclosure is likely to disrupt things. There will be a voltage fluctuation when someone clicks the starter but the chances of that happening at the same time someone requests a reading from the remote device is near zero. As for reverse polarity that could certainly happen. I’ll see what I can come up with.
David.
Hi David, for sure.
However, I’d recommend all people on the newer side of electronic design have a read of the following article (or similar internet resources). Reliability in remote electronics is key, and they’re often treated in unsympathetic ways by non-engineers! A little extra expense up front can save failure and replacement later (time is money )
Hi Andrew,
Great article. I’m a little bit out of my depth understanding all of the terms but I get the point now.
I’ll have a dig through my parts box and see what I can find. I don’t have an oscilloscope but I should be able to do some basic tests without the pico connected to make sure I don’t fry it or make the thing unworkable.
Thanks for your assistance
David
someone jams the start button in and the starter clicks away until the battery is flat
I’m sure we could address this with a little more info…
The button should only trigger the stater for, say 5 seconds, and only trigger again if the button is released and re-applied!
Hi Peter, David.
A pretty serious situation. If the engine starts it would throw the starter gear off the ring gear and the starter motor will just spin. I have seen the situation when the starter motor will “throw solder” (as it used to be termed) everywhere which is the solder connection between commutator and armature windings melts and usually destroys the whole thing.
This “clicking away” as you call it of the solenoid should only occur if the battery is pretty flat. If the engine does not start the starter should just crank it until the battery is almost flat and this is when the “clicking” should occur.
On some very old engines it could be the “starter motor” is permanently coupled to the engine and becomes the generator when the engine starts. I don’t know about the present day but I think earlier attempts at electric starting of motor cycles used this approach of starter/generator.
Cheers Bob
I’m talking about the BBQ ignitor not the engine
Hi Peter, David
Of course, that is what tis thread is all about.
Had a brain snap, senior moment. I must be entitled to an occasional one of those. When you mentioned starter I (naturally???) assumed an engine starter motor.
So forget my last reply.
Sorry. Cheers Bob
It’s all good Bob
We are amongst mates here