PiNet — One Small Project Grows Unexpectedly

A few years ago, [Gregory Sanders] aka [Dr Gerg] had one simple wish in mind when he started what is now the PiNet project — to know whether his garage door was open or closed. Instead of searching out off-the-shelf solutions, he looked at the project as a learning opportunity. After picking up Python, he built a system from a Raspberry Pi, a 12V gel cell battery, and a power supply / charger circuit. Thus project Overhead Door (ohd) was complete (see the ohd GitHub repository) and [Dr Gerg] was done.

Or so he thought. After getting a swimming pool installed, he got the itch again, and started a new project called Pool Controls, because:

The controls for your average backyard in-ground pool are pathetic. I felt like I could do better with a Raspberry Pi, a relay board and some Python. And so I did, and frankly, it’s awesome.

Then he built his own weather station to replaced a commercial one which had died twice in as many years, followed by his own web-based UI framework. Next was the integration of an outdoor security camera system. And finally, although we don’t believe it’s really final, he ripped out the cloud-based controls from his shop air conditioner and added his own Raspberry Pi-based solution. All of these projects are available on his GitHub page.

[Dr Gerg]’s goal in posting all this work is not necessarily so people can duplicate it, although that is okay as well. Instead, he hopes that people will realize that they can build these types of projects on their own, perhaps leaning some things and picking up new skills along the way — have fun doing it. We like the way you think, [Dr Gerg]. Do you know of any small projects which grew and grew and took on a life of their own?

