element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Member's Forum Trailer Lights Logic
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 16 replies
  • Subscribers 550 subscribers
  • Views 1176 views
  • Users 0 members are here
  • logic
  • signal
  • light
  • brake
  • towing
  • trailer
Related

Trailer Lights Logic

ntewinkel
ntewinkel over 8 years ago

Hi all,

 

Remember this discussion (https://www.element14.com/community/message/201594/l/re-using-12v-at-base-of-transistor) a while back?

 

That's when I started a project involving a little travel trailer and trying to use a basic 4-wire wiring connection to properly light up separate brake and signal lights.

 

To sum up: the 4 wire connection from the car consists of: Ground, Marker lights (for night use), Left, and Right.

What that really means is that the brake and signal lights are combined in the 2 wires for left and right. Usually trailers just have a red light on the left and a red light on the right, and they do their thing.

 

But I bought fancy LED lights that separate out the brakes and the signal lights. Which left me trying to figure out if it was possible to do some logic to properly handle the brake and signal lights to their full potential... without rewiring the harness on the car!

 

I think I've found a way to do this using logic chips. And from what I can tell, the 4000 series chips will handle up to 18 volts, which is plenty to handle whatever the tow vehicle will throw my way.

 

I played around with it on this website I found (Simulator.io), and it seems to work like I want it to.

http://simulator.io/board/qQCIfvpreQ/3

1. If either the left or right wire is on, that orange indicator will go on, giving properly blinking

2. if both wires are on, the red brake lights go on, giving proper brake light function

3. if the brakes go on, the brake lights will remain on as long as there is power to the system (ie, at least one of the left or right wires has power)

4. if the brakes are on and one of the left or right wire goes off, then that indicator light goes one - essentially, the one side that's blinking will end up blinking but in reverse to how the car is blinking.

 

image

 

If you follow that URL above, you can play with the circuit - clicking on the "0" box beside the "Left" and "Right" inputs simulate the wire coming from the car.

 

I was going to test this using the 7400 series chips I have (using 5 volts and LEDs), but sadly I don't have any OR chips! (I'll have to fix that soon!). And making them from NAND chips looks to be very painful.

 

Here is my logic (edit: I had the wrong picture here earlier)

image

Special thanks goes to Michael Kellett michaelkellett for the idea of latching the brake lights ON and keeping it on until both wires are off.

And another special thanks goes to Douglas Wong dougw for the idea of putting together a logic truth table - that helped me get things straight in my mind, and gave me the idea to try using logic chips.

 

Anyway, what do you all think? Am I overlooking any potential problems?

 

ps, I think I also figured out a way to achieve this using just relays, but I figured solid state would be smaller and easier.

 

Thanks,

-Nico

 

edit: Note mostly to self: I have updated the trailer lights logic to now also reset when both blinker lights are off: https://simulator.io/board/qQCIfvpreQ/4

