Introduction: Smart Push-button for Garage Door
We live in Canada and winters can be brutal to motor vehicles; we park our car inside our garage but there have been a couple of times when we forgot the garage door open overnight and the northerly winds were not kind to the car or the inside of our garage. After it happened twice this past winter, I decided to fix it by installing a light indicator inside the push-button in our house to warn us if we forget it open again.
Basically this hack turns a BlinkM into a fancy garage door indicator by inserting it inside a push-button and by adding a magnetic door switch to activate it. I programmed the BlikM to flash a slow fading burst in green every 8 seconds when the garage door is closed, and flash fast with a fade effect in the red color when it is open.
Yes, I know... it could have been simpler, I could have just used a lighted push-button switch or a regular LED with the magnetic door switch, but I wanted it to be fancier than that and I have a tendency to "improve" things so I when I saw this hack that turns a BlinkM into a mini Arduino I knew it was the way I wanted to go at it; I had a couple of BlinkM handy anyway and this way I could make it flash the way I wanted.
Also, since the BlinkM is essentially a micro-controller, I can add more feature to this switch, for example I can use one of the unused inputs to flash the Blue LED to tell me when the mail man dropped by, but that is an upgrade for a later time...
Step 1: What I Used:
The nice thing about this project is that all the stuff I needed I already had on hand, nothing was specifically purchased for it.
1 x Push button switch (I was able to use the one that was already installed).
1 x BlnkM
1 x 5V DC adapter for power.
1 x Magnetic door switch- normally open (A normally closed one can be used but the code will have to be modified accordingly).
2 x terminal blocks for 4 wire connections each
* Arduino, breadboard, spare LEDs and jumper wires to program the BlinkM (See here for reference ).
* 4 conductor wire (I only used about 6 feet or 1.8 meters, but this can vary according to the individual setup).
* Soldering and de-soldering equipment plus your basic tool kit.
1 x Push button switch (I was able to use the one that was already installed).
1 x BlnkM
1 x 5V DC adapter for power.
1 x Magnetic door switch- normally open (A normally closed one can be used but the code will have to be modified accordingly).
2 x terminal blocks for 4 wire connections each
* Arduino, breadboard, spare LEDs and jumper wires to program the BlinkM (See here for reference ).
* 4 conductor wire (I only used about 6 feet or 1.8 meters, but this can vary according to the individual setup).
* Soldering and de-soldering equipment plus your basic tool kit.
Step 2: Taking the Push Button Apart
It was pretty easy to pry the back of the switch off with a flat head screwdriver.
Once I opened it I could find a good fit for the BlinkM
Step 3: Programming the BlinkM
To program the BlinkM there are a couple of options and for this step I recommend reading Tod E. Kurt's hack of turning the BlinkM into a mini Arduino: http://todbot.com/blog/2011/03/22/blinkm-smart-led-as-the-smallest-arduino/
This method makes it much easier to program the ATtiny85 microprocessor on the BlinkM than the regular AVR way; my code is included below.
* If you run into the error message “avrdude: stk500_getsync(): not in sync: resp=0×15 ″ when using ArduinoISP to program the BlinkM, it is easily fixable by putting a 100 ohm resistor between the reset pin and 5v of the Arduino after loading the ArduinoISP. It worked great on my Freeduino and Ardweeny.
In my code I have broken down the 'Fade' functions into a 'FadeUp' and a 'FadeDown' and added a 'Delay' variable in order to offer different effects.
Also note that the magnetic door switch I am using is normally open when the magnet is close to it and it closes the contacts when the magnet pulls away.
Here is a short video of how I programmed it:
This method makes it much easier to program the ATtiny85 microprocessor on the BlinkM than the regular AVR way; my code is included below.
* If you run into the error message “avrdude: stk500_getsync(): not in sync: resp=0×15 ″ when using ArduinoISP to program the BlinkM, it is easily fixable by putting a 100 ohm resistor between the reset pin and 5v of the Arduino after loading the ArduinoISP. It worked great on my Freeduino and Ardweeny.
In my code I have broken down the 'Fade' functions into a 'FadeUp' and a 'FadeDown' and added a 'Delay' variable in order to offer different effects.
Also note that the magnetic door switch I am using is normally open when the magnet is close to it and it closes the contacts when the magnet pulls away.
Here is a short video of how I programmed it:
Step 4: Rewire the BlinkM
After programming it, I removed the pins from the BlinkM and soldered the 4 conductor wire to it.
I really did not want to do this but it was the best way it would fit nicely into the push-button switch with a solid connection coming out of it. I just used some de-soldering braid and helping hands to hold it in place.
As a side note, you may want to consider soldering a 6 conductor wire for all the six connections on the BlinkM as it turned out to be harder to reprogram it when I wanted to change the timing or the flashing rates.
I really did not want to do this but it was the best way it would fit nicely into the push-button switch with a solid connection coming out of it. I just used some de-soldering braid and helping hands to hold it in place.
As a side note, you may want to consider soldering a 6 conductor wire for all the six connections on the BlinkM as it turned out to be harder to reprogram it when I wanted to change the timing or the flashing rates.
Step 5: Re-assemble the Switch With the BlinkM Inside
Step 6: Schematic and Final Assembly
As for wiring everything together, you can see from the schematic diagram that it does not get much simpler than this.
Reconnect the original two wires from the garage door opener to the switch after fishing the 4 conductor wire to the garage for power and connection to the magnetic door switch. This is where one of the terminal blocks will come in handy. I also used a terminal block inside the closet door so it would be easy for me to remove the push-button when I decide to do the mailbox indicator upgrade.
I closed the garage door while I was inside it to find the best location and properly align the magnetic switch and the magnet, then I opened and closed the door a couple of times while still inside to make sure everything was working OK.
Reconnect the original two wires from the garage door opener to the switch after fishing the 4 conductor wire to the garage for power and connection to the magnetic door switch. This is where one of the terminal blocks will come in handy. I also used a terminal block inside the closet door so it would be easy for me to remove the push-button when I decide to do the mailbox indicator upgrade.
I closed the garage door while I was inside it to find the best location and properly align the magnetic switch and the magnet, then I opened and closed the door a couple of times while still inside to make sure everything was working OK.
Step 7: Final Notes
That is it, just a simple and elegant garage door indicator with some expandability features.
Everyone at home is appreciating the new indicator, even friends and family that come for a visit think it is a neat idea.
I have been asked a couple of questions more than once so this is where I will make note of them. I covered why I decided to use the BlinkM instead of a simpler non-flashing LED at the beginning of this Instructable and I have a feeling that there will be another question regarding why did I bother with the flashing green when the garage door is closed instead of just being it turned off completely (the first question my daughter asked me after I finished installing it). My answer is that I like to know when any system is working and the little green flash every 8 seconds tells me so.
Another question that popped up in my case is why bother when you can just open your door and see if the garage door was left open?
Well that is exactly what I was trying to avoid, having to open the door to check, especially on a cold night.
Also, if you build it, you can do as you like ;)
Everyone at home is appreciating the new indicator, even friends and family that come for a visit think it is a neat idea.
I have been asked a couple of questions more than once so this is where I will make note of them. I covered why I decided to use the BlinkM instead of a simpler non-flashing LED at the beginning of this Instructable and I have a feeling that there will be another question regarding why did I bother with the flashing green when the garage door is closed instead of just being it turned off completely (the first question my daughter asked me after I finished installing it). My answer is that I like to know when any system is working and the little green flash every 8 seconds tells me so.
Another question that popped up in my case is why bother when you can just open your door and see if the garage door was left open?
Well that is exactly what I was trying to avoid, having to open the door to check, especially on a cold night.
Also, if you build it, you can do as you like ;)