21 thoughts on “PiNet — One Small Project Grows Unexpectedly

  1. I have a home grown ESP8266/ESP32 system that monitors and alarms on water consumption (no well, no city water . . . I haul every drop of house water in my pickup truck), water tank level, freezer temperature, boiler status, inside and outside temperatures, and a few other things via MQTT, PHP/RRD and, later, Python/Graphana. Works great, especially when I’m out of town and it’s -40 outside. I’ve expanded the system to a few friends homes and a business. The system has saved the business thousands of dollars because the freezer door hadn’t been closed a few times and a bunch of frozen pipes after boilers/furnaces popped offline or garage doors left open in the Alaskan winter. It’s fun, scratches an itch, there are no recurring costs, and nobody sells out our privacy.

    1. Source code?

      I’d really like something like this but don’t realistically have the time to build my own hardware. I really wish someone was selling cheap MQTT connected sensors that can do all that sort of stuff.

  2. I agree with this approach and have done some of the same stuff myself, with better redundancy, ups, etc for garage door opener (our water pump controls are in the garage, when the power fails we’ve no water and no way to open the garage), the same for our heating system. But the problem is, if I die and there is a problem with a completely proprietary system, what happens? Ive SD card images on the computer along with schematics and published it all to github, but will the average plumber/electrician know that? Will they look at the systems I have in place and actually work it out and replace the faulty raspberry pi/memory card or PSU or just rip the thing out and replace it with a commercial one that hasn’t got the purpose built features that were either necessary for us or just nice to have. Out of curiosity how do other people deal with mitigating this kind of risk?

    1. I actually never thought of that because I rent and design everything to be fastly pulled out or subtly abandoned (I have left a couple of esp behind the sockets of previous houses).

      But it’s a really nice and interesting question. I guess you only can mitigate with in site info. Like a QR code or link in the solder mask /enclosure which lead you to documentations.

      Assuming, of course, someone want to take the effort to repair it.

    2. At my work in every electrical cabinet, in the door there is a slot where you can find the documentation of the system. Be it electrical schematic or pneumatic schematic, manual of the different system used and so on.
      I believe it’s the same everywhere.

      So maybe make something similar? Either print out the docs and store it somewhere in the system or, instead of using so much paper, just a paper with the link to your GitHub (With a QRcode for easy access with a smartphone).

      1. I have Tradfri lights for my “smart” lighting, and everything else is either running alongside a conventional system for monitoring, or replaces a commercial offering. If I sell my house to muggles I will pull out all the smart stuff, and reinstall the shitty commercial stuff I replaced.

      2. Yeah, we’ve got the same in work. Loads of documentation and source code libraries. But when you’ve teams of people and they have a wiki/knowledge base that’s known about and utilised it’s fine. I have the same or similar at home but ensuring people know about it is a different job. I know a fella (sole trader) who held his commercial code for his solutions in escrow. When he passed away unexpectedly it mean we (as in my job) were able to go through it to fix an issue and keep it updated while we worked to source another solution with support. Ideally I’d like to do the same for my home solutions.

      1. Absolutely, hence why I’ve a ups out there. That’s unlikely to fail (as I periodically check the batteries) and if it does once the mains kicks in it’ll work, along with the water pump from the well.

        1. I don’t think I’ve ever seen an automatic garage door opener that didn’t have a manual way of opening the door. Most have a cord attached that you simply pull and it disengages the door from the opener mechanism and you just pull the door up using it. My opener came with a built-in battery backup that’s supposed to be good for something like 5-6 open/shut cycles with no power. I’ve never had to use it.

          1. Yeah, there is a latch on the inside that disengages the motor chain from the roller but as it’s a standalone building with no other point of entry there’s no way to manually open it from the outside when the power fails.

    3. Well, yes, of course they’ll rip it out, I’m surprised you haven’t found this to be an inevitable part of life. A simple Cold Air Intake blew the mind of a AAA guy I called when I had battery problems on the road. And when Windows 95 came out, I saw many “techs” totally reliant on commercial Windows specialty products when some simple DOS commands would be so much more efficient, and Linux! I mean, I started using Linux in 1999, and any paid PC or application service pretty much would refuse to work with it. You had to learn to consult discussion boards and learn a little system administration and Google-fu for yourself to get anything done. (Now of course, I use more privacy-conscious search engines, but now many people are totally dependent on Google- it’s same story, when someone only has a hammer, everything looks like a nail) My parents got a water filter a few years ago, and I was there when the kid installing it was very smug and condescending, as if my parents were tricked into buying something totally unnecessary, and while he may have had a point, this was just before the mass lead poisoning in Flint. When that came on the news my parents were very re-assured they had filtered water, and so was my sister with her young kids.
      When I had “Help Desk” training in 2000, any problem that took longer to fix or even diagnose than totally re-installing Office and/or Windows was pretty much ignored. That sealed my faith in using Linux.
      Among the cynical quotes accredited to PT Barnum: “no one has ever lost money betting on the ignorance of the American public!” and I’ve found it to be a cold cruel world, mostly dedicated to planned obsolescence.
      How do deal with mitigating the risk? By adopting a completely cynical attitude. lol By assuming any hard work done doing anything well and right, is just going to be F’d up when I’m not there. Reading Ozymandias by Percy Bysshe Shelley and knowing it applies to my little humble work as well as empires.
      Your best hope is that really innovative tech once in a while will come along and justify ripping out your solutions. Be realistic about this. My hope is that being blunt about this will spare you pain from learning the hard way. Good Luck and have a nice day!

    1. It is over kill but when you start down that ESP road you have to invest a lot more time on getting the software side right otherwise you’re either making flashable firmware OTA or constantly visiting the controller to unplug the USB that may not be easily accessible–all to workout the kinks. And things get even harder if you’re using the pins on the controller for proper power. I’ve gone down this road before with an ESP-01 and after the transformer, buck converter, and voltage dividers to power everything with the right voltages, the best thing I could have done was include the OTA firmware flasher to fix issues with pin flipping timing, mqtt messages, web gui, restful API, and a host of other things that would have been simpler to use ssh and a full OS. When you consider the additional cost of the pi along with a lot of wasted power and idle cpu, ESPs just make perfect sense but after adding the additional costs in time needed to really make that controller worth the effort, the pi makes perfect sense.

  3. Interesting stuff, but I am surprised by the power requirements for these monitoring and logging systems.

    My stuff does what his does, a bit more (although I am monitoring and controlling a pond, not a pool), has a power consumption of 5.7VA peak/0.1 mean for each station and uses two SLAs and two small solar panels. The controller + display/keypad located internal to house is another 4VA peak/0.3 mean and uses house mains and/or three LiPo cells (the house has a 12kVA solar system). But I also do not have the overhead of pushing data to the internet or doing any IoT stuff.

    Use the correct tools for the job. Do not beat the board with a large hammer when you should be using a small wooden mallet. I use 430 series ucontrollers for each remote site and a Teensy 3.6 for the inside controller and connection to a local server computer. The server that logs data and sends occasional email alerts does mostly other stuff, so am not certain what power number to assign – but a SWAG indicates about 21VA peak/2VA mean for the additional load on the server box. My best guesstimate for energy is approx 1.6 kWh per month, of which about 1.2 kWh comes directly or indirectly (battery) from solar. These numbers are based on two years of usage, with no recorded down-time despite SDG&E doing its best to routinely shut me down and a Santa Ana event last year with a 76mph gust and 47mph sustained.

  4. I still don’t see what’s wrong with just using a lightbulb or an led and running a long length of wire to a switch. If you’re feeling fancy, throw in a timer so it’s a little more energy efficient.

  5. This sounds a lot like my greenhouse. It started with just a solar powered pi zero and a bme280 so I could keep an eye on what was going on in there from the house. That turned into a network of 3 of them and some clever networking so all of them can be reached from my web server. But that was just the start for the greenhouse. Next came the A/D so I can watch the voltage on the battery pack and the current going into and out of it. In years past I just had a solar panel run a little pump that pulled water from the pond and into a little home brew manifold and off to the plants, but it was not efficient. It just worked when the sun was out, and it had a non submersible pump that needed to be right near the water level to work but got submersed if we got a good rain. So this year there is a submersible pump in a g gallon bucket with 5 bricks in the bottom and lots of little holes up hear the top and the pump hangs down in the bucket inches from the bottom. The bricks weigh it down to it does not move around in the pond, the small holes give it some filtering. They keep big hunks of crud out. The pump being suspended keeps it out of any silt that settles in the bucket, and being submersible it is obviously self priming. Now that runs off one a relay module on the one of the pi’s GPIO’s. I have another A/D and some of the capacitance based soil moisture sensors coming. We have had issues with people stealing stuff so another GPIO now has a hall switch on it and a magnet on the door, and I can set up any of my computes to alarm, and I can set times, so it does not go off if I go out there in the daytime. I also got a light level sensor, not sure if that is going to be anything but another line on a graph or not, but it went from having a solar cell directly connected to a little pump to a whole slew of stuff. At least in the summer. I am hoping in the winter there will be enough solar to just run the weather stuff as I am curious what difference the little structure makes. The water pump still runs off the old panel so that is not a drain, but in the winter I can get not pull the relay in and I can turn off the second A/D and the soil moisture sensors, and the hall effect switch.

Leave a Reply to Collie147Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.