RGB Scooter

RGB Scooter

I don't need to explain why I did this, do I? Putting lots of WS2812 RGB LEDs on everything is a common thing to do, and this of course applies to scooters. However, I was not fully satisfied with the existing projects, since most of them were just boringly shining in all colors.

Features

This scooter is different! It can not only light your way in the dark, but it can do so synchronized to your driving speed! Yes, it has a tacho and allows for LED effects that "are locked on the ground", with the scooter hovering above them.

Here is the full feature list:

Bill of materials

Most components are easily available at your favourite chinese marketplace:

A scooter obviously
(20-30 EUR)
"Blue Pill" STM32F103 microcontroller board
(2 EUR)
WS2812b LED strip
(ca. 20 EUR for 4 meters)
Any small push-button
(10ct)
LM2596-based DC/DC converter
(1 EUR)
Hall sensor (e.g. A3144)
(1 EUR)
5x small strong magnets (4x4x1mm)
(3 EUR)
a couple of 3-pin servo extension cords
(3 EUR)
LiPo battery (e.g. 3S 2200mAh)
(10 EUR)
XT-60 connector
(1 EUR)
serial-to-usb converter
(2 EUR)
some resistors, wire etc.
(?? ct)

Building instructions

LED strips

Glue them wherever you want and daisy-chain them as follows: side1, front, side2, bottom1, bottom2. Note that bottom1 goes to the rear, while bottom2 goes back to the front. Similar for the side lights. You can use loads of hot glue to fixate the wiring.

Blue pill board

Remove all pins (including the BOOT0/1 pin header). Solder BOOT0 and PA10 together, and glue a push-button onto the board that shorts these two pins with 3.3V. For convenience, you might want to solder two male 3-pin servo cables to PA7 and PA8 (tacho and led data) and to +5V, GND and PA0 (DC/DC-regulator connection and battery measurement). Also add a female socket for the UART to PA9,PA10,GND and glue it to the board.

Tacho

Glue an arbitrary number of neodymium magnets (I used 4x4x1mm) to the rear wheel and place the hall sensor such that it can detect the magnets. You don't need to be too precise, any jitter of the magnets can be corrected in software.

DC/DC-converter and battery measurement

Solder a XT60 connector (or your favorite battery connector) to the input terminals of the LM2596 board. Also solder two resistors to the input terminals like below and connect (*) with the battery measurement pin(PA0).

(+)---[100kOhm]---(*)---[10kOhm]---(-)

Other stuff

Hot glue, velcro tape and zip ties are your best friend.

Schematics

Learning the magnet distance

It is difficult to glue the magnets perfectly equally spaced and failure to do so results in a noisy speed estimate. This problem is illustrated in the graphics below, which show a continuously spinning wheel which is slowly decelerating due to friction. The colored dots signify which magnet caused the current reading.

Easily, one can recognize a repeating jumpy pattern in the left, uncompensated graph, while the compensation produces a quite smooth graph on the right. A small python tool (learn.py) reads the raw timing data recorded from the scooter while the wheel is spinning. It takes the wheel's deceleration due to friction into account and outputs the required calibration data for the firmware.

Source code

The source code and building instructions are freely available on GitHub.