Turn Signal Counter

Introduction

Being bored and having a computer engineering background are a dangerous combination. I recently bought a new multimeter, and looking for anything I could possibly probe with it, I noticed the trailer electrical connector on the back of my truck.

I gleefully probed it with the multimeter and a circuit tester, trying out various combinations of running lights, turn signals, and brake lights to figure out what was wired where. Satisfied, I was about to tuck the connector back up under the truck when a realization struck me. "This connector is not being used," thought I, and the engineer in me could not stand the thought of having an empty socket anywhere. I would have to find a way to use it.

But what to use it for? Its intended purpose was to hook up a trailer, but towing a trailer around with me everywhere I went would be both boring and impractical. I needed another plan.

So with that, I came up with a relatively simple idea. I would create a counter to indicate how many times each turn signal had been lit since the beginning of the current trip.

Requirements

  1. The installation shall not permanently modify the truck in any manner
  2. The installation shall not affect the performance of the truck
    1. The truck shall remain legally drivable
    2. The installation shall not interfere with the operation of the tailgate or doors
  3. The installation shall be waterproof and sufficiently resistant to any weather, temperature, or operational conditions the truck is likely to encounter
  4. There shall be two counters, one for each turn signal/brake light combination
    1. Each counter shall count the number of times its turn signal or brake light becomes fully lit
    2. Each counter shall have a decimal display of at least four digits to display the count
    3. Each counter's display shall be visible to traffic following the truck
      1. Each display shall be large enough so as not to encourage tailgating
      2. The displays shall be positioned so that it is obvious which display is counting each turn signal/brake light

Plan

The truck I designed this for is my 2004 Dodge Ram. It has a 4-way connector hanging from the back, located as follows:

Connector hanging loose from truck Wiring diagram for the 4-way connector on the back of the truck

The running lights pin has a +12 V signal whenever the headlamp switch is set to parking lights or headlights. Since I normally drive with my parking lights or headlights on anyway, I was able to use this pin for my +12 V power line.

The brake/left pin has a +12 V signal whenever the left turn signal is on the lit half of its cycle or when the brake pedal is depressed, and is at 0 V otherwise. The brake/right pin behaves similarly. I used these signals to increment the left and right counters. I used rising edge, since these signals are normally off, so having the counter increment whenever they light made the most sense. With this setup, the counters increment on brake presses as well as turn signals, so it is technically a counter of how many times each of the left and right tail lights have been lit to full brightness.

The setup for each counter circuit is as follows:

Circuit logic

The CD4026BE is a decade counter and with 7-segment outputs. It counts from zero to nine and then resets. Carry out is high from zero to four. Thus, the carry out of one chip can be tied to the clock of the next higher decimal place's chip to display a proper decimal count.

It may have been possible to use four counters, a multiplexer, and a single BCD to 7-segment converter rather than four individual ones. However, the only clock signal I had to drive the multiplexer with was the turn signal itself, which only runs at about 1 Hz. Since the turn signal is my data input anyway, it would not have been ideal for me to use it as a clock regardless of its frequency, so I would have been forced to have a separate clock circuit to drive the multiplexer. In the end, I decided that such a setup wouldn't really be any simpler or more effective than simply using four BCD to 7-segment converters on each counter.

Construction

I began putting the circuit together, and determined that I needed to place the 1 MΩ resistor on the turn signal input to control bouncing. Without it, the counter tended to jump about eight to ten places on each turn signal event. A smaller resistor value may have been successful, but 1 MΩ is what I tested it with, and I saw no real reason to change something that worked. The counter also had problems resetting properly when powered on, so I also had to replace the wire from the reset pins to ground with the 22 K&Omega resistor shown in the above schematic.

Once I added the resistors, my prototype worked as expected:

Circuit prototype on breadboard Circuit prototype on breadboard, attached to the truck

At this point I was still waiting for the majority of my resistors to ship, so each of the digits had a single resistor hooked up to the common cathode, rather than a resistor on each segment's anode. The above photographs show the difference in brighness between digits that use few and many segments.

Soon I had the circuit mounted on a stripboard:

Circuit on stripboard Back of stripboard Circuit on stripboard, attached to the truck

Cost

All prices are in US dollars, not including sales tax or shipping.

PartEachQtyTotal
Trailer wire end$1.591$1.59
Pack of wire connectors$3.991$3.99
DIP-16 Decade Counter/Divider (CD4026BE)$0.758$6.00
Dual 7-segment DIP common cathode display $2.434$9.72
16-pin IC socket (2-pack) $1.294$5.16
1/8" 3-conductor stereo jack (2-pack) $1.291$2.99
22 KΩ resistors (5-pack) $0.991$0.99
1 MΩ resistors (5-pack) $0.991$0.99
1 KΩ resistor $0.0260$1.20
Stripboard $0.951$1.90
TOTAL$34.53

Status

This project is currently on hold. I still need to build a second counter for the right turn signal, and mount both counters in weatherproof cases.