You Are Here: Home » AVR ATmega Projects » Microcontroller Programmer Projects » Wireless Persistence of Vision Device with Realtime Control Using Atmega644

Wireless Persistence of Vision Device with Realtime Control Using Atmega644


We set out to make an easy to interact with, highly custimizable POV display

In deciding on a project we looked for a challenge that would have a good mix of hardware and software problems. We ended up primarily concentrating on looking at unusual display technologies and decided that a persistence of vision(POV) display would be a good balance. A POV display is a display created by rotating an array of LEDs rapidly. Due to the fact that human eyes can only render so many images per second, the fast spinning LEDS seem like a solid display.

Wireless Persistence of Vision Device with Realtime Control Using Atmega32

While many POV projects have been designed before, they tend to be very static. Often they only display one image or animation and usually have no interactivity. We set out to make a very modular multipurpose design. Our original goal was to make two different LED arrays, a 2D version with RGB LEDs and a 3D version that uses monochrome LEDs. While we only had time to make the 2D display, our design makes it easy for the user to swap the LED array for a different one. Additionally, our design is fully customizable. Images can be uploaded and managed from a computer connected wirelessly, as can the firmware.

High Level Design

We found the idea for the persistence of vision device (also known as a propeller clock) here.

To improve upon the device we found, we wanted a way for the propeller clock to communicate with a computer and decided to use the serial protocol for this. At the same time, we decided to make a friendly GUI with JAVA so that any user can intuitively do the updates. The serial interface that we ended up using is the XBee. This device was extremely helpful since it allows us to have wireless serial communication. At the same time it is also extremely easy to use. They work right out of the box and only needs to be plugged into the laptop and our device.

In order to make our multipurpose propeller clock, we decided to make two main components. The main circuit board will do all the calculations necessary to figure out what LEDs to turn on while the secondary board will only have LEDs. This would make it extremely simple to switch between the 2D vs 3D propeller clock that we envisioned. The main circuit board is also unique since it can either read data from the external EEPROMs (rom control) or be controlled directly (direct control). This gives us a lot of versatility. Rom control makes animations simple to do while the direct control allows us to display a clock, dynamically generated messages (Gaming capability is also being looked at). More details on how this all works can be found under Hardware Design.

Hardware Design


Power was a major issue in our design. Since we need to power a motor and also 32 RGB LEDs (96 individual LEDs), the current being drawn is tremendous. As a result, we decided to use two power supplies to power the motor and the LEDs. Another reason why we did this is because two separate power sources get rid of the noise that might have occurred if the motor power supply was used to power the LEDS as well.

The total current needed by the microcontroller unit, the EEPROMs, and the LED drivers is about 450mA from the 5V regulator. The XBee that we use for the wireless communication takes about 50mA from a 3.3 linear regulator. The LEDS take about 173mA from a 9V power supply. This means that we need to draw about 673mA in order for the PCB boards to work. This number was actually even higher in our originally calculations since the datasheet on the LEDs said that they each need about 10mA (2mA ended working just as well), or 960mA for all 96 to turn on. That would have meant the total current being drawn would have been around 1500mA. This makes battery power not feasible. Duracell batteries have a 0.83amp-hour rating at 1A current draw, so the batteries would have died way too quickly. As a result, we decided to use a brushing system to supply the power which is explained in more details under brushing.

Essentially to power the PCB boards, a power adapter is used to pass 9V (1.1A rating) to the spinning board. The 9V goes straight to the LEDs and the 5V regulator. The regulator goes through a PI filter and then to a 3.3V regulator and the rest of the 5V devices. The PI filter ensures that slight current variations caused by the noisy brushing are removed. As a result, we never had any brownouts except for when the brushing fails (explained in more detail below). The motor has its own independent 5V (2.5A rating) power supply so there was no problem there.


Budgeting was also an issue since we are only allowed to use $70 in addition to what we have lying around. Our design requires many connections between multiple devices, so it was impossible to do by hand to get the small form factor we needed. At the same time, custom made PCB boards are expensive. On top of that, since we wanted a modular design, we needed two PCB boards. To minimize cost, we decided to get a custom made main board and etch the LED PCB board by ourselves. More details can be found under PCB board

