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

Installing Bath Tile

Finishing My Basement

In case anyone has been wondering why I haven’t been posting as much, I’ve been finishing my own basement for the past year and a half and counting. Just started on the bathroom today.

I’ll be sure to update this post with more details and lessons learned.

Repairing the AC

Oh fun, the AC died on us in the middle of the hot season. It seems to want to run, but doesn’t kick on properly.

Doing some research online, I discovered that it must be either the relay, or the starting capacitor. Luckily I was able to find some replacements on Amazon. Those two days seemed like forever! But one I replaced the parts (and the fuses) it started right back up.

Star Wars Thermal Detonator

This is a repair job my brother came across. Apparently there were a few of these replica Star Wars Thermal Detonators made with lights and sound. Unfortunately, the one I was asked to look at, was completely dead. It didn’t take me long to find out the problem. The owner of this prop made a very terrible but honest mistake. When it came time to replace the batteries, they accidentally replaced the required N size 1.5V batteries with the similarly sized A23 12V batteries. There’s no indication at all on the battery compartment or elsewhere to clue the owner in on what size to use. Very unfortunate. At this point the internal electronics are toast and will need to be replaced, however the owner didn’t want to spend the money to get it working again. Still, it’s a pretty cool prop.

Creative Fatal1ty Gaming Headset Hack

I’ve been using this headset with my Xbox 360 for a while now. But I always found it so cumbersome to use by running an extension from the end of the cable up to where I hold my controller. So about 3 months ago I modified them to be the perfect Xbox headset.

I realize that many of my posts would be much more helpful if they had detailed instructions on how I was able to do what I did. This is one of those times where I wish I had taken more pictures while working on them, instead of just afterwards. I don’t even have a decent before picture.

Essentially, I removed the mic plug and cable and soldered it directly into the volume/mic control

The silver adapter, in the right photo above the mic plug, makes it so I can plug it directly into my Xbox 360 controller.

Now the distance from the headset to my controller is perfect with no more extra cables. So much nicer than what I was doing before.

If I ever get my hand on another one I’ll be sure to do a How-To step-by-step guide. And if anyone would like me to mod theirs I’ll do it for free. Just shoot me an email and we can work out the details.

3 ways to Free up unnecessary used HDD space on Windows 7

NOTE: These methods work best for systems that have a large amount of memory (RAM).


1. Hibernation Reserved Space

Hibernation reserves HD space up to the amount of memory your system has. To disable hibernation and recover that drive space then type the following command with administrator privileges in cmd.exe.

powercfg -h off

2. Decrease Virtual memory

Similarly to hibernation the system page file or virtual memory also reserves HD space up to the amount of memory your system has. This shouldn’t every be disabled, but you can reduce it to a more reasonable size especially if you have over 4GB of memory. Follow the steps bellow.
  • Right click “Computer” and click “Properties”
  • Click on “Advanced system settings” in the left column
  • In the “Performance” section, click on “Settings”
  • Go to the “Advanced “ tab
  • In the “Virtual Memory” section click on “Change”
  • Uncheck “Automatically manage paging File size for all drives”
  • Chose the “Custom size” radial button
    • set the “Initial size (MB):” to 512
    • set the “Maximum size (MB):” to 1024
  • Restart your computer for changes to take effect

3. Remove Service Pack 1 backups Thanks Alan McBurney

After installing Service Pack 1 about 4GB are used to maintain backup files. If you are certain that you will never need to revert back before SP1 then you can free up this space by typing the following command with administrator privileges in cmd.exe.

DISM /online /Cleanup-Image /SpSuperseded

Ruben fixes everything!

Let’s see…  I had an old dell which came to me used and with a few problems.  It was at its deathbed several times.  Ruben fixed the cd/dvd drive several times.  And showed me how to use different programs on my laptop.  He also helped me retrieve all of my files off that laptop when it finally died.  He fixed my roommate’s lamp and VCR.  Oh and he also was a most useful consultant when I was picking out a new computer.  Ruben works hard and always makes time to help those of us with less knowledge of electrical and technological things.  He’s really good at figuring out how to fix things he hasn’t actually worked with before.  Ruben is also really good at explaining what he’s doing in layman’s terms.  Thank you for everything, Ruben!  You’re awesome!!

~ Cassànndrè Sager

My First Car

1980 Mercedes Benz 300D
It was one of those cars that you buy from your parents because you don’t have any money. Since it was such an old car it is a collectors item. If only it was in mint condition I could have sold it, or traded it, for half the price of a new car. So aside from that I was fixing this car every week for the first two months I owned it. I really didn’t know much about auto repair other than what I learned in my small engines class in high school. But to me mechanics have a sense of order to them and I can generally figure things out. It just takes me longer than someone who has the know-how. Most of the repairs were relatively small such as vacuum lines leaking and starter problems among other things. Eventually, it was able to go for a month or two before problems would come up again. The biggest job was when the starter chewed up enough of the flywheel that  it wouldn’t turn over the engine. As a quick-fix, I would just take a screwdriver crawl under the car and move the flywheel a few inches to get past the chewed up part.
  
But I wasn’t about to do that for very long. To properly fix the car I was either going to have to drop the transmission or raise the engine to replace the flywheel. Lucky for me, my dad had 300TD Mercedes just sitting around with a good engine for parts. Since I was going through all the trouble to raise the engine and since the other car was a turbo model with an almost identical engine, I might as well swap engines. I was excited to have a turbo diesel because that really makes a difference in acceleration. It took me about two weeks to complete the job with some help from my dad in hoisting the old engine out and dropping the new engine in. Everything seemed to work fine, for the most part. It was having some trouble shifting. Since I knew nothing about transmissions and I wasn’t about to try and rebuild a transmission on my own, I decided to spend a bit of money and have a professional take a look at it. The company called Gunbarrel Import Motors in Niwot, Co is an excellent mechanics and dealers. They are a bit expensive, but you get what you pay for. I finally had a car that was running well. And while It still had a few things that needed fixing, it served me well as my first car.

Dell Laptop Puzzle

Before I became a network administrator assistant at my high school I had a reputation among my peers that I could fix anything. So when the IT crew ran into a problem they would usually ask for my help.

In this case, they had to completely disassemble this Dell laptop to reset the bios. For whatever reason, the IT crew couldn’t figure out or didn’t care to put the laptop back together. So one of them approached me and told me that I could have the laptop if I could put it back together. In just over 30min I had it back together and booting.

The best part is that I have never taken a laptop apart before and had to figure it out on my own. Just like a jigsaw puzzle except I didn’t have a picture to look at. The hardest part was figuring out where all the screws went. So of course, there were a few left over.

Note: This great guide wasn’t available until 2010. Trust me I tried google first, It is amazing how far the internet has come in the last 10 years.