Category Archives: Projects

Motorcycle Garage Door Opener

In the past it was a hassle to get off of my motorcycle to key in the garage door code before getting back on the cycle to pull it into the garage. Stashing a garage door opener in my jacket pocket was a little better but I still had to stop to take off my motorcycle gloves. My solution was to hack a garage door opener to activate via a switch on my handle bar. Because I do almost all of my riding in the city, I never use my passing switch so this was the one I chose to tap into. The following is a guide of how I did it and was done for a LiftMaster opener/remote. The same concepts should apply to other brands but I have not tried them.

Materials

  • A LiftMaster garage door remote. Make sure you get the correct remote for your opener (based on whether the learn button on your opener is red-orange or purple ). I used the remote with only one button to keep things simple.
  • A TO-92 (3 pin through hole) NPN transistor. I bought a pack of these from RadioShack. The specific one I used is KSP2222A but there are many equivalent part numbers that will work.
  • A 2.7M Ohm 1/4 watt resistor. If you can’t find this exact one, any resistor near this value should work. I bought a huge variety pack of resistors that included this one on eBay for only a few bucks.
  • Red and black small gauge stranded wire
  • A wiretap connector to tap into your motorcycle’s switch

Tools

  • Soldering iron
  • Flush/diagonal cutter for trimming the transistor leads
  • Solder sucker or copper braid to remove the solder from the remote’s button
  • Something to notch the side of the remote. A dremel tool works well for this.

Step 1: Remove the Push Button Switch

If you haven’t already, don’t program your remote for your opener yet. You don’t want to accidentally be opening and closing your garage door while working on this project. Begin by opening up the case of your remote and removing the circuit board.

The remote with the case opened
The remote with the case opened

You’ll see a small black and silver momentary push button switch near the bottom. Pressing down on this switch completes a circuit which activates the opener. We want to remove the switch so that we can replace it with a transistor activated by a 12V signal from the bike. Use your soldering iron and solder sucker or copper braid to remove the solder from the pins of the button.

Removing the solder from the button's pins
Removing the solder from the button’s pins

After the solder is removed, the button will easily come off of the board.

Circuit board with the button removed
Circuit board with the button removed

Step 2: Solder the transistor

Next we need to replace the button with the transistor. The transistor acts as an electronic switch. When the base of the transistor is activated by the 12 volts from the motorcycle, it will allow current to flow from the collector to the emitter. Bend up the middle lead of the transistor and insert the other two leads into the circuit board. Make sure it matches the orientation shown in the photo.

The circuit board with transistor
The circuit board with transistor

Then solder and trim the leads on the reverse side of the board.

The transistor leads soldered and trimmed
The transistor leads soldered and trimmed

Step 3: Add the Resistor

Only a very small current is needed for the remote’s circuit to consider our new switch “closed.” We’re going to solder a resistor to the base of the transistor to make sure we don’t damage it when we send it 12 volts from the motorcycle. Clip the leads short on the resistor and solder it to the remaining transistor lead.

Ready to solder the resistor with a helping hand.
Ready to solder the resistor with a helping hand.

Step 4: Solder signal and ground wires

Cut a couple feet of red and black wire and strip the ends. Solder one end of the red wire to the end of the resistor.  Solder one end of the black wire to the circuit board as shown.

LiftMaster PCB
The Modified LiftMaster PCB

Step 5: Modify the case

You’ll need to cut a couple notches into the garage door opener’s case where the wires will come out. I believe I used a dremel tool for this. When you’re done, thread the wires through the notches, and snap the circuit board back into its case.

The notched opener case.
The notched opener case.

Modified LiftMaster
With the modifications to the LiftMaster garage door opener complete, it’s ready to install on the motorcycle.

Step 6: Program and test the remote

For this step you need access to a 12 volt power source–the terminals of your motorcycle’s battery will work in a pinch. To program the remote, tap the orange or purple learn button on your opener then hold the red wire to the positive terminal on the battery and the black wire to the negative terminal for a few seconds. Your garage door light should blink when the programming is complete.

Now disconnect the remote then connect it once more. If your garage door activates, it’s working!

Step 7: Install opener on motorcycle

This is where you get to be a bit creative. I chose to tap the red signal wire into the high beam wire on my SV650, allowing me to use my passing signal to trigger the garage door opener. To do this, I made a small cut to get into the wire bundle near my steering column then used the posi-tap connector to make the connection. I then wrapped the bundle back up with electrical tape. You can either connect the ground to a ground wire on your motorcycle or to any metal part of the frame. I chose to screw it down using the screws holding down my gas tank.

Finally, you’ll need a place to stash the remote. On my SV650, I found that there was extra space underneath my gas tank in front of the airbox.

I forgot to take pictures of this step but if you think it’d be helpful let me know and I’ll post some. Have fun and enjoy your motorcycle’s new garage door opening abilities!

List Authors Version 2.0 Released

Today I released version 2.0 of the List Authors WordPress widget. The underlying code has in fact existed for quite some time in the form of a patch submitted to WordPress to enhance the abilities of the wp_list_authors template tag. My hope was that the patch would make it into version 3.0 of WP after which I could update my widget to use it. That never happened so I have instead added a custom version of the wp_list_authors function to List Authors plugin.

