Project background image
Submitted By:Kenneth L. Anderson

I mention my Arduino-based home automation in another post but didn't share any specifics about it. In this post, I'll tell you all about it. I purchased three different Arduino single board programmable microcontrollers. They cost just a few dollars each. I loaded the programming tool on my laptop and wrote an Arduino program, called a "sketch", that turns the Arduino into a USB-connected electrical switch controller. I then bought the relay board, 8 solid state,zero-crossing, 250 volt AC, 2 amp relays. I hooked up eight electrical outlets and now control my house porch light, my Internet cable modem power, and a lamp, and have 5 spare outlets. When I can find a coffee-maker that will start making coffee when power is applied and a stereo that will work that way also, I'll plug those in, too. Over this weekend I had to replace my refrigerator and was supposed to wait 24 hours after transport to apply power to the new fridge, so I scheduled the command to turn on the fridge outlet so I wouldn't have to be there myself. Because the fridge would probably draw more than 2 amps, I controlled a 12 volt power supply with the 2 amp SSR which controlled another 250vac/15 amp relay for the fridge. What makes all this possible so easily is Linux. In Linux, a character string can be sent out the USB port so very simply from a script or person at the keyboard like this: echo "turn off" > /dev/ttyACM0. There is no way I know of to send commands out the usb that simply in Windows or Apple computers. And Linux is FREE! I mentioned that I control the power to my Internet cable modem. That is because the modem needed to be power cycled once, and until I could physically unplug it, I had no Internet. That was very inconvenient for me because the house is almost an hour from Omaha, where I am most of my week. So I wrote some lines of bash script code to periodically validate for Internet connectivity and power cycle the cable modem if it ever goes down again, the cycle the network interface of the computer. Linux is the one and only operating system that allows computer owners to make these kinds of improvements to their home, office, and laptop computers for EASY and FREE and still provide the Internet browsing and office programs everyone needs these days! Go Linux! I mentioned my porch light. How the porch light works is that the wall switch for it is a 3-way switch that only worked as a 2-way switch...until I wired my Arduino-supplied switched power to the unused light switch input. Then I got a listing of all the sunrise/sunset times from an Internet site and programmed the light to turn on a half hours after sunset and turn off a half hour before sunrise every day. This is scheduled daily for the day at 3 am by a Linux "cron" entry that uses the Linux "at" scheduling feature. For all these enhancements, I've not needed to write any code in c or any other compiled language. That is because Linux allows all this from scripting ("interpreted") bash language, which is far, far simpler to work with than compiled languages with all the added complexity of a compiler and compiler settings. Go Linux! And GO DoSpace get more Linux!