For years, I have had a float controller (DFC2) controlling a pump to move water from where it gets trapped at the back of my house. The controller and pump has always worked good. But I have been curious about when it runs and how much.
When I came across Arduino's IoT controllers I had to try this. I had worked with the Uno before. The Nano 33 IoT seems perfect for this project.
I wrote the code and modified the DFC2 to let the Nano know what was going on. The hardest part was getting into the DFC2 and taping into power and relay coil connections. Details of the DFC2 circuit have been very hard to find so I had to figure it out for myself.
Here is my finished project with the cover off:
Once I got the DFC2 opened up, I was able to tap into power and relay coil as shown here. Please overlook my poor soldering skills - I am old and don't see well close up.
Here is the add-on board I made to mount the Nano 33 IoT:
This then goes into a small enclosure glued to the side of the DFC2 itself.
As far as the cloud connection goes, the Nano 33 IoT code sends data to 2 Blynk virtual datastreams. It also causes 4 notifications: 2 for device ON and Off, 2 more for PumpRunning and PumpStopped. The mobile app screen looks like this:
The notifications look like this:
More details:
1) The DFC2 has a USB jack on the side. Unfortunately, it does NOT contain power so I decided I did not need the jack and removed it. This provided an easy opening for the wires to exit the case.
2) Once I found a LM7805 power regulator on the DFC2, I knew where I could pickup power. I taped into the input of the LM7805 and get about 15 vdc for the Nano 33 IoT.
3) The opto-isolator may not be necessary. But I could not decide for sure if the ground was the same between the relay coil and where I am picking up power. It was simple enough to use an opto-isolator and know for sure there would be no ground loop.
4) The DFC2 has an alarm feature. If you use this, it would be easy enough to add another digital input to the Nano 33 IoT and another virtual pin datastream. The input would come from the DFC2 side screw terminals. The COM and NO terminals could pull down a digital input and cause an Alarm notification through Blynk.
5) I'm using the Blynk free user plan which is very easy and provides a lot of useful features including "over the air" firmware update. The Blynk.edgent for MKR1010 seems to be the sample code that works with Nano 33 IoT.
6) I also get temperature from the IMU included on the Nano 33 IoT. This is temperature of the IMU and NOT air temperature. I just wanted some idea of temperature because my DFC2 and Nano are mounted in an outdoor enclosure and I must protect them from overheating by the sun. In order to get temperature, you need to use a special version of the LSM6DS3 library.
7) Interestingly, the DFC2 uses a 9 volt battery to sound an alarm to alert the homeowner if power to the controller fails. (That battery also keeps the Nano 33 IoT board running during power failure.) I thought about trying to sense when the alarm is active to get notified of power failure. But as you might expect, if power fails my home internet will also be down so there would be no way to send that message anyway.
Comments