Trailer tester

An ESP32-based tester for 4-pin trailers designed to exercise the turn signals and running lights, using a WiFI-served webpage for control.

Similar projects worth following
I had just bought a small trailer to connect behind my SUV for hauling small loads between my two homes. The left turn signal wasn't working, and I didn't look forward to finding the problem with jumpers, a multi-meter, and lots of swearing.

So, I threw together a small tester which can independently cycle the left and right turn signals, and can also turn on/off the running lights. This allowed me to test and find the problem much more easily.

The result is an ESP32-based system, using a four-channel relay board, a 4-pin flat trailer connector, and a 12-volt battery (to power the lights) and a 5-volt battery to power the ESP-32 and the relay board.

This tester uses and ESP32 and a 4-channel relay board which can be driven by the ESP32, along with code that provides a web-based interface for running the tester.

Thanks to the ESPUI and Task program contributors for their amazing programs.

Arduino code for Trailer Tester project

Zip Archive - 3.17 MB - 03/22/2021 at 18:49



Fritzing file for the Trailer Tester project

fzz - 667.93 kB - 03/22/2021 at 18:30


View all 8 components

  • 1
    Wire ESP32 to relay board

    Using the Fritzing breadboard drawing, wire the ESP32 to the web relay board.

    Note:  we are using the 5 volt output from the ESP32 to power the relays, and the 3.3 volt output to power the relay driver circuits.  This requires removing any jumper between the VCC and JD-VCC pins on the relay board.  We use 3.3 volts for the relay driver circuits to avoid any reliability problems with getting the relays to response to the ESP32's GPIO output levels.

  • 2
    Load the code and test it

    Download the Arduino code from Github:

    or from the Zip file attached to this posting.

    Open the Trailer_tester.ino file in the Arduino IDE.  This should also open a "task.cpp" and "task.h" file, which are used to provide scheduled tasks to drive the relays to blink at a regular rate.

    Connect a 5 volt battery or adapter to the ESP32.

    Select the proper ESP32 board (in my case it was "ESP32 dev module") and the proper port, then compile and upload the program file.

    Once it's completed the upload and is running, use either a phone or a laptop to connect to the new WiFi AP "Trailer_tester" using the password "onthemove".

    In a browser on that device go to "".  You should get a web page like this:

    You can use the "Left turn signal test" and "Right turn signal test" switches to test those relays.  They should cycle on and off at a once per second rate.

    Toggling the "Running lights test" should turn the running lights relay on and off--this relay does not blink, so it clicks only once each time you toggle the switch.

    If this works properly, proceed to the next step.  If not, check your wiring and code upload and try again.
  • 3
    Wire the 12 volt battery and the trailer connector

    Disconnect the 5 volt battery from the ESP32.

    Wire the 12 volt battery, the relay outputs, and the trailer connector to each other as shown in the Fritzing diagram.  Be careful to follow the color coding shown, as these identify the proper lights on the trailer.

View all 4 instructions

Enjoy this project?



Mike Szczys wrote 03/29/2021 at 15:10 point

That's a great solution, nice build!

  Are you sure? yes | no

Richard Fall wrote 03/29/2021 at 15:13 point

Thanks. Simple, crude, but does the job.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates