Do-It-Yourself Cloud Sustainer

CentiZen

Evil Genius in Training
Accessory Maker
Hello everyone! A while back I showed off my homemade cloud sustainer - something akin to the Belkin We-Mo that can turn the Cloud off and on every hour on the hour to keep the Cloud hot 24/7. The We-Mo is a good solution, but the problem is that it is expensive (+100$) and only works for people who have iPhones. Because of that I got a lot of feedback from people asking me how they can go about building their own. I promised I would make a tutorial, and then promptly forgot about it.

Well, better late than never right? This is actually an extremely simple thing to make. If you have even a little bit of an understanding of electronics you will have no problem making this device. If you don’t want to bother with soldering and programming though, I will be offering these devices for sale in the near future (PM me if you are interested).

This is what you are going to need:
  • 1 Power-Switch Tail 2
  • 1 Teensy 2.0 or other microcontroller
  • Some wire and soldering iron
The PowerSwitch Tail 2 is available from numerous retailers across the internet, it is a very popular device that makes working with high voltage wall power simple and safe. There is no reason you could not use a PowerSwitch Tail 1, but they are hard to find and more expensive.

Meet the Power Switch Tail:
PowerSwitch%20Tail%20II.jpg

The PST2 is basically a high voltage relay in a box, with it’s control lines isolated and easily available through screw terminals on the outside of the box. You plug it into the wall, and plug the device to be controlled into it. Then, you use another device like a microcontroller to control the relay using the screw terminal control lines. We do this by connecting two wires, a ground wire and a voltage wire.

The type of relay that is used in the PST is a “fall shut” relay, meaning that when its positive wire is energized, it will switch on and let power run through it. When the control lines are shorted, grounded or otherwise have no power on them, the relay shuts off. The PowerSwitch tail requires a voltage of 3.3v or higher down the positive wire to hold the relay open. This threshold is much lower than most relays on the market, which makes the PST better suited to our applications than just a normal relay.

Meet the Teensy:
teensy2-top.jpg

The Teensy 2.0 is part of a family of microcontrollers known as “Arduinos”. The Arduino project was started several years ago by a group of electronic engineers who realized that to get kids, teens and other normal people interested in electronics design, they would need to make microcontrollers more accessible and user friendly. Arduinos plug right into a computer, and use a simple programming language based off of C to give the user complete control over what the microcontroller is capable of.

There are two major companies that create microcontrollers. Microchip is well known for the PIC line of micro’s, while Atmel has been a relatively new addition to the market with their AVR line. There are more companies out there than these two, like ARM or Freescale, but their product lines are suited more towards heavy processing loads instead of the simple logic we need in this situation.

There is a futile debate constantly broiling among the electronics engineering community as to which of these product lines are superior. It’s kind of like what happens with vape fanboys, but way, way worse and with longer acronyms. It’s all the same though really, and both of these product are fine solutions. I use Atmel because I am more familiar with it, while others like Hippie Dickie are more familiar with PIC’s.

If you are familiar enough with microcontrollers to be able to adapt the code and wiring instructions, you can use whichever controller you want. Those of you who want to use my code will need to use an Arduino compatible board. The Teensy 2.0 is the least expensive reliable board available, at 16 dollars each.

Wiring it up:
First we are going to need to attach wires to the pads on the Teensy that will be connected to the PST. These “pads” are the confusingly named gold or silver circles on the outside of the board. First, find a pad market ‘GND’. There are two of them, one at the upper left hand corner and one on the bottom. Both will work, I just prefer the top one. Solder a wire to that pad, making sure to leave enough wire to connect it to the PST.

Then, find the pad labelled ‘B0’. Its right beside the top ground pad. It is called B0 but really it is just pin 0. Solder a wire to this pad as well. After soldering both wires to the Teensy board, cut the wires down to 3 or 4 inches and strip off about half a centimeter from the free end.

Take your phillips screwdriver and unscrew the terminals market In+ and In-. The clamping teeth in the terminal will rise. Take the wire from the GND pad and put it into the In- terminal. While holding it in place with one hand, screw the terminal down with the other. Do the same with the In+ terminal and the B0 pad wire. Once the terminals are securely engaged, we are ready to program the Teensy with the proper code for switching the Cloud on and off.


Continued Next Post
 

CentiZen

Evil Genius in Training
Accessory Maker
Programming it:

