3
\$\begingroup\$

New member here. I am a mechanical engineer by education and training, but electronics has been a hobby of mine since childhood. I have a little project that I have been thinking of making, but am having some trouble with the circuit design. In a nutshell, here is what I am envisioning:

Objective: Create an electronic solution to improve following driver's awareness that motorcycle is braking.

Background: I know that there are some taillights on the market that can already deliver brake light pulses, but I want to make my own controller since the bike already has an aftermarket LED integrated taillight (an integrated tail simply means that the running light, brake light, and turn signal functions are contained in one enclosure - people usually install these over the OEM setup because they look nicer on the bike). My current solution to this is to manually pulse the brake lever a few times when I start braking, but obviously an electronic solution would be more ideal.

Flow Chart: Below is a flow chart for the decision making that the device must perform. I included this to give you a better idea of what I am thinking about.

enter image description here

Main Questions: One of my requirements is that this be a "drop-in" solution. By this I mean that the device should be in series with the wires controlling the running light/brake light. There is space under the rear seat which is just above the taillight to house the device, but consideration must be given to the fact that there is heat, vibration, etc. There is a fair amount of heat (not too excessive) because the motorcycle has an under-tail exhaust.

Ideally this device should perform its functions without producing adverse effects on the circuitry upstream from it. Before prototyping anything on a solder-less breadboard I have, I plan to take current and voltage measurements on the wires that presently control the running/brake LEDs.

FYI, the running light is ON whenever the ignition is ON. The brake light is simply the running light LEDs but 2-3X brighter and the brake light is activated if either front brake lever or rear brake pedal are activated (Or both).

Note also that "OFF" in the chart below refers to LED brightness corresponding to the running light and that "ON" refers to LED brightness of the brake light.

Basically my questions regarding all of this are:

  1. Can this be implemented with low level components? (resistors, diodes, transistors, caps, etc.)
  2. I have some experience with microcontrollers (Basic Stamp) and to make something using one of them such as an Arduino or Basic stamp seems straightforward. But I would prefer something a little more rugged to be able to survive inside the tail area of the bike!
  3. I have looked at some multivibrator circuits and think that what I need is some combination of a 3 shot multivibrator and an R-S flip flop, but I can't seem to figure it out...
  4. With either solution type (low level components or microcontroller), it would seem that the device needs to be triggered by the increase in current (and or change in voltage) associated with the taillight going from the running light mode to the brake light mode.

enter image description here

Thanks for reading this and I hope it wasn't too much text! I have some more info that I can post as followup too if there is discussion in this thread.

\$\endgroup\$
  • 2
    \$\begingroup\$ This could be done with discrete divices I'm sure, but how is an Arduino or Basic stamp less rugged? The amount of intelligent control here tends to point towards a simple uC based solution. \$\endgroup\$ – horta May 2 '14 at 15:45
  • \$\begingroup\$ You don't show a line coming out of the box "Pass through V and I to produce running light". Probably should go to the top of decision block Brake OFF or ON. \$\endgroup\$ – tcrosley May 2 '14 at 18:13
  • \$\begingroup\$ thanks for catching that tcrosley! you are right, that is needed. Will add in the edited flowchart shortly :-) \$\endgroup\$ – PhilosophStein May 2 '14 at 21:28
  • \$\begingroup\$ Something just occurred to me: The main goal is to produce a contrast between two levels of LED brightness to better get the following driver's attention. What better way than to have ON/OFF pulses where ON is the Brake light LED brightness and OFF is OFF?, i.e. no LED light output! If this makes the circuit design easier to implement, then it also is a valid solution. \$\endgroup\$ – PhilosophStein May 2 '14 at 21:31
  • \$\begingroup\$ Actually having the pulsing go all the way off doesn't make things that simpler, because you would need three states of the LED -- bright, dim (running), and off; where before it was just bright and dim. (Of course the LED is always off when the whole circuit is turned off, but that doesn't require any logic.) But I do like the idea of pulsing between all off and all on, for more contrast. \$\endgroup\$ – tcrosley May 3 '14 at 0:04
2
\$\begingroup\$

As someone else has said, this would be pretty easy to do with a microcontroller, so I thought I'd try a discrete logic approach for fun.

I'm using a CD4022 octal counter as a state machine.

I'm also including a clock circuit, which provides a free-running 1/4 second clock pulse (or whatever you decide the timing should be) going into the CLK input of the counter. It uses a 555 timer configured in an astable mode. Here's a calculator which I used to figure out the required component values.

enter image description here

Here's how it works. When the brake is off, BRAKE will be at ground and the N-channel MOSFET Q3 will be off. So the pullup resistor R4 will keep the counter reset line RES high. Q0 will be high, which is not connected to anything. The other two MOSFETs will be off, so the BRAKE_LED lead will not have +12v on it.

When the the brake is on, and BRAKE line is at +12v, Q3 will be turned on, bringing the RES line low and allow the clock input to increment the counter. The Q7 output of the counter is also low, which is fed into the CLR line (called !CLOCK_ENABLE on some datasheets for the 4022). Sorry about the confusion between the Q outputs on the counter and the MOSFET designations; can't really do anything about that.

The counter counts to 1, and Q1 output goes high. This turns on the N-channel MOSFET Q2, which then turns on the P-channel MOSFET Q1, which causes +12v to be applied to the BRAKE_LED line. after 1/4 of a second, the counter advances, Q1 output goes low and the Q2 output goes high. Now MOSFET Q1 is no longer on, so the BRAKE_LED line goes back off.

