I'm sourcing the parts now for an LED persistence of vision setup on a bicycle. Two wheels with anywhere between 16-32 LED's per wheel, as well as 24 LED's mounted on the frame of the bike itself

Since the Arduinos have to be mounted into the wheels to drive the POV displays - do I need a total of 3 arduinos?

Driven by 2x [Nano 3.0 Atmel Atmega328P Mini-USB Board][1] + an Arduino Uno from the frame? So far I think I'll pick up 2 x [433Mhz RF Transmitter Module + Receiver Module Link Kit][2] for wireless control, [Reed Switch Magnetic Detection Sensor Module][3] for calculating velocity from a small magnet mounted somewhere on one of the forks. 4 x [WS2811 RGB 8-LED Light Strip Module][4] as the POV LED's, or maybe some of the [DotStar Digital LED][5] and miscellaneously perhaps are some of these required/ useful? maybe instead of the 4x8 I could go 4x [SSC Seoul P4][6], or from [SparkFun][7], following pieces of [this guide][8]

  • DIY AT89S52 Microcontroller Development Board Set
  • [KT0026 Electronic Parts Pack][9]
  • [Square Prototyping Plate][10]
  • [ZnDiy-BRY Z-069 MB102 Breadboard + Power Supply Module][11]

My main concern is refresh rates....getting everything controlled...and making sure I have enough I/O. Any help would be greatly appreciated. (URL's available on request :P)

  • NeoPixels are not great for POV stuff because they have inherent jitter of about 2ms regardless of your frame rate and how many pixels you are driving. This can make your edges look ragged at sufficient speeds. You can read more about the source of the jitter here... wp.josh.com/2014/06/09/…
    – bigjosh
    Jun 30 '15 at 23:40

Maybe look at NeoPixels Revealed: How to (not need to) generate precisely timed signals. The author there controlled 1000 Neopixels with a Duemilanove with fairly simple code. These were WS2812 not WS2811 but perhaps the code could be adapted to suit. Judging by the datasheets they are fairly similar.

Since he got 30 fps with 1000 pixels, your requirement of around 100 pixels would seem fairly straightforward.


Those WS2811 strips are a good idea. You can control them all from pins on the same port which will make the control a little more complex but multiply the refresh rate, or you can chain all of them off a single pin if you find the refresh rate high enough that way.

  • Controlling two LED strips in parallel would not be easy. The Adafruit NeoPixel library uses inline assembly to get the timings right. There are quite a few nops in the 400 kHz bitstream / 16 MHz CPU case, so it is certainly doable, but you will have to write it in assembly and count the CPU cycles. Jun 5 '15 at 12:44
  • That's what util/delay.h is for. Jun 5 '15 at 12:46
  • Not really helpful: if you want to keep a logic level for some specified time, you have to delay for that time minus the time needed to execute the other instructions in your loop. So you still need to count the cycles in the assembly code. We are talking sub-µs timing tolerances. Jun 5 '15 at 12:53
  • There are only three transitions needed per cycle. The hard part is putting all the bits together for the second transition, and even then that has a fixed cost which would be far less than the 50us reset period. So complex, but not anywhere near impossible. Jun 5 '15 at 13:00
  • You can drive up to 8 strings at the same time from 8 different IO pins on an arduiono. Yuo do need to get all the outgoing bytes (each byte has the bit outgoing pattern for all out outputs) ready beforehand, but you can do that outside the timing-critical loop.
    – bigjosh
    Jun 30 '15 at 23:37

You wouldn't necessarily need full Arduinos - you could prototype them on Arduinos, then move them to just Atmel chips on your own board (e.g. stripboard). To do this, you would need your own resonator, power supply, and programming. Resonators are cheap and easy, you would probably want to set up your own power supply anyway (3 AA batteries is a perfect power supply for the Atmel), and you can program using a USBISP or similar, right from inside the Arduino IDE.

As for speed, I see a bicycle wheel is on the order of 26 inches/660mm diameter. This makes the perimeter about 6 foot 9 inches/2 meters (sounds like a lot, doesn't it?). Google tells me that a sprint on a bike by a fit person is about 40km/h, or 11 meters/second, making 5.5 revs/second of the wheel - about 180 milliseconds/revolution. This means that if you want 1 degree accuracy, you're going to have to change ALL the (changing) leds at about 2khz. The Arduino can run at up to 20mhz, giving you 10,000 instructions to change the leds. Plenty of time.

If you have strips, you should check the specs on the strips to see how fast you can change them. Remember that you probably have to update ALL of them, and you want most of the time to be spent between updates; while you are updating, it may show unwanted lights on/off.

  • 1
    500 µs (2 kHz) is not “plenty of time”. You have 384 bits to push (2 strips/wheel × 8 LEDs/strip × 24 bits/LED) at 400 kb/s (as per the WS2811 spec), and then you send a 50 µs pulse to latch the data. That's 1010 µs per refresh, of which only 50 (the latch pulse) are available for other computations. Using WS2812 (800 kb/s) would probably help. And no, you do not get unwanted lights during the update. Jun 5 '15 at 13:08
  • Also take into account the 400hz refresh rate of the WS2812.
    – Gerben
    Jun 5 '15 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.