Articles Hierarchy

Articles Home » Arduino Projects » Arduino Battery Loading / UPS

Arduino Battery Loading / UPS

in a prior article i play already with power components like HALL current sensor, Power MOSFET ...
now i want to build from that a useful project.
- because last week my old Honda Dream ( 125ccm) motobike ( 60.000 km ) refused to start
and at a shop i got the (12V) battery replaced,
+++ i want play with the old one +++
- you know why Thailand is such a romantic country?
minimum once a week we sit at candle light because the electric power fails.
+++ so i want build a kind of UPS emergency LED light +++
as my load, the LED light, will be low power the charging unit will be strong enough to run the LEDs and load the battery.
what i want to build could be called a ONLINE / FULL UPS, compared to the PC UPS what have a very small battery loading circuit, a bypass switch and a inverter from battery to 220VAC with the Watt spec. of the UPS, called offline/standby UPS .

For the Battery loading i need a DC Power supply ( my switching power supply what has a small adjustable output voltage range ? max 13.xx ? must test)
Any lead-acid battery system when overcharged (>14.34 V) will produce hydrogen gas (gassing voltage) by electrolysis of water.
a MOSFET as ON OFF switch and a HALL sensor to know the current, the voltages can be monitored by voltage divider to Arduino Ains.
Instead of adjusting the loading Voltage ( energy inefficient ) i could with this adjust the current average by PWM.
And a Fuse would be good?? not easy to find for DC, ok car shop!

The emergency LIGHT function requires:
_+_ is the main power OFF ? ( from monitoring the PS output voltage )
_+_ is it dark? use a LDR light sensor see here
_+_ a smaller MOSFET to switch on 12V LED, feed from PS or Battery ?PWM?
_+_ battery protection by switch of light in case of very low battery?
( but actually a emergency means give light until battery empty,
QUESTION: who fails first? the LED STRIP or the ARDUINO )

( why buy LED lamps and not use it ?? )
a additional normal LIGHT function requires:
_+_ push button installation ( not switch ) wired to Din(s)
_+_ or a PIR movement sensor could switch on the light even without push buttons.

in the first circuit:

- i forget the LDR,
- the Battery fuse,
- the high side (p) MOSFET gate circuit

first have to read more about it, possibly test my opto circuit from last time, if it works on high side, or get a H Bridge Driver IC..., and as i only have n MOSFET for test, why not switch the minus side of the battery, as in England they wire the cars?
for energy reasons possibly it would be best to switch the AC to the SWPS .


but lets start very slowly and not burn equipment: ( Battery, SWPS, 2 multimeter )
the old battery shows 12.8V ( its fully charged? ), the 20A SWPS is adjustable only 10.3 .. 13.7 VDC, and loads with max 0.5A decreasing. Again i am far from testing high Amps, but for this idea it could be usable, i hope a low ohm MOSFET still allow a loading current.
But there is no "room" for a diode and that is a problem, when the powersupply is OFF there is a current of -70mA from the battery back into the SWPS ? there in should be one rectifier DIODE??
possibly i can use a Schottky Diode.


today at the electronic shop i not get much, but first i found that so called HELPING HAND, for 180THB.

now possibly get some soldering done.

a 30A car fuse with holder
and a solid state relay ASRP2-203D from AIKS, 5VDC control input, 240VAC 3A OUTPUT for 220THB

but when i search for the datasheet i only ended up at a very interesting report about the damage at the japanese Fukushima Dai-ichi Nuclear Power Station.

but without a switch for the Battery also no PWM current control possible.
first test with the SSR show that R13 330ohm is not needed, it seems to be integrated, at Dout directly connected now have 11mA to GND.
and i forget to buy resistors, so i will use for the voltage dividers GND __ 1k _Ain_ 10k __ (12++V)


controller hardware interlude

first i get my DIY_duino running again, its a self made arduino as a arduino 2009 clone (burn bootloader),
what can be programmed 2 ways, load the CPU while its in the Arduino Duemilanove and move it to the DIY board,
or use the Duemilanove board without/removed CPU as FTDI board.
( and that way also i could use the USB menu .. only for development )
And the new Arduino MICRO board, where i not used the solder pins ( what i find in the pack ), use the expensive arduino shield headers, so even without using a breadboard i can use jumpercables for a quick connect. Here now only used for the I2C debug from the DIY duino ( code: kllwireslave ).
in the V0.1 revision of UPS1 i just try to do the measuring job, in V0.2 send it to I2C debug.
_p1_ first load it to the 2009 ( to test I2C debug code... )
_p2_ then remove cpu, connect DIY_duino ( for FTDI and power ), download, connect debug MICRO.
_p3_ and set Time, but as no RTC hardware connected, with limited use.

p1 p2 p3

wires2009 board _ : _ DIY cpu pin _ : _ MICRO
5 V ___________ 7
GND __________ 8
RST __________ 1
D 0 ___________ 2
D 1 ___________ 3

_ SDA _ _ _ _ _ _ 27 ___________ 2
_ SCL _ _ _ _ _ _ 28 ___________ 3

for the often needed board pin info, i copy the internet info to a public dropbox folder, thanks to all the contributors.


oh oh: Mon 13.10.2014
i downloaded Arduino IDE: 1.0.6 and the nightly build 1.5.9. ( should be 1.6.x??)
the IDE 1.0.6 give me problems about the old memory check, possibly i should work that old part over anyhow (NICK) .. adafruit
so when i enable the memory check i now have 3 info:
( for the UPS1 rev 0.2b code downloaded to atmega328 in a 2009 board )
- IDE 1.5.9. say 821 bytes ( IDE 1.0.6 not say anything )
- adafruit calc say 694 bytes
- my old malloc test tool say 561 bytes
i think i stay with the old test ( what must be disabled for normal operation )

and for the 1.5.9 i need a update on the time lib about the const PGM ...



for the SCHOTTKY RECTIFIER diode i got a 40L15 means max 15V , 2 times 20A for 40 THB.