Arduino project: putting together several demos

I’ve been playing with an Arduino Uno for the last month. After going through the tutorials, I decided to play around with mixing and matching the code and writing a little of my own. I’ve figured out how to use the Fritzing CAD software to document my board setup.

Layout of my little project.

I have a 7 segment 4 character display powered by a shift register, an RGB LED and three single color LEDs on the three PWM pins that the Uno comes with, two push buttons using a debounce library that I found on GitHub, and a photo sensor to detect how much ambient light there is in the room. One interesting note is that I played with several different ways of achieving debounce on my own and decided to go with a library. It’s just easier and more efficient than code that I could write at this point.

The program works using the two buttons as inputs to switch between the four sub-programs. When the LEDs are blinking, you hold down Button 2 and press Button 1 until the 7 segment display reads the program that you want.

The four programs are:

  1. Button 1 turns on and off the LEDs.
  2. Count up clock on the 4 digit 7 segment display.
  3. Fade the RGB LED.
  4. Display the ambient light level on the 4 digit 7 segment display.

To exit out of any of the programs, simply tap Button 2 and you will be taken back to the input.

Working on this project taught me several things including:

  • Shift registers and how they work
  • Bounce issues with inputs and how to fix that
  • What the different pins on an Arduino Uno are capable of
  • Static variables
  • Volatile variables
  • Libraries
  • And a few other things that I’m forgetting!

If you would like to look at my wild spaghetti code or the Fritzing files, it’s all available on a GitHub repository.

Now that this little project is done, I am going to play with some motor controllers and the Arduino. This is all building toward using an Arduino for an APRS radio.

PC800 Full LED Conversion

Over the course of the last few months I upgraded my PC800 from incandescent bulbs to 100% LED bulbs.  Every single bulb down to the bulb in the Honda Marine Voltmeter has been changed out for an LED replacement.  The full list of bulbs I purchased is available here.  Above you can see all of the bulbs in the meter panel lit up.  The bulbs I selected wash out the blue and green colors for the neutral and high beam lights but do well everywhere else.  It’s not a big deal to me but some people might want to color match LEDs to the various lens colors.

I ended up replacing the self-cancel turn signal unit on my PC800 with some relays to disable self-cancel functionality.  Eventually I want to build my own self-cancel unit either based upon an Arduino or done through circuit design.  It might take a few months but I’ll eventually get full turn signal cancel functionality back.  If you are doing an LED conversion, I would suggest bypassing your self-cancel unit so that you don’t let the magic smoke out.  I made that mistake which is why I ended up having to bypass my (dead) self-cancel unit.

I also replaced the flasher relay in my PC800.  Initially I built my own but then I found an off-the-shelf unit that I liked better.  Unless you like building your own electronics, I would suggest buying the off-the-shelf unit. It is much simpler.

I modified the off-the-shelf flasher unit with a relay (seen above) to disconnect the load leg of the relay from the rest of the bike when I am not using the turn signals.  This is to prevent leakage current/voltage from getting into the rest of the wiring harness and causing very dim but still visible lighting of the turn signal indicators even when they aren’t in use.  The load lead is hooked to the Normally Open side of the relay.  One side of the relay coil hooks to the +12 leg and the other hooks to the ground leg.  Note that the ground leg goes to +12 when the flashers are not in use thus deactivating the relay.  The diode that you can see above isn’t strictly necessary to the circuit but I decided to put it in anyway.  It goes with the white stripe toward the ground side of the circuit.  Easy!

This is a schematic drawing of the circuit that I used to disconnect the load leg of the relay.  Yes, it’s a bit primitive of a drawing but you should be able to get the idea.

I also decided to replace the position light relay while I was at it.  The two white wires go to the coil and the two blue wires go to the normally open part of the relay.  There isn’t any reason to replace this relay but I decided to do it anyway.  The Honda part number is P/N: 38601-MB3-671.  Rather than pay $35-$45 for a replacement, you can build your own for under $15.  If anyone wants ore details, I can look for the schematic I drew of this circuit and post pictures.  Just leave a comment below and I will put it up. 

I swapped in the LED bulbs throughout the bike.  They are very easy to install.

 This is a good comparison between a normal bulb and an LED bulb.

I am very happy with the results.  The LED bulbs respond almost instantaneously rather than slowly like the incandescent bulbs do.  The full conversion was a little more involved than I had anticipated but it all worked out in the end.  A few notes for those who are doing this conversion: Be sure to replace the stock flasher relay and also the self-cancel module.  Be sure to install the relay as I did on top of the automotive replacement relay.  Otherwise you will have voltage on the harness on either the Lb or O wires.  Check the IPCRC for more information on the trouble-shooting process I went through.

When I get a chance, I will take some photos of the bike’s lights during the daytime and at night so that you can see what it looks like with the new lights.

Flasher Replacement for the PC800 that can be Used with LEDs

For those who have been looking for a replacement for the stock PC800 flasher unit (P/N 38301-MF8-771), the wait is over.  Behold the Tridon EP-34 LED, 2-6 lamps, 12.8V/162W max, trailering, assembled
in USA, DOT.  It’s available on Amazon or at your local auto parts store.  It is a three prong relay that fits into a headlight bulb harness (available at any auto parts store). The pin-out is:

B = Black/brown stripe
L = Gray
E = Blue/black

Note that the B and the E are reversed as compared to the stock flasher unit on my PC800. Gotta love Japanese turn signal wiring. Also note that this is on my 1989 PC800. I am the 5th-ish owner so it is very possible that the sub-harness was replaced with a newer model at some point.

Looking at the relay side connector pin-out (using a Hitachi connector), with the retaining tab at the top, the pin-out is:

Left = B
Middle = L
Right = E

Also note that I have bypassed the self-cancel turn signal control unit. I believe I toasted the one on my bike and am too short of money at the moment to purchase another unit for testing purposes.

In conclusion, you can do a full turn signal system LED bulb conversion with this relay without needing load balancing resistors or any fancy DIY circuitry.  Everything you need should cost about $25.