bike wheel ws2811 led effects with arduino
To-do: insert neat videos or pictures from the actual ride][
Please note that the Arduino sketch works but is in progress, see the last step of the link]
Persistence of Vision (POV)
The effect allows you to display arbitrary images with several controllable pixels on fast moving objects by changing the color of the pixels quickly enough.
There are a lot of existing POV items that use LED strips on rotating objects such as bicycle wheels or rotating CD.
This is another implementation of POV on bicycle wheels.
Adafruit has a similar project where they sell the kit and have a detailed record of it, and there may be more implementation.
All of this I \'ve seen, though, uses a custom LED controller circuit.
This structure uses the most obvious non-the-
Shelf elements, need some basic welding and a lot of zipperties.
It also allows you to switch the LED effect scheme without getting off your bike and braking the short sequence (\"gestures\")
This was detected by the same sensor we used to track the wheel position.
Wireless network, Bluetooth, etc.
It\'s easy to control, too, but I didn\'t.
Here are the materials I use, but you may have similar components at home that may be compatible and work.
The price should be around $100 or less than $50 per round.
You also need it if you don\'t have a LiPo charger.
You also need a bike (
Or at least wheels).
If you are new to Arduino, you should know that you may need a USB-to-
A serial adapter to program the motherboard unless the Arduino already has a USB port or unless there is a real serial port and cable in your computer.
You may want to reproduce my settings completely if you don\'t code.
If you are not new to Arduino, my code currently has only a few basic LED programs and you may want to modify/add your own.
The code is about 400-
700 frames per second, such as 20 km/h, the perimeter of each LED is only about 200 virtual pixels, depending on the wheel diameter and the strength of the effect code on the Arduino.
I don\'t store the bitmap on Arduino, each effect (programme)
Is a function that calculates the current color of each LED.
For more information on firmware, at the last step of this manual, we program Arduino.
Let\'s connect these parts.
This is the schematic diagram of my wiring.
There are no separate electrical components, only batteries, LEDs, voltage regulators, Arduino and cables.
One thing I recall that would add is the connection between BAT and one of the Arduino analog inputs, E. G. g. A3 (PC3)
Arduino can measure the battery voltage through the voltage divider resistor.
Releasing LiPo cells below 3v can destroy the cells. [
Note: I\'m not sure what these exact LEDs are called, probably WS2812B.
In the figure, I use WS2811 as the name of the WS281x chip family and its clones]
To power the Arduino, we will connect it to the voltage regulator through its VCC and GND pins.
The regulator comes with a look like 3-
Standard master pinheader.
So we just need some male pins.
Title on Arduino.
On the Pro Mini, the penetration hole of the Power pin is the opposite of the reset button, and there are three serial port pins: Tx, Rx, and DTR.
We will also be programming with three serial port pins, so just weld a 5-
Marked as: GND, VCC, RXT, TXD, DTR (
DTR label at the bottom of the PCB)
The power connector is ready.
When you connect the servo lead of the regulator, just make sure that the black or brown wire is connected to the GND, the red is connected to the VCC, the third pin is connected to the RXT, there may be no padding on the servo connector, there may also be virtual white or yellow wires.
I started with an led for testing, but made the connector for expansion for 6 of them, and later used 6.
Each \"connector\" is a 4-Wire female pin
Title from 40-pin row.
I installed the head vertically on the side of the Arduino board, with a certain distance between each head so that the male connector can be a little thicker than the pin head, as shown in the figure.
The connector has the following lines from one side close to the Arduino: GND, 5 v, DOUT & DIN.
I was too lazy to make a proper PCB to weld the joints, so I made an ugly ladder and initially put it in the air with the third hand.
The GND line of all 6 heads is connected together through a rigid line, like through-
Hole resistance, the 5v line of the connector is the same.
If the pictures and charts in step 1 are sufficient for you to follow, then you do not need to read all the details below.
Sorry, I didn\'t have a picture until the whole shebang was covered with hot glue, and you can also see that I did some redesign there. . .
I used it for a few hundred kilometers, though.
I\'m not very good at soldering so this is what I do: Now, we need to connect these heads to the corresponding Arduino pins and make some connections between the head pairs for the LED signal.
Connect the ground wire under the head to the GND pin on the long side of the Arduino PCB using another wire, for 5v (VCC)line.
Perhaps a cable with a plastic sheath is used to avoid short circuit at the intersection of the wire.
To connect the signal line, you need to set up some numbers for the title connector, which doesn\'t matter, but we need to call them.
Connect pin 3 of connector 1 to pin 4 using another wire (
The farthest one from Arduino)
Pin 3 of Connector 3 is the same as pin 4 of connector 4.
Pin 3 for Connector 5 is the same as pin 4 for connector 6.
Then connect pin 4 (
The farthest one from Arduino)
From connector 1 to Arduino A2 hole, pin 4 from Connector 3 to Arduino A1 hole, pin 4 from Connector 5 to Arduino 0 hole.
All in all, these are the connections needed: you will notice that the pins 3 of the connectors 2, 4 and 6 are not connected.
Sorry for the picture above, you can\'t see any picture there.
I would also recommend doing one thing: in order to avoid all the current required by the LEDs going through the GND and VCC lines on the Arduino PCB, the GND on the power connector (
The male title we added in the previous step)
The same is true for VCC lines that are connected to GND leads under 6 LED connectors.
You can weld these to the bottom of the male head below the Arduino.
IMUs $10 (sensor boards)from E-
There is a boat 3.
3V regulator so you can connect the 5v power supply directly.
All you need to do is connect four lines between the Arduino and the sensor board, which can power both the motherboard and the two lines
The pin names on the sensor board are usually: GND, vcc_in, SDA, and cl, and other pins can remain unconnected.
I connect my GND and VCC lines to GND and VCC lines under my LED bar connector.
The SDA line is connected to the SDA line of the Arduino marked with A4, while the SCL is marked with a5.
On popular cheap Pro Mini clones, the holes of these pins are located on the same side of the motherboard along with the reset button and the A7 and a8.
I believe that on the original Arduino Pro Mini, the A4 and A5 pins are separated on the longer side of the PCB close to A2 and a3.
I used the flexible 5 cm 4-
The connected wire and cable so that I can position the sensor board independently of the Arduino when needed, because the sensor board will sense the direction of the wheel.
I didn\'t use the pin header because I wasn\'t going to disconnect the sensor board.
Unless your regulator has an input connector compatible with the battery discharge connector (T-XT60 and so on. )
It may be easier to cut off any input connector it has and use the public pin-
Plug in the battery charger jack. For a 2-
The charger connector will have 3 wires for 3-
The battery will have 4 wires etc.
We want to connect the red line of the regulator to the red of the charger connector and connect the black of the regulator to black.
In other words, we just need to remove the first and last line from the connector and ignore the middle line.
But we will use the pin lines of all 4 pins (
Or how many charger connectors)
Make the grip between \"plug\" and \"socket\" stronger.
Therefore, just weld the two input lines of the regulator to the two pins at the end of the line.
Since the title doesn\'t have anything to prevent you from inserting them in reverse, be very careful to attach the red line side to the red line of the battery.
In my case, I actually have a 3-pin and a 4-
Pin the male headband so I can use 2s or 3s batteries.
Sorry again for not having a good photo.
After testing it to work with the LED light strip that we will prepare next, you may want to install the entire device now or later.
The installation is entirely up to you and I just used a lot of zippers myself
3-ties and pieces
Mm plywood sticks all together.
The sensor plate should be installed vertically in the wheel axis or in the wheel \"disc\" plane, but no precise alignment is required--
Software can explain some misplacement.
Here are some extra notes on avoiding: I used 6 LEDs on 6 spokes and you might want to use less at the beginning.
This is how to prepare one.
15-cut a piece of tape
The LEDs are long and cut it off at the white dotted line marked on the tape between the chips.
You can use scissors.
If the tape is protected by a silicon rectangular tube like mine, then the pipe is also lovely.
If the tape has some wires
Weld at the end and separate them.
Now slide the tape out of the silicon jacket.
Prepare a 4-wire cable long enough to connect the LED light strip to the socket we added to the Arduino board.
To install the belt on the same side of the wheel as the controller board, you can use shorter cables, which take longer for those opposite the hub.
Obviously, the excess cable is less problematic than the short cable.
You also need a single line of approximately the same length as the LED strip to connect the output (DO pin)
From the last WS2811 chip
Weld one end of the long wire to the DO pin. Them the four-
Wires and cables need to be connected in the following order: welding a 4-
Pin head on the other end of the cable.
Slide the jacket back.
Before installing the LED, you may want to fix the end of the silicon tube around the LED strip with some hot glue and try to inject some of them into the tube.
This will at least prevent humidity from staying inside the LED light bars, so you don\'t have to take them all off the wheels when there is a chance of rain.
You may want to leave other electronics at home, though, and you definitely want to get the battery out.
Please comment if you know a good way to waterproof the whole setup.
I hear that WD-
40 excellent in protecting SMD Electronics from water, just spray some on all pcb.
Note, however, that you should not spray anything into the barometer chip hole on the sensor board, nor should you use heat-
Glue unless you are not going to use it.
I want to make sure that all the hand welded contents are the same as the male and female heads, with heat
The glue also adds some structural support to the connectors, making it easier for them to catch with their fingers or pliers without damaging the solder joints. With the hot-
Glue gun, spots are always ugly, but you can use hot ones later
An air gun with a wide nozzle can melt the glue, force the glue into the hole, and even spread the glue across the Arduino PCB.
Finally, the LED light strip is just a zipper
Tie the spokes to make sure they don\'t slide along the spokes.
In my case, due to the symmetry in the spoke pattern, I installed 6 pairs of adjacent spokes on the three opposite sides of the wheel.
I think this mode of speaking is very standard.
Combining strips closely together helps to read POV text at low speed.
Check out my firmware code from a place where nothing has yet worked--
View the current status of the github page.
The sketch depends on the following Arduino library: I2Cdev, MPU60X0 (
Shipping with FreeIMU Library), and WS2811.
The WS2811 library needs to come from this version because it supports updating LED colors faster.
Once the library is installed, just load the wheels.
Upload the ino to the Arduino IDE and upload it to the Pro Mini board.
If your laptop does not have USB over-current protection, make sure to power the LiPo battery during flashing or disconnect the led.
For Development, I used a long cable to connect the GND, TXD, RXD, and DTS lines of the Arduino to USB-to-
Serial adapter, but VCC (and GND)
Voltage regulator and battery.
The cable is about 70 cm, allowing the wheel to turn several turns without disconnecting from the PC.