This allows the circuit to retain power and still function properly. The previous logic required power to be shut down in order to reset. The new logic allows battery or super-cap backup to keep it on.

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 8 years ago +2
    Hello Nico, Generally when designing electronics for automotive use you should go for the following rough electrical spec: "12V" supply, 5 - 28V continuous, -12V continuous, system should work correctly…
  • michaelkellett
    michaelkellett over 8 years ago in reply to ntewinkel +1
    There are automotive rated voltage regulators you could use to get the 5V (don't use a 7805) but in your case I would go for 4000 or 74HC series logic (low current) and a simple series R shunt zener regulator…
  • michaelkellett
    michaelkellett over 8 years ago in reply to michaelkellett +1
    Hello Nico, Just found this useful paper from TI re. automotive power supplies. Lots of useful background as well as specifics for a high performance (and high cost) design. http://www.ti.com/general/docs…
  • ntewinkel
    ntewinkel over 8 years ago in reply to mcb1

    I think it toggling in reverse to what the car is doing is ok. Otherwise the logic just gets more complex than it needs to be.

     

    It'd be great to test out what the commercial module does, and how it handles all the states.

     

    Did you try out the circuit at: https://simulator.io/board/qQCIfvpreQ/3   ?

    (edit: click on the zeroes beside the words "left" and "right" to change the input states)

     

    It seems to work properly for all situations. Except that the hazard lights (4-way blinkers) flash the red brake lights on and off. But I don't think there's a way around it unless we keep a logic state related to previous state.

     

    ps, keep in mind that the circuit simulator misses the bit at then end - when both inputs are off, power to the circuit goes off and the whole thing resets (in the simulator you'd need to press reset when both inputs are off)

     

    Thanks,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 8 years ago in reply to ntewinkel

    Did you try out the circuit

    No for a few reasons.....

     

    I also fell into the trap of the latched brakes staying on for a full cycle of the indicator until the power drops out the latch.

    I initially thought that was wrong and wouldn't work until I realised it was only half a cycle and who cares.

     

    I suspect some of the bits can use an SCR since they latch and have good current capability.

     

    It'd be great to test out what the commercial module does, and how it handles all the states.

    I was thinking the same thing the other week about building a test rig.

    I got asked to build another unit that does the reverse (combines 4 wire plus tailights, to 3 wire) for LED's, and thought I should build a test rig ...

     

    Looks like I have a job this afternoon, but it may be next week as I'm heading away for the weekend..

    I'll use relays and a uP.    image

     

    mark

     

    PS I did this table

     

    INPUTSTAILIGHTSTRAILER
    LRBLRLRB
    00000000
    1/0001/001/000
    01/0001/001/00
    00111001
    1/0011/011/001
    01/0111/001/01
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 8 years ago in reply to mcb1

    ntewinkel

     

    I wonder if this will do what you want.

     

    /*
    
          Trailer Lights
    
       Pin assignments
       Pin 0  Rx
       Pin 1  Tx
       Pin 2  
       Pin 3  Left Indicator      (HIGH)
       Pin 4  Right Indicator     (HIGH)
       Pin 5  Left Out
       Pin 6  Right Out
       Pin 7  Brake Out
       Pin 8
       Pin 9
       Pin 10 
       Pin 11
       Pin 13 Led
       
       Created 17 Mar 2017
       by Mark Beckett
    
       Version
       0.1  Initial Code  started 17 Mar 2017
    
       Function
       This interfaces between an American 3 wire light system and converts to 4 wire for a trailer.
       The 3 wire system uses the same light for Brake and Indicator, while the 4 wire seperates the Brake and Indicators.
    
       Requires regulator and solid state switching.
       Inputs need a resistor and zener to drop to 5v.
       
       ---------------------------------------------------
       To Do :
        
      
       */
    
      #define TailLEFT 3                // LEFT Tail light input
      #define TailRIGHT 4               // RIGHT Tail light input
      #define OutLEFT 5                // LEFT Indicator Output 
      #define OutRIGHT 6               // RIGHT Indicator Output
      #define OutBRAKE 7               // BRAKE light Output
    
      boolean  TailLEFTstate = 0;
      boolean  TailRIGHTstate = 0;
      boolean  BRAKEstate = 0; 
        
    
    void setup() {
      // put your setup code here, to run once:
    
    
    
      pinMode (TailLEFT, INPUT);
      pinMode (TailRIGHT, INPUT);
      pinMode (OutLEFT, OUTPUT);
      pinMode (OutRIGHT, OUTPUT);
      pinMode (OutBRAKE, OUTPUT);
    }
    
    void loop() 
    {
    
        TailLEFTstate = digitalRead(TailLEFT);
        TailRIGHTstate = digitalRead(TailRIGHT);
        
        if(TailLEFTstate == 1 && TailRIGHTstate == 1)
        {
          BRAKEstate = 1; 
        }
        
        if(TailLEFTstate == 0 && TailRIGHTstate == 0)
        {
          BRAKEstate = 0;
        }
        
        digitalWrite(OutBRAKE, BRAKEstate);
        digitalWrite(OutLEFT, TailLEFTstate);
        digitalWrite(OutRIGHT, TailRIGHTstate);
      
     }

     

    I'm picking that a diode from Left and Right Brake/Ind is enough for power.

    Use a 7808 to give 8v into an Arduino ( Digispark with start delay removed ... maybe ).

     

    You'll need to use a resistor and 4.8v zener across each input to drop it down.

    Perhaps a MosFET between the Left/Right vehicle tailight to drive each Indicator.

    With another MosFET using the diode common to power the brake lights.

     

     

     

    Mark

     

    edit ... minor cut and paste in pinmode.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • COMPACT
    COMPACT over 8 years ago

    It's far too complex for me! image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 8 years ago in reply to mcb1

    That looks perfect, thanks!

    I had thought about using a Digispark minus start delay - I remember looking that up.

     

    I like that the microcontroller gives a LOT of flexibility in maintaining states and doing additional logic that would be hard to do in hardware.

    But I do like that the 4000 series chips can handle the higher voltages directly.

     

    I might have to try both. Makes for good science image

     

    -Nico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • sdwilson
    sdwilson over 7 years ago

    Here's how to do it with relays

    image

    DIODE D6 MAY BE REDUNDANT OR RY1 MAY REQUIRE A DIODE LIKE D6 HAS TO PREVENT A MINUTE FLICKER DUE TO RELAY LAGGING

     

    This will retain the indicated direction when brake lights are on while lighting the brake lamps

    I also have a logic block and ladder equivalent.

    Basically while both left and right are on then (If left indicator is on then turn on left indicator but if right is also on then cut left indicator to create the flash)

    Yellow is left indicator

    Green is right indicator

    White is ground or 0v battery neg

    Red is brake light - This has pass through if connected to a non USA vehicle

    Blue, Brown, and Black are just pass through wires for service aux, tail and reverse.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube