Codeless automatic transfer switch for solar setups

4 views
Skip to first unread message

John JR

unread,
Dec 7, 2019, 8:55:18 PM12/7/19
to SENSORICA, sensorica-ecg
After spending so much time working on GrowSense and completing the updates I posted about in a previous email I decided I needed a day or two away from working on GrowSense (and programming in general) to rest my brain and recharge, and come back to it with renewed energy and enthusiasm.

So today I decided to work on something different. And considering my power bill has been rising lately with more and more electronics being installed in my lab I want to try running more of the electronics off my solar setup.

My solar setup is now running 2 of my live systems (the master branch and lts branch live systems, where those branches of the GrowSense system are automatically installed to, and auto tested on, after each git repository update) including the lights.

The solar panels are providing a surplus of power and I want to run the entire network stack (all my servers, test rigs, etc.) off the solar setup, but if I have no sun for a few days the batteries could get low and the charging controller would disconnect the load to protect the batteries, shutting down the entire network stack.

I'm planning on making a group of energy/solar management devices called JuiceIoT in the same way I created the GrowSense system and devices (reusing a lot of the same code), including an automatic transfer switch to swap from solar power to mains power when batteries are running low.
But that'll take some time and I want to get GrowSense out and being thoroughly tested before I launch a new large complex project.

For now I figured I could make a very simple (you could say crude) automatic transfer switch with no arduino/microcontroller and no code. It took me less than an hour to build.

I used an arduino voltage sensor module, an analog to digital converter module (from a resistive soil moisture sensor), a relay, and a 12v to 5v/3v power breakout board to power it.

The voltage sensor converts 0-25v down to a 0-5v signal, sends that signal to the analog to digital converter (no different to the 0-5v signal it expects from a soil moisture sensor), and it switches the digital pin on/off depending on the voltage and the position of the potentiometer it has on it.
That digital pin then switches a relay on if the voltage is below a certain level and off if it's above a certain level (that level can be changed using the potentiometer).

I've attached photos of the simple test setup showing that at 9v or above the relay module is off, and at 8v or below the relay module is on. Look at the green light on the relay module.

I'm using another AGM battery as a kind of UPS. The solar setup keeps it full and if the solar setup shuts off power then the UPS battery will keep systems running for a while.

The ATS will be connected to the solar setup output (monitoring its voltage), and the UPS battery input (providing power to it if needed).
If the solar batteries are outputting power they will keep the UPS battery fully charged and the mains power supply will remain disconnected.
If the solar batteries aren't outputting power the relay will turn on to enable the UPS battery to be charged from a mains power supply.

Now I should be able to have my entire network stack running off solar when there's enough power in the primary solar batteries, then switch over to mains power if the batteries are running low, and even if I have a blackout the UPS battery will be able to power the network stack for at least a few hours until power comes back online.
The UPS battery will also prevent the network stack from losing power for the split second between the solar setup shutting off and the mains power turning on.

Hopefully when I have time I'll be able to document how I built this so other people can use it. It could be quite useful for anyone wanting to run solar powered GrowSense systems with mains power as backup, before the JuiceIoT projects are available.

20191208_105235.jpg
20191208_105157.jpg
Reply all
Reply to author
Forward
0 new messages