I am trying to incorporate my outdoor flood lights with motions sensors into my home automation system. Specifically, I would like to sense when the lights come on to trigger other home automation actions. I thought an RF switch that provides line state to the server may work best. Any thoughts or better ideas?
Flood lights and Home Automation
home-automation
Related Solutions
There is no single way of automation any task. We do live in a technology boom era and we have hundreds of solutions and thousands of ways of doing things. This is usually called prototyping. That term is fairly accurate as you are trying to create solutions based on several products. Luckily we have access to various development kits.
There are many tools out there that help us build things using modular style but also allow us to use custom built modules or completely non standard solutions. It all depends on the experience of the builder and the target audience.
This community answer should help you decide on what platforms and tools you would like to use. There is a range of easy to professional products listed here so it is really up to you to do the research into what is involved for each platform. I would like to think that every next similar question can be marked as duplicate and this community entry can be updated as time goes on
Popular "standardised" home automation solutions for non power users.
MCU Platforms that are code specific but not full CPU's
Easy for fairly experienced users
- Netduino - .NET Micro framework (Free IDE and code)
- Arduino - C with lots of libraries (Free IDE and code)
- PIC - Needs commenting as I have no experience with PIC
- IOIO-OTG - JAVA based language needs comments here. not sued this yet
Advanced and really for power programmers only
CPU (x86/ARM) Based platforms
These solutions usually allow you to select specific operating systems. Most likely Linux or Unix. But you can find Windows, Java VM or other proprietary operating systems.
You can then code in anything you want Perl, PHP, Mono, Ruby, C/C++, etc.
Where to buy fairly cheap modules, gadgets, PCB fabrication and trinkets.
- eBay
- Seeedstudio
- Sparkfun
Seems so expensive?
Yes, unfortunately using standardised solutions you might have to fork out a substantial amount of money. But that usually means you will have things done allot quicker.
The cheapest MCU are Atmel's or PIC MCU - Amongst the cheapest and smallest is an Atmel aTiny 861 for a few dollars and the Atmel atMega range allows for more inputs and outputs - but still can be found under 10 dollars (chip only) - Atmega also do wireless solution that are much cheaper than xbee for example. You have to understand C though and there can be a lot of tinkering involved.
Platforms like the Raspberry Pi can be used as a "cheap" central computer that can run a database like mysql, connect to to the internet via Wifi/LAN, act as a web server, communicate with MCU's via UART over RF (433mhz/800mhz/1Ghz/2.4Ghz) and allow for a multitude of prototyping while using a Long Term Supported operating systems like Rasbpian (Debian) and standardised hardware like USB Webcams, Bluetooth and anything else that has a driver for it. The Raspberry is special because it also has a powerful GPU and full HD HDMI output. So you could power it behind your TV and output HD video content if you knew how to.
I've been doing something similar for the past couple of months. At present the setup only extends to my workshop (for testing). Currently I am using a single UNO for control which reads various sensor states, including light level and temperature/humidity, plus some door (reed relay) and IR movement sensors. The arduino reads the state and sends messages to some software ( currently Python 2.7 under Ubuntu) over UDP which then does the processing that is required and sends control commands back to the Arduino, again over UDP. The processing currently amounts to checking the internal light sensors and switching on the lights if necessary. Ultimately I want to migrate all my lighting to 12v LED so I can run off stored solar, but at present I am using a system similar to yours in that the relays are in series with the power switch for the lights, normally closed, so that if the control circuitry fails the light switches should operate as normal. I also have some external IR sensors and the same system activates an external security light, this time with a normally open relay. I consider using the normally closed relays as essential for the main lights, otherwise the domestic management will kick off once the system is rolled out to the rest of the house. I want to use LEDS because of their dimmable nature when using the PWM enabled pins of the Arduino, this will then enable a nice low level of light for those nocturnal toilet trips, all automatically of course. I have just taken delivery of a Mega 2560 which will provide a lot more IO. Like yourself I envisage having separate Arduino's for input and output. I am developing the control system in python, with the intention of migrating it to raspberry PI once development has finished. This will allow me to run it all an enclosure with a status screen hooked up to the composite video. I currently have a limited status screen running on the PC, which allows me to control the brightness of LED panels and GU16 bulbs. I have configured the arduino so it will accept commands from any device on the network, so I can set up some control from the android devices I have around the house. I also have a fully working zoneminder installation, but had not considered using it to trigger anything as yet, but then again I don't have any internal cameras on that, just external. I did consider thermal imaging, as you suggested, but I think cost is a major issues (would need to come in at below $100 Australian, per room to be feasible for me), so I'm persevering with low cost IR sensors (about $2 each from China). My Arduino code is not best but I am more than willing to share it. It is currently set up to monitor the various sensors in a constant loop, and also listens for a 3byte UDP string in the form of 410 (4 is light 4, 1 is for on, the last digit is used for a brightness level for the LED)
I do agree with the comment about the resale values of the house, but I'm not planning to move anytime in the foreseeable future. Your needs may be different.
The python code also does some DPMS control of the monitors in the workshop. Currently they are put to standby after 10 minutes of no workshop movement. I am in the process of setting up some power sockets that are switched in the same way as the lights, so the system can turn off things like my soldering iron and amplifiers that I frequently forget to leave on.
Let my know if I can be of any help with your project. It sounds great. Good luck
John
Best Answer
There are some productive discussions here: http://forum.arduino.cc/index.php?topic=9980.0 https://electronics.stackexchange.com/questions/79794/determine-with-arduino-if-220v-ac-power-is-on-or-off
A few ideas come to mind: 1) Stick an photosensor in front of the light connected to your home automation server. Advantage is that you don't need to modify the light's circuit. Disadvantage is that you need to run 2 low-voltage wires outside.
2) Modify the circuit to have a socket, plug in a small transformer (e.g. cell phone charger) and run that wire back to your circuit. Advantage is that it is straightforward and uses off-the shelf parts. This works great if there's a junction box indoors that you can tap.
3) Use an AC-powered relay of the types here: (e.g. Tyco R10) http://www.industrialelectronics.biz/potter/potter.html Advantages: safe, disadvantage you still need to modify the circuit.
4) Use a hall effect sensor. Advantage: no need to modify the circuit, but you still need access to it.
5) Use a custom circuit consisting of a half-bridge rectifier, a resister network divider, and an optoisolator, which is basically what a wall-wart does, except that it has a transformer in it. Advantage: cheap. Disadvantage: dangerous.