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 & Partners
    Products & Partners
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
Arduino
  • Products & Partners
  • More
Arduino
Blog An Arduino/Raspberry Pi Based Wireless Light Harness
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: screamingtiger
  • Date Created: 11 Jun 2015 1:17 PM Date Created
  • Views 7906 views
  • Likes 3 likes
  • Comments 76 comments
  • wirless_trailer
Related
Recommended

An Arduino/Raspberry Pi Based Wireless Light Harness

screamingtiger
screamingtiger
11 Jun 2015

I am going do this small side project as a way to take a break from my main project.  For a basic introduction please see my original blog post at http://www.element14.com/community/people/screamingtiger/blog/2015/04/20/a-small-project-idea--wireless-trailer-lighting-control

 

If anyone has concerns about my project, please post them in that thread.  I have changed the design slightly after doing  some research and testing.  I am also going to have a control panel in the car with me so I can monitor things as well as manually test the lights.

 

The car has running lights, brake lights, and turn signals all on separate channels.  However the trailer lights only have 2 channels as the running lights also function as turn signals. My initial analysis was incorrect that the running lights also function as brake lights.

 

First a tentative parts list and then I will explain.

2X Arduino mini pros 16mhz boot loader

1X Raspberry Pi model B

1X 2.5" TFT touchscreen LCD

1X 4 channel mechanical relay

6X AMS1117 SO-223 5V regulators

3X NRF24L01+ wireless transceivers

1X 1.5 watt solar charger

3X enclosures

1X 20,000mAh (20Ah) 12V lead acid battery

1X hobbyking 5V/5A regulator

1X 1000 mAh 2s LIPO

 

Explanation of parts :

There are 3 units involved. We have the unit that reads the car's lights, the unit that controls the trailer lights, and the unit that acts as a control panel.  All 3 are connected via the wireless adapters.

 

2X Arduino mini pros 16mhz boot loader

These will be used for the units that read the lights and control the trailer lights.  I have some of these on hand is why I went with them and the small footprint will allow me to tuck it away nicely.

 

1X Raspberry Pi model B and 1X 2.5" TFT touchscreen LCD

This will function as the main control panel with a simple interface.  The Pi attaches easily to the LCD which is why I chose this route.  Its way overkill but I feel it will be useful for other projects that also need a remote or control panel.  The control panel will allow monitoring as well as manual control of the lights for testing.

 

1X 4 channel mechanical relay

The stock lights on my trailer pull 2A for the brakes lights per side, and 500 mA per side for the running lights.  Originally I was going to use a mosfet but I see no reason with this high of current.  The brake lights will be turned on at the same time so the relay will see 4A.  However the running lights will be on separate channels as they also function as blinkers.  The 4th channel I may use to turn on internal lights in the trailer remotely.

 

6X AMS1117 SO-223 5V regulators

These small regulators will be used to power the Arduinos off of the main 12V sources which come from the vehicle as well as the 12V battery in the trailer.  They are also used to read the  vehicle lights.  My plan is to splice into the lines of each light the same way I did before when installing an off the shelf light controller.  The lights will be routed to the 5v regulators which then step down the voltages to 5V for reading via the GPIO pins on the Arduino.  I will need 4 regulators to read the lights.  1 for the brake lights, 1 for the running lights, and 1 each for each turn signal.

 

3X NRF24L01+ wireless transceivers

These 2.4ghz transceivers are similar to an I2C connection and a serial connection combined.  Each one has an ID and you can broadcast information. I will have a small protocol in place for error correction as well as some minor tamper proofing.  I don't want a rogue 2.4ghz signal to be able to mess with my lights.  I will be using a command set that requires a sequence of bytes in order to validate commands.

 

1X 1.5 watt solar charger

These can be had from Harbor Freight and low cost.  I decided that the trailer might as well be "green" and charge its own battery.  Besides its just another thing for me to forget to do.

 

The rest of the items are self explanatory and used to house the items and power the Pi.

 

I may choose to get some LED based trailer lights, but I am going to stick with the stock trailer lights for now until I have a working project.

  • Sign in to reply

