This project aims to function as a bit of a swiss army knife and to interface the SmartThings cloud with a variety of devices. It’s very much in its infancy and I have a lot of learning to do in regards to device types in particular in order to get it where I want it. As of now, I have the project controlling three switches (unfortunately, all under one tile for now), and a strobing LED connected to the alarm function. As I get more devices connected and operational, I will update the code.
The main unit is composed of:
Arduino Uno
ThingShield
ProtoShield and full-size breadboard (to be replaced with a custom
shield I am designing in Fritzing).
16 channel relay board
3 channel remote control AC relay remote
Fan/light remote control (controls 3 different fans by DIP switches,
controlled by 4 relay channels)
Garage door opener
2 595 Shift Registers
A 6"" x 1"" wooden board to mount everything
When it’s done, it will monitor/control these devices:
3 AC Power Relays (similar to SmartPower)
RGB LED strip mounted under cabinets (colors based on events and time
of day, strobe in response to alarms)
3 ceiling fans with lights
Open/close garage door
Piezo speaker for audible alarm
Wired motion sensor
Wired contact sensor on exterior door
Infrared sensor for taking commands from remote control
Temperature sensor
Light sensor
Moisture sensor
Here is the Device Type code. Here is the Arduino code. These are both a bit rough still and only control a fraction of the final product.
The RGB lighting can change colors with the remote. Once hooked up to SmartThings, the idea is to set up colors or flash patterns in response to alarms, presence or mode changes, or weather alerts.
This is the board out of the remote control for my ceiling fans. The DIP switches are set to control different fans in different rooms. I have three such units, and through programming the DIP switches, I can individually address each fan or light.
Sorry it’s been awhile since I’ve updated. As much as I love tinkering with SmartThings, I have some more pressing responsibilities that have demanded a lot of my time and energy lately.
I have the LED Strip component working. I’m currently using three NPN transistors to control a short test length of LED strip mounted on the board. I’ll need some beefier transistors in order to properly switch the whole strip as it will pull significantly more amperage. The LED Strip responds to two types of commands. First, I’ve created a few generic commands for lighting up different colors. Second, the LED strip (along with a piezo speaker) respond to the Alarm device type commands. The system now creates an audible alert and flashes the LEDs alternating red and blue in response to activation from my Smart Security app.
I’ve also incorporated some nylon spacers from Fleet Farm in order to lift the boards off of the wood. This reduces stress on the boards and solder joints and also creates space to run wiring under the boards.
I’m not having success with controlling fans. My code is actuating the proper relay channels but I don’t think they’re all reliably activating. I’ve done some troubleshooting and I think the shift registers I’m using (HC595) aren’t rated for running relays. The relay board I have didn’t come with documentation so I’m not sure what it’s requirements are, but I ordered some high-power shift registers from SparkFun and hopefully that will solve the problem.
I want to give proper credit to @Jason3fc and his Smart Ceiling Fans project. (TODO: recover this project) I had the idea for an Arduino/Relay/ThingShield based system to control an LED strip and the outlets, but this project gave me the idea to extend it out to my ceiling fans and my garage door.
Here are some more pictures. I’m working on a video to detail functionality. I want to clean up the code a bit more but I will post an update to the Arduino Sketch and device type soon.
Blue LEDs. For the record, the ST Shield RGB LED is controlled completely differently than the RGB strip. I wrote the code to make both blue for consistency but easily could have done something else.
No clue, but I am really itching for arduino code examples for color control of RGB strips as well as calling back values from the arduino to ST. Is smartthing.send("value") really the only option? Whats best practice for having multiple sensors on the arudino and reporting the values all back to ST? Can it be an array or just a string?