📜 ⬆️ ⬇️

We make a charge indicator and mileage for electric cars


Who needs and is a battery indicator in% convenient? In fact, we need to know how far we can drive the battery without recharging. Let's make such an indicator. It can show how much you have already traveled (seconds / minutes / meters) after a full charge, as well as how much is left to drive (meters / seconds / minutes) as well as total mileage. At the same time, we will deal with a clear example using super Micro Arduino controllers of the ATtiny family.

The resulting device can be used on any children's typewriters (for example, Power Wheels) and, anyway, on any electric vehicles, electric quads, electric bicycles, electric mopeds and electric golf machines. Our device will count the time (in seconds) that the motor was turned on. It is understood that the average speed is about the same and full gas is always pressed. Then these seconds are remembered and converted into meters and kilometers according to the programmed formula.

Different cars have different batteries. Our device will work from 6 to 24 volts.
')
And so the same is displayed:
1) Current (after fully charging the battery) mileage in meters with an accuracy of tens of meters.
2) Current (after fully charging the battery) run in hours, minutes and seconds with an accuracy of tens of seconds.
3) The distance that the battery will last (using the pre-calibrated and prescribed time in seconds of the motor with a charged battery) in meters with an accuracy of tens of meters.
4) The total number of motor-hours for all time (as in aircraft)
5) Total mileage for all time (like cars)
6) Current voltage on the battery. On it, too, can be judged on the discharge.

Of course, battery capacity decreases over time. There is also a self-discharge and performance degradation at low temperatures.

This project pursued the two goals mentioned above. It was interesting to me to deal with ATtiny and tired of pushing my son, on a discharged electric quadric, to the house. ATtiny much cheaper than their large Arduino counterparts. And often in projects where 8kb and 5 GPIO there’s absolutely no need to shoot from a cannon on sparrows. Of course, we got a skew in what we saved on the controller, but we paid three expensive to the Chinese for the indicator with I2C.

What we need: a textolite training scarf 4x4cm with a pitch of 2.54 mm, 5 resistances, 3 diodes, 2-3 capacitors, a reset button, a toggle switch on / off, a 8-foot DIP socket, one roll at 5 volts and possibly one for 12, one ATtiny85 chip (for example, programmable via standard Arduino from standard IDE) and one 8 segment 4-digit LED display with I2C interface. The cost of the latter greatly outweighs everything else and can reach up to 400r. I bought on ibey. Total turns 450-500r

Here is a diagram of the device and photos of manual layout:

Four LEDs are for highlighting the dimensions. In winter it gets dark early and for safety it is better that your child rushing along the street was visible from far away.

Code, libraries and firmware needed https://github.com/chouckz/PowerWheelsOdomiter
tinyI2C has already been tweaked to work at 8 MHz.
Guide on how to program ATtiny85 http://www.youtube.com/watch?feature=endscreen&v=30rPt802n1k&NR=1
The only thing is to remember to preload the boot loader at 8 MHz.

Typical schemes of children's electric cars:
http://www.modifiedpowerwheels.com/forum/topic.asp?TOPIC_ID=2236
http://www.modifiedpowerwheels.com/forum/topic.asp?TOPIC_ID=1075

Here's what happened:
Video

Source: https://habr.com/ru/post/163231/


All Articles