1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Design Request - Deceleration Activated Brake Lights

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by sign216, Jul 11, 2017.

  1. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    Crutschow,
    If you're confident in your initial circuit diagram, I'll order parts and put it up on a breadboard.
    Any last minute ideas or tweaks before I place the parts order?


    MrAI,
    I think tapping into the speedometer sensor signal is unnecessarily complicated, when off the shelf accelerometers are available. Nonetheless, the speedo sensor is a Hall effect sensor by the rear wheel, that measures disturbances in the sensor's magnetic field caused by steel wheel bolts as they rotate by. About the sensor, the shop manual states: "a square-wave pulse is generated with voltage between 12V and approximately 0.6 V."

    Joe
     
  2. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,028
    Likes:
    951
    Location:
    NJ
    Hi,

    Yes the speedometer version is highly dependent on what you have and what you want to buy and what you feel like using.
    If you use a microcontroller anything is possible.
    You'd have to measure the speedometer output too to see what the pulses represent. If they are PWM then they are easier to use too. If PPM then another approach, etc.
     
  3. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    It's as good as I can do with just simulation. You'll have to be the Beta tester. :rolleyes:
    You will also need some sort of small proto board and housing with provision to be able to tweak the trimpot U3 to adjust sensitivity.
    The P-MOSFET can be just about any with an Rds ON resistance of ≤0.2Ω, so just buy the cheapest you can find.
    The accelerometer is here.

    Do you need help ordering any of the parts?
     
    Last edited: Jul 18, 2017
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA

    Zapper,
    I over in the USA and I'll order from Mouser Inc, which I've used before. Mouser has an accelerometer that's cheaper than the Sparkfun unit, and the specs look similar. Could you look at it and make sure it's an equivalent? It's part no. 713-101020051, and the link is below:

    http://www.mouser.com/ProductDetail...YEfnwrR3vRf6ykgoOGYvRAcchFQbtGaXWSycIgFxfKg==
     
  6. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    That should be okay as it has the same accelerometer chip with apparently an added regulator so that the power input voltage can be from 3-5Vdc.
    The LM317 is set for 3.3V so that's not a problem.

    There is a small addition.
    I added an optional capacitor (C_Opt below) on the magnetometer output to filter out possible spurious flashing due to vibration.
    You'll have to experimentally determine if it's needed, and if so, how large.
    It will slow down the response time some so that's the tradeoff.
    I would buy 0.22uF, 0.47uf, and 1.0uF ceramic caps for that purpose.

    Note that the box must be mounted to a solid location on the bike but some foam padding underneath would minimize the effects of vibration.

    upload_2017-7-18_14-4-42.png
     
    • Like Like x 1
  7. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,028
    Likes:
    951
    Location:
    NJ
    Hi,

    I forgot to mention that in an application as critical as a rear brake light it is good to have redundancy built in. If the light does not work properly such as when going over bumps it could confuse other drivers which may interpret it as not working and thus unconsciously start to ignore it.

    This of course means two different ways to calculate the acceleration would be a good idea and some heuristics to adjust the behavior.

    A means for the driver to see the result is also a good idea and not too hard to implement. For example, a second light (such as an LED) that is connected in parallel to the brake light on the rear of the vehicle and in view by the driver, so the driver can monitor the behavior over any driving condition and cancel operation if it becomes erratic. The brake itself would still turn on the light, but not the new control system.
    This driver monitor technique would also help during the initial testing of the system.
     
    Last edited: Jul 18, 2017
    • Like Like x 1
    • Agree Agree x 1
  8. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    Thank you. Tomorrow I'll put the order together. I might have some questions if I don't understand the symbols or other terms.

    The idea of an LED so the rider can monitor the performance is good, and shouldn't be too hard to add.
     
  9. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    I don't understand some of the nomenclature or assumptions.

    1. What power rating should I get for the resistors, especially R1 and R6, that have direct connections to the battery?

    2. What is R_dummy and "6" beneath it?

    3. The capacitors, all rated for 13-14 volts (bike's system voltage)? Get non-polar ceramic caps for all?

    4. Regarding U2, which I think is LM339 or LM393, the datasheets of the products all show integrated circuits with about a dozen connections (see example attached). How do I wire it in? Which points are used for this circuit?

    5. M1 A06407 - this is a mosfet, right? I couldn't find it Mouser's catalog. Is it written correctly?

    6. U3 is potentiometer with a 1k maximum, is that right?

    I apologize for the many questions. This is an area I'm still learning about.
    Joe
     

    Attached Files:

  10. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    They dissipate very little power so can be 1/4W or smaller.
    That simulates the bulb load so is not on the real circuit.
    The ones with the polarity (+) sign are too large (1mF or 1,000μf) for ceramic so they must be electrolytic and rated for at least 25V.
    The rest should be ceramic.
    There are 2 comparators in the LM393 and 4 comparators in the LM339 but you will only be using one, so you can ignore the others.
    Power and ground are pins 3 and 12 in the schematic you referenced.
    Using the top left (#1) comparator, the (+) input is pin 5, the (-) input is pin 4, and the output is pin 2.

    I forgot to mention that you should buy a socket for whichever comparator you buy.
    Make sure you buy the comparator in a DIP package and get the DIP socket with the same number of pins (14-pin for LM339 and 8-pin for the LM393)
    Yes, that's just an arbitrary device I had in my model library.
    You can use just about any P-MOSFET with sufficient current rating.
    This, for example, is cheap and should work.
    Yes, it's a small trimpot with screwdriver adjustment.
    Pick one that is 10-25 turn and has the adjustment screw where it's readily accessible.

    Note that you should buy at least one or two extra of everything to allow for attrition (goofs). ;)


    .
     
  11. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    Thanks for the details, and (sadly) thanks the reminder to get spares.

    Also, thanks for reminding me to get the sockets. I would have completely forgotten about that too.
     
  12. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    As part of my parts order, I included an LED, as an indicator of the unit's on/off.
    Does this LED require a resistor to limit current? Or can it be wire straight to the bike's loom (a 12 to 14 v system)?
    The datasheet is attached. I ordered a red LED, no. L65DR12L.
    It's reportedly a 12v unit.
     

    Attached Files:

  13. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    If it is is specified as a 12V unit, then it shouldn't need a resistor.
    It can be wired directly to your bikes switched 12V battery (which also powers the module).
     
  14. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,028
    Likes:
    951
    Location:
    NJ
    Hi,

    Yes that one looks like it works at 12v as that is noted as "typical".
    Usually they use an internal resistor for that kind.
    Note most 12 volt charging systems actually can go up to 15 volts though when the engine is running. Probably still be ok though but testing is always good.
     
  15. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    Ok, thanks for that. I thought it would be fine, but wanted to see what the "smart guys" thought.
     
  16. Reloadron

    Reloadron Well-Known Member Most Helpful Member

    Joined:
    Dec 23, 2009
    Messages:
    6,777
    Likes:
    281
    Location:
    Cleveland, Ohio USA
    Just back from some vacation. Please post back and let us know how things progress.

    Ron
     
  17. sign216

    sign216 Member

    Joined:
    Oct 7, 2014
    Messages:
    216
    Likes:
    1
    Location:
    Boston, Massachusetts, USA
    I received my parts order. Got all parts in duplicate for approx. 1/2 to 2/3 the price of the retailed device (hurrah!), with the exception of the most expensive part, the accelerometer. Got one of those, so I'll have to use care w it.

    Sadly I'm delayed right now, as I've lost internet at home. As soon as I overcome that battle, and solved a few summer taskings (summer is short here, so it's a busy time of year) I'll post my progress. I know any of you could build this over a lunch break, but for a novice like me it's a more demanding project.

    Joe
     

Share This Page