This repeats for two more cycles (Q3/Q4 and Q5/Q6), generating three on/off pulses altogether. Finally the counter advances to Q7, which stops the counter from advancing further because the CLR/!CLOCK_ENABLE line is now asserted. Meanwhile Q7 high also keeps the Q2 MOSFET on through the diode, which is there so the earlier assertions of the Q2 gate lead don't stop the counter by feeding back into Q7.

When the brake is released, BRAKE goes back to ground, turning off the Q3 MOSFET and resetting the counter. All FETs are once again off, and the BRAKE_LED line is inactive.

The BRAKE lead doesn't need to be debounced, since if it bounces back from +12v to ground a few times 10's of milliseconds apart, it will just keep resetting the counter and starting over which will not be visible since the counter only increments every 1/4 second.

The parts are all available in through-hole packages from Digi-Key. VN10LP is an N-channel MOSFET in a TO-92 package. ZVP2106A is a P-channel FET also in a TO-92 package. The two ICs, LM555N and CD4022, are in DIP packages and can both be operated directly off of 12v so there is no need for a step-down regulator. All caps should be rated at 25v or higher. Resistors can be either 1/4 or 1/8 watt; none of them carry any appreciable current.

\$\endgroup\$
  • \$\begingroup\$ I ordered most of the parts from Digi-Key and a few from Mouser that I could not find on Digi-Key. I probably should have asked here for clarification before I ordered everything, but figured it wouldn't hurt to ask now anyway. On the schematic above that you provided, there are "+" signs near one terminal of some of the caps (C1, C2, C3, etc). Does that "+" sign indicate the polarity of electrolytic capacitors? I only ask because I have noticed some " + " signs in a few other places on the schematic and am not sure if those are an "artifact" of the schematic grid SW... \$\endgroup\$ – PhilosophStein May 10 '14 at 19:03
  • \$\begingroup\$ Also, another question, when does one use an electrolytic capacitor versus a ceramic capacitor? \$\endgroup\$ – PhilosophStein May 10 '14 at 19:03
  • \$\begingroup\$ @PhilosophStein Yes, the + signs both indicate the polarity, and the intention of using an electrolytic there in the first place. I tend to use ceramics for anything under 1 µF, and electrolytics for 1 µF or above. (Tantalum capacitors can also be used here, but they are generally used only on crowded PCB's where their surface mount packages are significantly smaller then equivalent electrolytics.) For some discussion on choosing between ceramics and electrolytics, see "How to choose between ceramic and electrolytic capacitors?" \$\endgroup\$ – tcrosley May 11 '14 at 0:39
  • \$\begingroup\$ I finished prototyping the circuit on a solderless breadboard. In the parts I ordered, I also got 4uF and 6uF caps to see which pulse frequency I liked the most. I ended up using the 2uF cap like in the schematic. Well, I guess now it's time to transcribe the circuit to a through-hole project breadboard... I might need to read up on the best layouts as my previous experience with PCBs involved mainly removing/replacing components on existing PCBs - not laying them out... \$\endgroup\$ – PhilosophStein May 18 '14 at 20:44
  • \$\begingroup\$ @PhilosophStein Did it work okay as designed? \$\endgroup\$ – tcrosley May 18 '14 at 21:43
2
\$\begingroup\$

Per the above discussion, I have added in a schematic of a modified version of tcrosley's circuit. Please excuse the old-school pen and paper approach since I had trouble trying to use open-source circuit diagram SW. The pen and paper approach was faster for me and I am still undecided about purchasing SW such as CircuitLab.

enter image description here

Basically, the circuit is tcrosley's circuit, but without a direct connection btwn pins 10 and 13 of the 4022N. Instead a 555 timer is used in bistable (schmitt trigger mode) as a means of producing a continuous HIGH input to pin 13 of 4022N after the last pulse. When the BRAKE is released (i.e. Low), the 555 resets and thus sends LOW to pin 13 of 4022N.

If anyone sees any obvious points of failure or concern with this circuit, please point them out. I am doing some research on PCB layouts before I begin building the circuit.

\$\endgroup\$
  • \$\begingroup\$ You can get two 555's in one package, called the 556. Re the schematic editor, I used Eagle. They have a number of pricing options, the cheapest being Eagle Light, which icludes the editor, autorouter, and layout, for $69 but it is limited to one schematic page and two sided boards. \$\endgroup\$ – tcrosley May 19 '14 at 18:12
  • \$\begingroup\$ @tcrosley Thank you for the suggestion of the dual timer 556. That should save some space. Currently the circuit is prototyped on a standard size protoboard (2.125" x 6.5") and things are fairly spread out so it was easy for me to follow. Installation wise, I am mainly limited by height under the rear seat: the volume I can put the PCB in is around 6"x5"x depth of 0.75-1.0" at most. I am also concerned with waterproofing and initially envision having the PCB inside a plastic project box (radioshack brand). However they don't seem to have any less than 1 inch in thickness. \$\endgroup\$ – PhilosophStein May 20 '14 at 20:22
  • \$\begingroup\$ I also did a quick internet search for waterproofing PCBs and came across 3 general methods where the whole board is coated in a polymer: Epoxy dip, spray-on rubberized coating, or Plasti-dip. My main concern is overheating if such coating is applied: i.e. will the PMOS overheat if the brakes are ON for a long time (say 5 mins or more for a long traffic light, accident up ahead, etc.)?? \$\endgroup\$ – PhilosophStein May 20 '14 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.