Raspberry Pi Home Automation Part IV
In my first post I went over the layout of my Raspberry Pi home automation system. In my second post I went into a little bit more detail on the Power Supply and Raspberry Pi. In my third post I described my MOSFET controller board that I used to control the LED light strips that I have installed in the toe kick area of my kitchen and bathroom cupboards. Here are a couple of pics of the lights in action;
So the MOSFET board is great at turning the 5V or 12V from the power supply on or off to a device such as the LED lights. The MOSFET's could also be used to dim the LED lights via PWM (Pulse Width Modulation) from the Pi.
But what if you want to control a different device that has a separate power source not connected to your raspberry pi? That is where I use these small relays:
In Canada we use a forced air furnace to heat the house in the winter, and our hobby room is downstairs where it is a little cooler. So the solution is to turn the furnace fan on to circulate the warm air more evenly throughout the house. The circuit board in the furnace has a set of contacts that when shorted out (with a switch) will turn the fan on, and I'm using this relay as a remote controlled switch! The orange and green wires you see coming out of the bottom of the relay board are connected to the NO (Normally Open) contacts on the relay and to the Fan Override contacts on the furnace circuit board. The second relay (#8) is a spare for future use.
Previously, I showed how I used MOSFET's to isolate and amplify the outputs of the Raspberry Pi. The small black IC's (Integrated Circuits) above the blue relays are opto-isolators which perform a similar function. They optically (via a LED & opto-coupler inside) isolate the output from the Pi GPIO pin from the relay coil. They are great, but they don't handle much current, so I couldn't use them to drive my LED light strips. I purchased these relay boards from ebay.ca and I've seen them as single, double, quad and even 8 relay boards.
***** One word of warning, be very, very skeptical of the ratings on the top of the blue relays (grin). 10A @ 250V or 125VAC. I have found them to work great with small current loads up to a couple of amps, but I tried to use one to control a 500W halogen lamp ~4A and it worked great for about a month, and then the contacts burned out. In a later post I'll show you a circuit I built where the Pi controls a set of small blue relays, and they in turn control a much larger set of relays to a much higher current load.
In tomorrow's post, I'll go over the Node-Red software I'm using in the Pi and hopefully show you how easy it is to be able to remotely control these devices from your smartphone, or tablet!
Thanks for viewing!
Robin
Posted with STEMGeeks
Congratulations @robingreig! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @hivebuzz:
I've just caught up on your home-automation posts and I'm suitably impressed. I'm currently in the midst of building out a raspberry-pi based Zoom/Google Meet conference setup for the front room. I love to see how pi's and arduino's can be used in all sorts of purposes.
Definitely looking forward to your Node-Red configuration! I'm a big fan of Node-Red and use it almost everywhere I go. I have one instance where I'm using it to receive logs, parse them, and place them into a db. Very useful and versatile!
Thanks @wwwiebe for the feedback! Please let me know how your build goes for the Pi based Zoom/Google setup? And I wouldn't mind seeing your config for receiving and parsing the log files..... I can think of several applications for that!!!
I've been using Node-Red for about a year now, and I still think I'm a noob! There is so much power in the graphics based programming..... well you know!
The one device that cannot utilize Node-Red is the Pi ZeroW. If I recall correctly the processor cannot run the necessary version of npm or node.js (I think?) and so I've started learning mqtt and have a Pi running mosquitto that my Node-Red devices can interface with as well as my Pi ZeroW devices via Python3
I've had nothing but issues with running Node-Red on a PiZero, too. I like the idea of using mqtt instead! I've put a project on hold and might need to revisit with mqtt. I'll see if I can make a post on that soon!
It would be great to see your work on mqtt. I'll be sharing some of mine tomorrow where I've interfaced my primary node-red Pi with my Pi ZeroW's