This Blog Article is courtesy of one of our customers, who wins a $50 store voucher for his story. This is a great example of using inexpensive Arduino components to build a sensor that you can't buy off the shelf. It's also a good demonstration of how Vera can work with just about anything, not just Z-wave devices.
Pool Acid Level Sensor - Jeremy Goodchild, March 2017
If you have a pool and are constantly checking the acid container to see if it’s low or needs replacing or filling, you understand the pain and motivation for this project.
I basically wanted a way to automatically know that the acid bottle (which is out in the back shed) is getting low, so that I didn’t inadvertently forgot to check it and the pool went without acid for considerable periods.
What you need:
- D1 WiFi uno Based ESP8266 Shield Arduino WeMos Compatible IDE ESP-12E. You can find these on eBay for $16;
- DC 5V 12-24V Non-contact Tank Liquid Water Level Detect Sensor Switch. Can pick these up on eBay for around $7-8 (see photo below);
- ProtoShield Basic for Arduino. You can get a 5 pack of these for about $12. Comes with the jumper stubs;
- VERA controller with the Virtual Motion Sensor Plugin installed
- Mini USB to USB cable with switch;
- Plastic ABS housing junction box (Jaycar or Bunnings);
- 1 Resistor (any value), I used a 220 ohm one;
- 2 Jumper cables(breadboard jumpers);
- 1 Breadboard (to make it easy to start with);
- 1 LED
- Cable glands (Optional)
I based the wiring on a simple switch set-up as detailed here. In place of the switch, I used the non-contact tank liquid level sensor. Once I was happy everything was working with the jumper wires and breadboard, I upgraded to a blank PCB and soldered everything in place.
Arduino setup for Mac
For connecting the Arduino the Mac needed to recognise it. To get this working I used the instructions here.
I also needed some help getting the driver to work so use this site to install the USB driver. You should eventually be able to type: ls /dev/tty* in terminal and see something like: /dev/tty.wchusbserialxxxxx
You’ll then be able to select this in Arduino IDE:
Arduino Sketch Code
This code is made to send a HTTP GET to a Vera to trigger it via the Virtual Motion Sensor App. You could bypass the VERA alert and modify it to notify you through your favourite push notification service, like PushOver for instance.
The sketch can be downloaded here: PoolAcidLevelSensor.ino
Just make sure to change the IP address for your Vera, Wi-Fi details and Virtual Motion Sensor Device Number.
Final Hardware and Setup
As well as receive Vera notifications on my phone, I wanted it to trigger a Vera Alert that can be setup to run on another device (happens to be a wall mounted Android tablet in the Kitchen in my case).
If you want to do this, first you need to install and configure the VeraAlerts plugin on your Vera. Then you need to install the Virtual Motion Sensor Plugin. It's this Virtual Motion Sensor that the Arduino will trigger when the acid level gets too low. Make sure your virtual motion sensor has notifications turned on.
Having ticked this will enable the device to show up in the VeraAlerts control panel as per below example:
The great thing is now, in the kitchen, a notification plays out loud (“Pool Acid Level is Low”) and in parallel, a VERA alert comes to my mobile. The only issue with this is if your pool pump runs at night when you’re sleeping. If this is the case you may get an alert that could wake the household. If this is the case, you can setup VeraAlerts to have “quiet” periods. You won’t miss the alert if it were to happen at night though as your mobile would still retain the notification.
Surprisingly the unit draws enough power to drain a 9V battery over about 6 hours (I’m
guessing mainly because the level detector itself has a blue LED “on” in the “full”
LiveHouse Note: If you're creating a battery powered sensor, you need to make sure that anything that wastes power is disabled or disconnected. Wi-Fi in particular can use a lot of power it it's always on. You'll also need to make sure the sketch keeps the Arduino asleep as much as possible and shuts off the radio when not actively communicating. For example, this sensor probably only needs to be wake up every couple of hours to test the level. There are a lot of good articles on the web about powering Arduino from battery or solar.
After this experience of draining the battery I decided to run a permanent extension cable from an outdoor waterproof GPO to the shed. I then connected a plugin USB power adaptor to the Arduino's USB power inlet connection.
I’ve found this project quite satisfying in that it was easy to build with minimal parts, it hasn’t needed any serious troubleshooting and best of all is actually useful, not only to myself but to my wife (even more brownie points).
The big advantages to me have been:
- No longer having to check whether the pool acid is low. Remote notification is achieved as well as easy local identification (using an LED on the junction box rather than having to look inside acid containers, which can be quite noxious);
- Avoiding acid depletion and therefore pool chemistry woes; and
- Can use a larger capacity acid container which is more economical.
I’d recommend this project to anyone with this same inconvenience with pool acid and wanting to try an introductory build using Arduinos. It was my first and now that I’ve managed to work out how to communicate to my Wi-Fi from the Arduino, it opens up a door of endless possibilities to other automation projects around the home.
Share this post