Controlling 24VDC coil based on DC voltage reading...

Thread Starter


Joined Feb 26, 2016
Hi all,

So I have solar energy at home consisting out of panels, batteries and inverter/charger. Thing is I am running my house on this 24/7 with a way too small battery bank ( don't tell me upgrade the battery bank!) resulting in the need to charge from time to time.

I have a 48VDC battery bank, that can be charged by a 220VAC charger, I have a 220VAC contactor controlled by a 24VDC coil that should(this is where you come in) be connected to my Arduino. It should be able to measure the battery bank voltage ( doesn't matter if it is measuring 48VDC 24 VDC or 12VDC) and switch the coil when a certain voltage is reached which in turn switches the contactor that starts the charge, it should then charge for 3hours and switch the charge off. Can you help please?


Joined Jun 22, 2012
What code? I dont do Arduino only pic programmes.. soz

As a guide use the A2D converter read the battery voltage using a resistor divider, and set an upper and lower level to compare it with, then use that to put the relay on/off.