After several months of tweaking and re-tweaking my patch in response to comments from various WP devs, I was confident that the patch was production-ready. The feature request has been open for over a year with a working patch for six months–at this point, I doubt it will ever be released. Maybe there are legitimate performance concerns with the patch (there aren’t any problems I’m aware of), or maybe the features are just too low in priority. The patch was my attempt at contributing back to an open-source project. After this experience, I have to say I’m a bit disappointed in the whole process. Maybe I’ll try my hand at it again, but it will be with a project other than WordPress.

In the meantime, I hope those using my List Authors widget enjoy the new features of version 2.0.

PHPhotoNotes

My plan to create a PHP/MySQL implementation of my PhotoNotes script was completed sooner than expected thanks to the requests and encouragement I’ve received on the project page. This was the perfect opportunity for me to teach myself some AJAX: creating, updating, and deleting notes all happens without a page reload.

Better error handling is something I will work on in a future release. Right now, the user will not see any errors occurring from the PHP script. This is an area that needs to mature for AJAX in general. I skipped through a couple AJAX books at the book store and one didn’t even have the word “error” or “exception” in the table of contents!

PhotoNotes

My next coding side-project is another WordPress plugin. After posting some photos of my breadboard, I decided it would be nice to have a way to add notes to those photos. The current solution is Mbedr which I’m not happy with because it requires that the photos be hosted on Flickr and makes a call to Mbedr’s web server.

Take a look at the PhotoNotes project page to see my progress so far. It’s not yet saving any changes to the database but having some working display code means that I’m half way there.

Enhance WordPress wp_list_authors Template Tag

As can be seen by some of the comments left on the site, a couple of frequently requested features cannot be added to the List Authors widget because they are not supported by the underlying wp_list_authors template tag. The WordPress code for wp_list_authors needs to be changed to enable these new features.

Feature 1: Allow an upper limit to the number of authors listed. Some WordPress sites have hundreds or even thousands of contributors. wp_list_authors currently would list all of them and, worse, execute an SQL statement for each author. The proposed fix could be a non-negative integer option named “count_limit.”

Feature 2: Allow sorting of the author list. This could be an option named “sort_by” with the values “name” and “post_count.”

Today I submitted a patch to WordPress Trac including both of the above features. It also changes the code to use a JOIN statement to get the author post count instead of running an SQL statement for every author. This was a necessity to prevent inconsistencies when applying the LIMIT and ORDER BY. One of the core developers is reviewing it now and, if I’m lucky, the change will be included in the next major release (version 3.0). If that happens, you can be sure I will be updating the List Authors widget to make use of the new options.

A less frequent request but one I’ve seen is for an “exclude” option with the ability to filter out certain categories of authors. There is a separate ticket for this and I might consider submitting a patch for this next.

Breadboarding an Alarm Clock

LCD Clock on Breadboard
I actually started this a couple of months back, but now that I have something working to the point where I’m pretty excited about it, I’m ready to share my pet project. Back in college, one of my favorite classes was my small electronics class. Learning about half-adders and resistors was okay but the really fun part was using embedded programming to interface a micro-controller to the outside world. Ever since then, I’ve wanted to build some sort of embedded project of my own. I finally motivated myself to build something I’ve always wanted–an alarm clock that works the way I want it to.

Here are the features of my ideal alarm clock:

  • Accurate to within a minute per month. Even better would be to synchronize to some time source.
  • Shows date, time and day of the week (so after a rough night, I know for sure if it’s a workday or not =D )
  • Easily visible during the day and at night.
  • Time adjustment allows adding or subtracting hours and minutes. I hate missing the correct minute on my current alarm clock and having to hit the set button 59 more times.
  • Alarm can be enabled/disabled according to the day of the week. Do I need an alarm on weekends? No. Am I so lazy that I don’t want to turn the alarm on and off every weekend? Yes.

Here are the items needed for breadboarding. This will be slightly different than the final bill of materials for the finished clock due to the breadboard power supply.

Note on LCD display: I purchased my display off of Ebay for $5 and it works great. If you decide to use SparkFun’s display, keep in mind that it requires a resistor in series when you supply power to the backlight. The resistor is not included in my schematic because my display has the resistor built in.

LCD Clock Breadboard

The notes on the image should give you an idea of what the components look like and what they are for. You will need to study the schematic to hook everything up correctly. If you are feeling lost at this point, read through the first two SparkFun tutorials then stop back. They will walk you through setting up the breadboard’s power supply and loading code onto an ATmega168.

LCD Clock Schematic
LCD Clock Schematic

If you’ve gotten this far, you’re probably interested in the code behind the alarm clock. It is available here. Keep in mind this is not a finished product yet so there are still some features missing. The RTC (real time clock) code is fairly solid though.

I already have a PCB layout ready in Eagle which I’m going to send out to get printed. I’m really looking forward to migrating from the breadboard to the finished product. I’ll make sure to post the result!

List Authors 1.1.1

A sidebar widget to display a list of authors in your WordPress blog. Based off of List Authors Widget 1.0 by Mike Smullin. Improvements include a revised options screen (uses checkbox input fields instead of free text where appropriate) and the ability to include links to authors’ RSS feeds. If you find it useful, please leave a comment. Thanks!

The List Authors widget showing two authors along with links to their respective RSS feeds.
The List Authors widget showing two authors along with links to their respective RSS feeds.

The List Authors plugin is hosted at wordpress.org. You can find the latest features list, installation instructions, and install file there.

Update: The project page for this widget now contains the latest info and changelog.