Top Comments

  • mcb1
    mcb1 over 11 years ago in reply to screamingtiger +3
    Joey Did you remove the jumper .. JD-VCC to VCC ? You apply the 12v to JD-VCC NOT THE VCC PIN The 5v on the VCC pin is to power the Optocouplers ... Also note that these turn on with a LOW so you need…
  • Robert Peter Oakes
    Robert Peter Oakes over 11 years ago in reply to screamingtiger +2
    80mA for Arduino and 1A for lights adds up to 1.08Amps, not 1.8. This would provide a much longer life time (18.5 Hrs) so even with brakes you should easily get 10-12 Hr (Unless you're a heavy breaker…
  • clem57
    clem57 over 11 years ago +2
    Totally amazed is the word today. Plus a tropical depression has taken over here. LOL
  • mcb1
    mcb1 over 11 years ago in reply to screamingtiger

    Joey

    You may wish to explore some of the simple methods to reduce the current consumption.

    Nick Gammon has an excellent article with a range of easy solutions.

    In your case removing the ADC component could be one simple method.

    http://www.gammon.com.au/forum/?id=11497

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 11 years ago in reply to screamingtiger

    Joey

    I've been done this road on another vehicle that was using tail/brake only lights.

    Since you are wifi connected, you have four input signals you need to send.

    • Tailights
    • Brake Lights
    • Left Turn signal
    • Right Turn Signal

     

    The Tail and Brake are easy on their own.

    For turn signalling you simply send the state over the link and allow the trailer unit to decide.

     

    Tail and Brake OFF

    Turn the Brake light on when the Flash is ON (high).

     

    Tail ON

    Turn the Brake Light ON when the Flash is ON (high).

     

    Brakes ON

    Invert or turn OFF the brake, while the flash is ON (high).

     

    The only other things to decide is how often to pass the ON status from vehicle to trailer.

    You could use an acknowledgement system where it sends the command and the trailer acknowledges the status with 4 bits of data.

    Each bit represents the state IT recognises as being the current state.

     

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 11 years ago in reply to screamingtiger

    Joey

    If you replaced the lamps with LED, you would extend the times by a large amount.

     

    One advantage of trailers using LED is that you can use them with 12 or 24v vehicles.

    In your case there is no connection, so it doesn't matter.

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • screamingtiger
    screamingtiger over 11 years ago

    I forgot something, the transceivers need 3.3V input so I had to order some regulators for those.  They are the same as the 5V models in the description.
    The control panel I am still thinking about.  This is powered by the car's power plug in the dash or a small battery.

     

    The idea is that as I am driving, the control panel will show things such as power left in the trailer battery, the status of the connections, and which lights are doing what.

     

    Options are:

    Some LEDS and tactile buttons.  No screen.  The LEDS show a power meter and 1 led per light on the trailer which mimics the trailer light.  A button beneath each LED allow me to manually test each light.

     

    Or using an OLED and some buttons.  The same as above except the OLED shows the information instead of LEDs.

     

    OR using a touchscreen LED that replaces but the buttons and the LEDs.

     

    The first option is probably the best and all that is really needed.  However it is very 1980s.  The most modern way is to use the touchscreen.

     

    As I move into power MCUs/PICS/AVRs by batteries, I now realize how power consumption can come into play.  For example, an arduino pro mini by itself, nothing else connection pulls 80mA.  It will need 3 AAA batteries in series to get the voltage it needs, and it will drain all 3 batteries in as little as 5 hours for cheap batteries or 20 hours for high end batteries.  No one would accept this for a cell phone which pulls WAY more current than a pro mini!  Now if I put on a backlit LCD and a 2.4ghz transceiver, it will cut the time to 1/3.  So for cheap batteries I may get an hour of use!

     

    I don't plan to use cheap batteries but rather LIFE packs.  These are similar to LIPOS except way more stable and they don't get damaged by over discharging.  Fortunately, the 5V regulator will cut off before the pack is completely drained which is a good idea and would allow the use of LIPOs if I desired.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • screamingtiger
    screamingtiger over 11 years ago

    I wanted to explain how the blinkers will work.


    The vehicle has blinkers on a separate channel, that is the blinkers have their own set of lights.  The trailer however must use the running lights as blinkers by flashing them.

     

    So the arduino on the vehicle will be monitoring the blinkers, which are normally off.  It will then see when one (or both) go high.  At this point it knows a blinker is being used.  The blinker will then go low because it is well, blinking.  At this point though, its not known if the blinker will come back on.  It could flash again or it could have been turned off.  the question is how to handle this?

     

    The approach I am going to use is to use a timer. When a blinker goes high and then low again, a timer will be set.  My initial thoughts are 1000ms, and if the timer lapses and the blinker does not go high again, a command will be sent to turn the running light back on.

     

    So in summary here is the flow using the left blinker.

    Left blinker goes high, wait for blinker to go low.

    Blinker goes low, Set a timer for 1000ms.  Send a command to turn the left running light off.

    Blinker goes high.  Send a command to turn the left running light on.  Kill timer.

    Blinker goes low, Set a timer for 1000ms.  Send a command to turn the left running light off.

    The timer lapses as the blinker was turned off.  Send a command to turn the left running light on.

     

    This will keep the blinkers in sync with the vehicle and they will flash in sync as well.  I will have to empirically determine the timer's value to determine if the blinker is no longer being used.  Most lights I see flash 1 time per second.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube