Multicolor signal light with beeper

When debugging algorithms in an autonomous vehicle a light that can show algorithm state in real time was proven to be effective for easier debugging and additional insight to what is going on in the code.

Because all existing signal light were either to bulky or too expensive we decided to build our own. It was actually quite simple with few key elements:

  • 3x RGB LED strip
  • STM32F0 microcontroller with native USB support
  • Beeper

The STM32F0  generates 9 PWM signals for driving N-Mosfets to switch 3 individual RGB led strips. Additionally another mosfet is used to control the beeper. The microcontroller is connected to host computer by USB (virtual com port) to receive commands. Power is supplied from external 12V regulated rail. (8-14V works fine).

User (host) can set 8bit color for each LED strip with 8bit brightness. On top of that the host can also set the fade time in which the light will fade from one color to another. This was implemented to reduce traffic on USB when fading is desired.

Beeper supports up to 255 modes of which only three are implemented so far. Fast beeping, slow beeping and something in between. It is easy to implement custom beebing if there’s a need for that. Besides beep mode the host also sets beep time. This is a timeout for the beeper which can be set between (100 ms and 25.5 s). If constant beeping is desired a command for beep time has to be sent after or right before timeout occurs.

The light also reads input voltage and reports it on host’s request.

Source files on Github can be found here.

Serial protocol can be found here.

Register map can be found here.

Video:

Some pictures

2 Comments

  1. Luke says:

    Great project. Have you considered using rosserial protocol?

    • Gal says:

      Thanks. We considered it in the beginning but couldn’t find a working library for STM32 so we made our own protocol. It is working really well and we use it everywhere to connect MCUs to ROS.

Leave a Reply