Office stop light

Office Busy Signal Stoplight

Since I’m working from home these days, because of COVID-19 and social distancing to flatten the curve, I decided to clean my office. When I clean/organize I end up getting rid of a bunch of stuff I haven’t used in years. I also sometime find small treasures.

In one of the random-stuff boxes I found my Dad’s original office stoplight that he used when I was a kid. Essentially, it’s miniature stoplight that was used to indicate my Dad’s availability at any given moment. It was made with incandescent light fixtures with colored light covers. The light were controlled by two toggle switches.

Since my kids are home from school too, for the same reason I’m working from home, I thought this would be a perfect opportunity to give this stoplight box new life. Hopefully it will help the kids let me be when I’m in the middle of something.

While I could have made this from scratch that would have a much smaller profile, I wanted to keep the original look. I did replace the 6V incandescent light bulbs with colored LED’s. This was simple enough to do by cutting the light bulb fixture in half on the bandsaw. Then it was as simple as wiring up the LED’s and programming the ESP8266 thing with a very simple web interface.

Parts list:

  • Red LED
  • Yellow LED
  • Green LED
  • 220Ω resistor
  • Sparkfun ESP8266 thing
  • USB Cable
  • USB power adapter

Code:

/*
 *  Simple web LED control for a stop light.
 *  The server IP address of the ESP8266 module, will be printed to Serial when the module is connected.
 */

#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>

//////////////////////
// WiFi Definitions //
//////////////////////
const char *ssid = "your_wifi";
const char *password = "your_password";
const char *hostname = "office-stop-light";
const String title = "OFFICE STOP LIGHT CONTROL";

/////////////////////
// Pin Definitions //
/////////////////////
const int RED_LED_PIN = 4;
const int YEL_LED_PIN = 0;
const int GRN_LED_PIN = 5; // Thing's onboard, green LED

// Create an instance of the server
// specify the port to listen on as an argument
ESP8266WebServer server(80);


/* Homepage Webcode */
void send_homepage() {
  String server_index = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/><title>"+title+"</title>";
  server_index += "<style>.c{text-align: center;} div,input{padding:5px;font-size:1em;}  input{width:90%;}  body{text-align: center;font-family:verdana;} button{border:0;border-radius:0.6rem;background-color:#1fb3ec;color:#fdd;line-height:2.4rem;font-size:1.2rem;width:100%;} .q{float: right;width: 64px;text-align: right;} .button_blue {background-color: #008CBA;} .button_red {background-color: #f44336;} .button_yellow {background-color: #ffdd00; color: black;} .button_dark_grey {background-color: #555555;} .button_green {background-color: #4CAF50;} </style>";
  server_index += "<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();}</script>";
  server_index += "</head><body><div style='text-align:left;display:inline-block;min-width:260px;'>";
  server_index += "<H3>"+title+"</H3>";
  server_index += "<form action=\"/cmd_red_on\" method=\"get\"><button class=\"button_red\">Red</button></form><br/><form action=\"/cmd_yellow_on\" method=\"get\"><button class=\"button_yellow\">Yellow</button></form><br/> <form action=\"/cmd_green_on\" method=\"get\"><button class=\"button_green\">Green</button></form><br/><form action=\"/cmd_all_off\" method=\"get\"><button class=\"button_dark_grey\">Off</button></form><br/>    ";
  server.send(200, "text/html", server_index);
}

/* Go to http://office-stop-light in a web browser with a device on the same network as this ESP8266 thing. */
void handleRoot() {
  send_homepage();
}

void cmd_red_on() {
  send_homepage();
  digitalWrite(RED_LED_PIN, 1);
  digitalWrite(YEL_LED_PIN, 0);
  digitalWrite(GRN_LED_PIN, 0);
}

void cmd_yellow_on() {
  send_homepage();
  digitalWrite(RED_LED_PIN, 0);
  digitalWrite(YEL_LED_PIN, 1);
  digitalWrite(GRN_LED_PIN, 0);
}

void cmd_green_on() {
  send_homepage();
  digitalWrite(RED_LED_PIN, 0);
  digitalWrite(YEL_LED_PIN, 0);
  digitalWrite(GRN_LED_PIN, 1);
}

void cmd_all_off() {
  send_homepage();
  digitalWrite(RED_LED_PIN, 0);
  digitalWrite(YEL_LED_PIN, 0);
  digitalWrite(GRN_LED_PIN, 0);
}

void setup() {
  Serial.begin(115200);
  delay(10);

  // prepare GPIO / LED
  pinMode(RED_LED_PIN, OUTPUT);
  pinMode(YEL_LED_PIN, OUTPUT);
  pinMode(GRN_LED_PIN, OUTPUT);
  digitalWrite(RED_LED_PIN, 0);
  digitalWrite(YEL_LED_PIN, 0);
  digitalWrite(GRN_LED_PIN, 0);
  
  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.hostname(hostname);
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  
  // Configure and start the server
  server.on("/", handleRoot);
  server.on("/cmd_red_on", cmd_red_on);
  server.on("/cmd_yellow_on", cmd_yellow_on);
  server.on("/cmd_green_on", cmd_green_on);
  server.on("/cmd_all_off", cmd_all_off);
  
  //get heap status, analog input value and all GPIO statuses in one json call
  server.on("/all.json", HTTP_GET, []() {
    String json = "{";
    json += "\"heap\":" + String(ESP.getFreeHeap());
    json += ", \"analog\":" + String(analogRead(A0));
    json += ", \"gpio\":" + String((uint32_t)(((GPI | GPO) & 0xFFFF) | ((GP16I & 0x01) << 16)));
    json += "}";
    server.send(200, "text/json", json);
    json = String();
  });
  server.begin();
  Serial.println("Server started");

  // Print the IP address
  Serial.println(WiFi.localIP());
}

void loop() {
  server.handleClient();
}

Wiring Diagram

Web Interface

Growing up with a Space Ship

I was looking though my photos today, and I came across this one of a spaceship console my dad built for us kids. I remember it being one of the coolest things ever. It wasn’t even anything too fancy. Most of if was the face of an old stereo, that he wired up to make the knobs change the rate of blinking LED’s. Simple but so fun!

Makes me want to do something like this for my kids…

Power Wheel Hacks

We inherited this power wheels ATV from a dear family that moved out of state. It needed some “fixing” before we could have some fun with it. These are the things I’ve done to it since we got it.

New Battery

The original battery had long since died, and my 18V cordless drill batteries were the only ones I had that were remotely powerful enough to make it move. Sure the voltage is a bit higher than the 12V ATV is designed to run on, but now it goes faster! Also, I’ve been running it on 18V for 3 years now and it still runs great. As you can see in the photo’s I used a standard RC battery plug. Then created battery adapter to spade wire terminals. I used bits of wood to keep the right spacing of the spade wire terminals for battery connection and removal.

Bike trailer hitch

The problem with having siblings is you need to share. So I thought they could all have fun together if they could pull each other around. So I came up with this trailer hitch. Get a 3/4 in. PVC 45 degree elbow, and drill a hole clear through one side for the trailer cotter pin to go through. Then place a piece of scrap 2×4 on the inside of the battery bay, and put at least 3 screws through the PVC elbow through the body into the 2×4.

Painted it Metallic Blue

RGB Undercarriage Lights

Simply added some 12V RGB LED strips to the undercarriage of the power wheels, and added the controller that came with it. The LEDs were able to operate just fine at 18V using the LED IR controller that they came with. It also adds visibility at night.

Unfortunately the LED strips eventually fell off even after gluing them down.

Battery Level Indicator

New Treads

Now that the kids are getting bigger I noticed that the wheels tend so spin out longer, and that the ATV wont stop as quickly as it used to. This was especially apparent when they tried to pull a heavier wagon. So I found a hack online on how to take a bike tire (not inner-tube) and apply it to the hard plastic wheels to give it more traction.

Pull a Parade Float

Okay this one isn’t really a hack, but was made possible because of some of the hacks. And it is a neat thing I was able to do with my kids. We had a lot of fun, and they were able to help promote Mommy’s business (pebblebaysoaps.com). We also won 3rd place for best float!

Smart Chicken Coop Light

When we first got chickens, we were trying all kinds of things we read online to get the most out of our laying hens. This project was one of those silly ideas to try and provide more “daylight” for the chickens year round, so they would lay eggs year round.

I through this together on a weekend. With these basic features in mind:

  • On and off schedule
  • Dimmable
  • Log temperature and Humidity
  • Battery Powered

I used the following parts to make it happen (mostly because I already had them available):

I’m not going to go into a detailed step by step process on how I put this together, but hopefully between the pictures and description you can get the idea.

I followed these general steps to assemble the hardware:

  1. Layout placement of parts in the lights
  2. Modify light fixture
    • Cut out battery holder
    • Join the two light together
    • Drill out holes for charge port, and mounting points
  3. Wire components and fit into lights
    • Solder the JST Jumper wire to the battery so it can be plugged straight into the Blynk board
    • Wire the MOSFET Source -> GND, LED Cathode -> MOSFET Drain, LED Anode -> Vin, MOSFET Gate -> Pin 5. (Circuit Demo)
    • Wire temperature sensor to the ADC pin
  4. Test, rinse, repeat
  5. Semi-permanently mount board and battery
  6. Close it all up and test

Arduino sketch and Blynk app source: https://github.com/RubenFixit/smart_light_sf_blynk

Megabutton Universal Remote Mk II+

The story behind the box

My brother-in-law, Jake, who happens to be the same age as me, was born with Cerebral palsy, and so has trouble using most everyday things. Even though he can’t speak or walk, he can get around by a sort of crawl and is good at using pictures in a binder to communicate. Though it is a bit of a guessing game.

Because of his situation he spends a lot of time watching TV shows and Movies. Whenever he wanted to watch something, he would have to find his binder, and someone willing to help, then play the guessing game until someone figured out what he wanted to watch. Then we’d have to find the DVD or VHS and put it on for him.

While most of us are willing to help, the whole process felt like it could be improved in some way. In addition to a binder for communicating, he had this tablet he could use called a Dynavox. It was large and old, and had some sort of IR capabilities. So I suggested that I could set it up to control the TV and the accessories. The only problem was that the Dynavox was unbelievably expensive and we were afraid it would be abused if left downstairs by the TV.

This is when I decided to build him a Megabutton Universal Remote. A simple durable box, that could be dedicated to controlling the entertainment center.

Mark I

Originally, their entertainment system was setup with an OLD CRT tv and a Wii. So my original design included a very simply 6 button universal remote, and a Will controller hacked to use 17 arcade buttons recessed to help prevent accidental button smashing.

The problem with that design was that the remote had to be programmed by pressing the volume and channel buttons in a proper sequence. Which was hard to remember. The problem was made worse by the fact that every time the batteries fell out, which happened more often when the battery door was lost, the remote would “forget” it’s program. Even after I put a different off the shelf universal remote, that was to remember it’s program between battery changes. The other problem was that there were limited things he could do on the Wii, and eventually the Wii controller I hacked, died.

Mark II

In the mean time I had discovered Plex, a self hosted media server that you could give access to friends and family, and had built up decent library of films me and my family owned.

When I showed my Plex media collection to my brother-in-law, he was so excited and sent me home with a box of movies to add to the collection. And he pointed out that the green box that he once loved and used so much, doesn’t work anymore with their upgraded entertainment center. It was time for a makeover.

In this new design I wanted to eliminate the most annoying problems he had with the old universal remote. Namely, settings being lost during a battery change, and tedious programming. Also I had to do something about that Wii controller.

This is when I decided to see if it may be possible to use a LG Harmony remote as the brains. I had a couple Harmony 200 remotes that I’ve used, and decided to open one up to see what I could find. One neat design I discovered on this remote is that it had bare copper test points for each trace on the button matrix. I was able to use these point to solder wires to the remote, since it is extremely difficult to solder wires right onto the button pad.

I also had to extend the IR led, the device LED’s, the USB port, and power lines to get it to fit in the box. I also thought it would be much easier to wire up the buttons by using a breadboard, and a button-to-test-point map. This way to configure a button in the box, I just had to look at the map to find out which two test points to plug the arcade buttons into. Another neat trick I discovered was, that if I put an LED inside one of these arcade buttons, it is visible enough to light up the buttons. Since this Harmony remote has 3 device buttons that light up, I was able to transfer this usability design to the arcade buttons.

I was even able to leverage the Wii window in the original design for the IR receiver on the Harmony 200. This way you can still have the “remote” learn codes from other remotes.

While these upgrades made the remote 1000 times better, it still has problems. For one, the wires for the buttons would sometimes fall out of the breadboard, and I’d have instruct people over the phone on how to service it. And for some reason, this remote seems to suffer from the 3 blinking lights, problem more often than I’d like. And the fix is to hold down the number 3 button, while replacing the batteries. And the breadboard design was a lifesaver here, allowing me to add that button to one of the small push buttons leftover from the old design (3 of them and an LED right above the volume up button).

LED RGB Stars

It is nearing Christmas time again.

Last year, I was in an apartment that was doing a Christmas Light Decoration Competition. The first three winner received a discount on the next months rent.

So I decided to order some RGB LED strips from banggood.com and make some really cool IR controllable stars.

The process was simple, if not a bit tedious…

First, I measured the length of the smallest section I could get from the LED strop. Then I made a pattern, on a regular sheet of paper, that would give me the angles and length for each point in the star.

Then, I traced the angles on a piece of cardboard, cut the star out, and placed the sections of LED strips, to make sure everything fit.

Here is a picture of the star, the template, the tools I used, and the LED strips in place.

Now all that is left is to solder all the LED segments together.
This was by far the most tedious part.

And here it is all lit up.

And, why only make one when I can make three!

So Here is our final apartment balcony.

Click to view on YouTube

Toothless Wings

Nothing much to this costume. I just cut up a black fleece blanket into the general shape of toothless wings. Then used a sowing machine to sow the ridges.

I was very lazy with the lights. I hot-glued some RGB LED strips to the wings, one on each side of the center ridge. Then wired the blue lights to a 9V battery plug. Then hot glued a Velcro cable tie to the back side of the wings to hold the 9V battery.

Floodlight on Tripod

I recently acquired an LED flood light to help shed some light on my projects. I found that it works best if it is mounted up high. To do this, without putting holes in the wall, I used my tripod. It has a quick release attachment that I find very useful.

This quick release mechanism is designed to be used with a camera. However, the concept is pretty simple. In the image above, the left is the empty quick-release housing. By moving the lever on the left up, it makes it possible to insert the camera mount pad (center). The mounting pad is simply a square piece with beveled edges.

Now, How to mount the floodlight to the tripod? This is where I had the idea of creating another mounting pad that would mount to the floodlight using the existing hardware. I decided that is would be easiest to just 3D print the part even though it very well could have been made from wood or other materials with a little more effort.

As you can see, I simply duplicated the mounting pad and extended it. This allowed the nuts and bolts that hold the legs onto the light to also hold the mounting pad.

Now I can put my light on my tripod with just a flick of a switch.

And a big thank you to my brother for drawing up my idea and printing it.