Motor System

A working motor system is critical for our success. For one, it must spin fast enough so that we can get at least 10 frames a second. Lower rotation speed will make images unrecognizable. Extremely good images require 15 30 frames per second, but since we have a spinning device, the higher rotation speed can be dangerous. As a result, we usually tried to use the lowest speed possible.


As you can see from the picture below, the motor assembly design is relatively straight forward. However, perfecting the brushing took a long time and it was main cause of our headaches. For awhile, we werent even able to test our code since the brushing was constantly losing contact or shorting

The brushing for the ground was relatively easy to make. We just took some metal bristles from a barbeque grill cleaner and used that to contact the motor shaft. This causes the connector(custom made screw) to be grounded. Also, since the connector between the PCB board and the motor is metal, the connectors head always end up touching the grounded bristles as well.

If you want to read about the different designs we had to go through to get the power brushing to work, click HERE.

In our final version, the power brushing was made entirely out of a single spring that we took from a pen and some wet noodle. We used a lot of hot glue so that relatively little spring would be exposed so that it wouldnt get knocked over too easily. At the same time, we wrapped some Wet Noodle wire around the end of the spring that we straightened. This results in extremely good contact(more surface area due to the straight part) and low friction. To reduce friction even further, we put some motor oil on the wet noodle tip.

In addition to all that, we also need to insulate the power brushing from ground. The connector is grounded, but due to a lack of space the power brushing is only 1 mm away. We resolved this by wrapping the sides of the connector with electrical tape and filling in the gaps at the base of the tape with wood glue (Thick, non instant glue is best). In addition, to prevent the power brushing from going out of its boundaries, we boxed it in with some wire.


We machined our connector(screw) in the Cornell machine shop. Since our motor has a flat edge on the motor shaft, it gives the worm screw on the side of the connector a lot of grip. We made the connector longer so that we could secure it to the PCB board with a nut. A picture of this is shown below. When making this connector, we had to take into account that our modular design doesnt give the connector much clearance. If the connector was too high, it would hit the PCB board right above it (A LED will always be at the center of the board, or right above the connector).


We had some major vibration issues in the beginning. At times, it felt as if the PCB board would fly off due to the imbalance of the spin. We fixed this in various ways. We increased the weight of the base so that it wouldnt move around as much. At the same time, we put the base on top of foam pads to dampen the vibrations. In addition, we secured the motor more firmly onto the actual metal base. Finally, we balanced the PCB board in all directions so that the center of mass wouldnt shift around.


PCB Board

The heart and soul of this project lies with the PCB board. The modular design will be explained below and pictures of our design are at the end of this section.

Main Board

On our main board, the current layout for how the microcontroller pins are used is as follows: PORTA is not used at all, PORTB is used for the SPI and for the test LED (PB0), PORTC is mainly used for direct control of the LED drivers when the board is in direct control mode. Each pin corresponds to a different driver. PORTD is used for USART (GUI / bootloader) control, EEPROMS(CS), and input from the hall sensor

Based on other designs, we selected these values for the components shown in the schematics below: a)10k ohm resistor: pull up resistor and current control for drivers b)0.1uF capacitor: decoupling capacitor c)15pf: Clock capacitor c)150ohm resistor: LED current control d)Red LED/Test LED: test/heartbeat LED e)Crystal: 16Mhz Clock Oscillator f)Hall Sensor: Detects Rotations g) 4.7nF: Hall Sensor Capacitor h)0.33uF Power Input Filter i)68uH inductor: part of 5V line pi filter j)33uF: part of the 5V line pi filter.

LED Control