Programming is something that seems like a very intimidating and daunting process to most people. Really, it isn’t - it’s just really badly taught in most education scenarios and that turns a lot of people off. Either way, in this situation you won’t need to do any real programming. Programming in this context means we are writing a previously written program on to our Teensy. It is also known as burning or flashing, though both those terms are misused today. To make an arduino program, we use the Arduino IDE, and to program that to the Teensy we use a program called Teensyduino.

Download Arduino IDE here
Download Teensyduino here

Install the Arduino IDE first. It’s easy, just keep clicking next until you get the part where it asks you for a destination folder. Erase what is in the box and put in “C:/Arduino”. When it asks you to install a driver, click Install.

Installing Teensyduino is slightly more involved. When you open the installer, it does some work to make sure you don’t already have a copy installed which would cause issues. Once it gets through that, it asks you to install another driver. Click Next, you will get a warning. Click continue anyway.

At this point you are shown a browse dialog. Browse to C:/, highlight Arduino and click next. For the next part click none, then next. Then install.

Once that completes, we are ready to write a program to the Teensy. Go to your start menu and find Arduino.

This window opens up.
Arduino%20IDE%20-%20Software%20tutorial.jpg


Your buttons probably look a little different, but it is the right program. Go to the Tools menu and click where it says “Board: Arduino Uno”. A large menu will pop out with many entries. Find Teensy 2.0 and click it.

Copy and paste this code into the program word for word:

Code:
/*
Date:    7/10/2013
Author:  CentiZen
Version: 0.1
Desciption:
 
  Cloud sustainer code for Teensy2.0/PST-2.
        www.fuckcombustion.com
 
*/
 
int millisInAnHour = 36000000;  //Because the delay timer works in seconds
int activePin = 0;              //The pin that is connected to In+ on the PST
 
//The main function of our program. It runs once at startup.
void setup() {
 
  pinMode(activePin,OUTPUT);    //Set pin 0 up as an output pin
 
}
 
//The body of the program. This repeats eternally.
void loop(){
 
  digitalWrite(activePin,HIGH); //Put 5v down the control line
  delay(millisInAnHour);        //Wait for an hour
  digitalWrite(activePin,LOW);  //Put 0v down the control line
  delay(100);                  //Wait for 100 milliseconds to let the cloud shut right off
 
}

Take the teensy, and plug a Mini-USB cord into it. Then plug it into the computer. If this is the first time you are programming this Teensy, an orange light should be blinking on it. Plug the PowerSwitch tail into the wall, and the Cloud or a light or something into the other end.

Then click the Upload (sideways arrow) button. If you copied everything in right, you should see some dialogue in the lower debug area. Then the Teensy loader should pop up. You may need to press the reset button on the teensy to get it to load.

Once the program is written to the Teensy, it should immediately flick on the relay with an audible click. Whatever appliance you have plugged in should turn on, and stay on. If you get to this point, you have successfully written the program and have everything plugged in right.

Now you can use it to keep your Cloud running perpetually! Make sure to keep a fan on it though, the Cloud isn’t designed to run constantly and you don’t want heat build up to shorten the life of the unit.

If you run into any issues or have any questions, post away in the comments and I’ll do my best to help you out. As I said, I will also be offering these for sale, if anyone wants a ready built unit - but that’s something for a different thread.
 

placetime

Well-Known Member
great work! thanks for sharing! that black text is really hard to read with the dark background, though.:2c:
 
placetime,

CentiZen

Evil Genius in Training
Accessory Maker
Again?! I need to figure out why it keeps doing that. I don't mean to do it.

I have it fixed now though. Thanks for the heads up.
 
CentiZen,
  • Like
Reactions: Tweek

CentiZen

Evil Genius in Training
Accessory Maker
This is the first time I have ever heard of that product line actually. I looked it up and it seems very interesting. Though it seems to me that to get an X10 set up, you need to have both an appliance module and a controller. Is that the case or can the appliance modules be programmed stand alone?
 
CentiZen,
  • Like
Reactions: Pipes

Hippie Dickie

The Herbal Cube
Manufacturer
you are correct - appliance module plus control program for PC/MAC that plugs into the AC line. plus, to use a smartphone, you need WiFi and the control program for a PC that is also connected to WiFi. But, then, omg!!! Total digital control -- no more logrithmic response (unless you need it), with timers -- really sophistocated timers.

i've have a few X10 outlets in my home. i've been getting the burns recently to greatly expand the system. the smartphone control may push me over the edge. Although i currently have several X10 wireless remotes (RF) that work just fine and the batteries seem to never, ever die.
 
Hippie Dickie,
  • Like
Reactions: Pipes
Top Bottom