The Smart Room Controller (formerly SmartKitchen)


(Ben Edwards) #1

[Originally published 9/10/2013 by @dome]

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.


Arduino + ST to control multiple Relays
Who wants an Arduino ThingShield?
Fibaro Things - General
(Ben Edwards) #2

Some Photos

Under Cabinet lighting that will be controlled by the project.

The remote that currently controls the lighting. The plan is to add a IR receiver to take commands from the remote.

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.

The current version of the setup. Once the breadboard is replaced by a custom shield, all the components will be mounted permanently to the board

The breadboard houses dual HC595 serial to parallel shift registers, allowing control of 16 relay channels with only 3 Arduino pins.

This is the 3 channel remote control for the AC relays. Each relay controls either an On or Off command.

The last available relay will be connected to the button of a garage door opener.

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.

The Raspberry Pi is not required. I simply use it to push updates in the Arduino sketches without having to hook the setup up to my computer.

Arduino Uno, the brains of the operation.


(Ben Edwards) #3

Project Update

[Originally posted 9/25/2013 by @dome]

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.

The spacers add a nice touch.

These are the shift registers. I’m waiting on some high-power variants. Unfortunately they have a different pinout so it won’t look as neat.

Here are the transistors, the voltage regulator with capacitors, the LED strip, and the piezo element.

Red LEDs

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.

White light by turning on Red, Green, and Blue LEDs. Surprising white, but I might tweak the mix a bit to make a softer color for my wife’s taste.

The LED Strip test section and Piezo element respond to Alarm commands.

Green LEDs

I use a 12V LiPo battery pack if I am moving it around for programming and troubleshooting.

The Piezo speaker works by using the Tone command in the Arduino sketch or by simply writing it high.

[CANNOT FIND IMAGE :frowning: ]
Schematic for the setup. It’s missing the second shift register but it provides a general idea.


(Brian) #4

thanks @Ben! looks like the github links are no good anymore :frowning: Hopefully we will hear from @dome sometime soon and he can update them for us.


(Ben Edwards) #5

Dang. It seems like his whole Github account is gone. Who is this @dome character. He is a mystery.


(Brian) #6

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?


(Dome) #7

@ben @docwisdom I told my wife about this thread; she thought I should have posted some secret clues or something to add to the mystery. :smile:

For anyone seeing this, I renamed this project the Smart Room Controller. You can see future updates here.