The LED’s are directly controlled by MAX6971 LED drivers. These drivers are able to turn the LEDs on by sending a preset current to them which is calculated with the equation I = 18/Rset. This equation is given in the datasheet and Rset is the resistor that we use to connect the SET pin to ground. Initially we used 1.8k resistors to give the LEDs 10mA, but they were far too bright to view. After some testing, we found that 10K resistors got the brightness down to a decent level. This means that the LED’s were getting 1.8mA each, so the final current drawn by all 96 LEDs is 173mA. We store the LEDs on off state in a register with each bit corresponding to an LED in their shift registers. However, the LED states are only updated from this register when the Latch enable pin is high in order to prevent LEDs from switching states in the middle of a frame.

Wireless Persistence of Vision Device with Realtime Control Using Atmega32 Diagram

Our MCU has two mechanisms with which to control the LEDs, one of which is direct control. Here the shift-in pin of each driver is connected to one of the eight pins of PORTC. The serial clock is controlled by PORTB7. A single bit in all eight drivers is set simultaneously by pulsing PORTB7 to feed in the PORTC values. This means that it takes a minimum of 4 cycles (mem load,PORTB toggle, set PORTC, PORTB toggle) to update a bit or about 4*16=64 cycles to update all the LEDs.

Parts List:

Part NameDescriptionAmountSellerPart #CostRefdes
Motormotor to spin board1NANAsalvagedNA
AC to DC wall wart (5V 2.5A)power supply for motor1NANAsalvagedNA
AC to DC wall wart (9V 1.1A)power supply for LED’s and logic1NANAsalvagedNA
linear regulator 5V9V to 5V regulator for logic besides XBEE1digikeyLM7805CT-ND$0.45U5
linear regulator 3.3V5V to 3.3V for XBEE1digikey296-21611-5-ND$0.84U10
XBEE wireless trancieverwireless data link to computer1digiNAalready ownedCONN1
XBEE to USB boardComputer side transciever1digiNAalready ownedNA
LED drivershift register and power control to LEDs8maximMAX6971�sampledU(3,6,9,11,12,14,15,17)
EEPROM 1MBEEPROMs for storing image data4microchip25AA1024sampledU?’s
4×2:1 muxmux to choose between driver shift out and direct control1digikey74ACT257SC-ND$0.40U8
PCB board for control board (3×6″)PCB with all circuitry except LEDs1sunstoneNA$20.00NA
PCB board for 2D displaya modular plug in board with LEDs1we madeNA$6NA
RGB LEDsLEDs for RGB board32mouser828-OVSRRGBCC3$25NA
10k resistpull up resistors and current control for drivers14digikey311-10.0KCCT-NDlying aroundR(1,3,4,5,6,7,8,9,10,11,12,13,14,15)
.1 uF capdecoupling capacitors3digikey311-1140-1-NDlying aroundC(1,3,4)
15pFclock capacitors2digikey709-1170-1-NDlying aroundC(5,6)
150 olm resistLED current control1digikeyP150ACT-NDlying aroundR2
red ledtest/hearbeat LED1digikey160-1178-1-NDlying aroundLED
crystal16Mhz clock occilator1digikey631-1024-2-NDlying aroundU2
hall sensordetects rotations1digikeyUS5881EUA-ND1.93SEN
4.7nFhall sensor capacitor1digikey399-1155-1-ND$0.04C2
.33uFpower input filter2digikeyP822-NDlying aroundC(7,11)
68uH inductorpart of 5V line pi filter1digikey308-1341-1-ND$1.03L1
33uFpart of 5V line pi filter3digikeyP815-NDlying aroundC(9,10)
base to board brushingneeded to transfer power to spinning board1we madeNAscrapsNA
motor to board conectormechanical connection between board and motor1friend madeNAfriend didn’t chargeNA
switchesswitches to turn on board and motor seperately2NANAlying aroundNA
basebase to put motor on1NANAscrapsNA
connectors 2×36 female 2mmconnectors to modulorize boards16samtecSMM-136-02-S-DsampledCONN2-5
connectors 2×36 male 2mmconnectors to modulorize boards8samtecTMM-136-01-T-DsampledNA

For more detail: Wireless Persistence of Vision Device with Realtime Control Using Atmega32

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Programmable RGB Spinning LED Display Using Atmega32

Introduction For our final project, we built a mechanism that spun a linear array of seven LEDs at a velocity...

Scroll to top