This is only a preview of the September 2007 issue of Silicon Chip. You can view 35 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Spectacular Bike-Wheel POV Display":
Items relevant to "A Fast Charger For NiMH & Nicad Batteries":
Items relevant to "Simple Data-Logging Weather Station, Pt.1":
Items relevant to "Building The 20W Stereo Class-A Amplifier; Pt.5":
Purchase a printed copy of this issue for $10.00. |
• Support for In-Circuit Se
rial
Programming (ICSP)
• 32 LEDs on each side of
each PC
board (64 LEDs per board
, 192 LEDs
total)
• Displays a one-kilobyte
image
(32 LEDs x 256 radial “ra
ster lines”)
• All LEDs can be driven
with 20mA
at 100% duty indefinitely
. This
produces a very bright im
age.
• Firmware shuts the circui
t down
automatically when the
voltage
gets too low, to prevent
damage to
rechargeable battery packs
• The PC boards fit 26-in
ch bike
wheels or larger.
BIKE WHEEL
POV DISPLAY
This project uses POV to produce a spectacular glowing
display on a rotating pushbike wheel as you ride along.
So what is POV? It stands for Persistence Of Vision.
It’s a term that’s applied to devices that rely on
the human eye’s tendency to “see” an image
for a short time after it has disappeared.
Designed by Ian Paterson
26 Silicon Chip
siliconchip.com.au
H
OW WOULD YOU LIKE to own the most talked-about
pushbike in the school/street/suburb. . . galaxy? Build
this POV display and you’ll be well on the way.
You really have to see it to believe it – and we’ve even
made it easy for you. As well as the images printed here,
there are several more you can view online at www.ianpaterson.org/projects
OK, you’ve now seen them and you’d have to agree that
they look pretty spectacular, right? You want to do the
same for your pushie? Just make sure you keep it chained
up because everyone will want it . . .
Persistence of vision
You probably don’t realise it but you use POV every
day – when you watch TV. Movies also take advantage of
this phenomenon.
The TV and movie picture is not continuous vision – rather (in the case of TV), 25 individual pictures are displayed
every second. But your eyes and brain cannot follow the 25
individual frames of picture per second – instead, they “fill
in the gaps” and you “see” full motion, non-jerky video.
If you slowed those frames down to, say, 10 per second,
you would be able to see the period between each frame
and it would become jerky – just like the old-time movies
where the hero moves like a Thunderbirds puppet.
Let’s take this one step further. Say you had a moving
light – we’ll make it a LED because they can be turned on
and off very quickly – which you flashed on, very briefly,
once per second. You’d see this as flashes of light moving
along a path. If you changed that to, say, 10 flashes per second, you’d probably still see flashes but very much closer
together. Make that 50 flashes per second and the flashes
would all meld into one another. You’d see it as a continuous line of light – even though your brain knows full well
that it is flashes you are viewing.
That’s persistence of vision and this is the basic theory
behind this project. Rows of LEDs are made to flash too
quickly for your brain to process, so they appear to be permanently on. The rows of LEDs are mounted on PC boards
fixed to a bicycle wheel, so they follow a circular path as
the wheel rotates.
By using some clever circuitry to switch the LEDs on and
off at particular moments, a pattern or picture can be created
– in fact, the display is almost unlimited. It can be everything
from geometric shapes to text, cartoon characters and even
very high contrast pictures (see examples below).
In a nutshell . . .
The display consists of three PC boards, each with a row
of 32 LEDs on each side (a total of 64 LEDs). These boards
are mounted radially in/on the spokes of a pushbike wheel
and each has a battery pack mounted near the wheel’s hub.
Talk about WOW! factor: this 3-high static display uses different coloured LEDs in each wheel to reveal three different patterns. The rider powers the one wheel & the second
& third wheels are driven by friction between the tyres.
A Hall Effect sensor measures the rotational speed of the
wheel by sensing a small magnet fixed to the bike frame.
This sensor sends speed pulses to a microcontroller, which
then turns the individual LEDs on and off in such a way
that a static image appears to float inside the wheel.
Circuit description
Fig.1 shows the complete circuit for one POV display module. Three such modules are required, arranged so that each
is mounted 120 ° from the other around the wheel, between
the spokes. With the exception of the trigger magnet and battery pack, all components mount on these three PC boards.
Here are just a few of the images generated by the author: (from left) pagan star, ET, invisible unicorn, Saturn & evolution!
siliconchip.com.au
September 2007 27
28 Silicon Chip
siliconchip.com.au
SC
2007
1
1
OUT
3
RA6
RA3
RB0
Vss
5
RB5
RA7
IC1
PIC16F628A
MCLR
PGD
PGC
Vdd
14
1k
21
23
4
22
2
11
10k
GND
3
10k
10 F
16V
IN
16
15
2
100nF
OUT
REG1 LM2931AZ-5
BIKE WHEEL POV DISPLAY MODULE
2
GND
(HALL
SENSOR)
HS1
DN6851
6
4
Vcc
13
2
12
3
4
ICSP
SOCKET
CON1
10k
+5V
24
O7
O6
O5
O4
O3
O2
O1
O0
OE
Rext
LE
CLK
SDO
SDI
GND
1
O15
O14
O13
O12
O11
O10
O9
O8
IC2
STP16C596
Vdd
2
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
1
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
3
DN6851
LED31
LED1
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
CHAMFER
LED32
LED2
23
4
3
22
2
IN
COM
24
Vdd
OE
Rext
LE
CLK
SDO
SDI
GND
1
OUT
O15
O14
O13
O12
O11
O10
O9
O8
O7
O6
O5
O4
O3
O2
O1
O0
IC3
STP16C596
LM2931AZ-5
21
1k
+7.2 – +8.4V*
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
K
LED63
LED33
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
A
K
7.2–8.4V*
NiMH
BATTERY
S1
POWER
A
A
* DO NOT
USE RED
LEDS WITH
8.4V
BATTERY
A
A
A
A
A
A
A
A
A
A
A
A
A
A
LEDS
LED64
LED34
The modules, or PC boards, each
contain 64 high-brightness LEDs, 32
on each side. A LED on one side is
connected in series with a LED on the
other, so that the same image is seen
on both sides of the bike.
The LEDs are under the control of
a PIC16F628A microcontroller (IC1).
It is this microcontroller which not
only stores the image to be displayed
but outputs it to two STP16C596 shift
registers (IC2 & IC3) which in turn
drive the LEDs.
If each LED pair was driven with a
dedicated output line, the microcontroller would have to have a very large
number of output lines.
Hence this circuit uses 16-bit constant-current LED sink drivers (IC2 &
IC3) which can drive 16 outputs and
allow multiple devices to be cascaded
together. The STP16C596 also has a
separate storage register that allows
one set of data to be displayed while
the next set is being loaded.
Four lines are used to control the
LED outputs: serial data input (SDI),
clock (CLK), latch enable (LE) and
serial data output (SDO).
Each pulse of the clock line causes
the data to be “shifted” over by one
place and each pulse of the latch
enable line causes the LED outputs
to reflect the contents of the shift
register.
One kilobyte of image data is stored
in the program memory area of the
microcontroller and is read by way
of a look-up table. The firmware uses
four interrupt routines:
• one to provide the time interval
between radial raster lines;
• one to increment a counter for timing the wheel rotation interval;
• one to reset all counters and update the raster interval value every
time the Hall Effect sensor is triggered; and
• one that shuts down all LEDs when
the battery voltage gets too low.
In fact, after the initial start-up
routine, virtually every part of the
firmware’s execution runs inside an
interrupt routine.
We haven’t yet mentioned the
DN6851 Hall Effect sensor. Its purpose
is to measure the speed of the wheel
Fig.1 (left): one POV display module
– three are required for the whole
project. With 64 LEDs per module it
looks daunting but there are only 12
other components in each!
siliconchip.com.au
and supply the appropriate timing
pulses to IC1. It is triggered each time
it passes a small magnet attached to the
bike frame. Its output pulse is sensed
by input RB0 on IC1
Timing values for the radial raster
line interval are retrieved from a
look-up table that exists in the microcontroller’s program space. Data for
the look-up table is generated with a
QBasic program, although you only
need to run this program if you want
to experiment with different timing
values.
When using a 7.2V battery pack, it’s
better to use a low dropout regulator
such as the National Semiconductor
LM2931AZ-5 than the commonly used
78L05. It will continue to provide a
solid 5V for the microcontroller even
when the battery is at 6V. This is important because if the supply voltage
to the microcontroller drops, so does
the internal reference voltage which
would prevent the voltage sensing
routine from working properly.
A number of flow charts have been
created to illustrate the logic in Spoke
POV’s various firmware routines but
since our space is limited, these can
all be accessed on the website mentioned above.
QBasic programs
In addition to the microcontroller
firmware, two Qbasic programs are
required for setting the timing values
and converting image data so they can
be incorporated in the firmware.
POVSLOPE.BAS creates the timebase look-up table. The table produced
by this program is linear, so the only
parameters one needs to be concerned
with are slope and offset. Note that the
timing data supplied in the sample
firmware is reasonably accurate so you
should only use POVSLOPE.BAS if
you plan to experiment with different
timing values.
POVIMAGE.BAS is used to convert a raster image into radial data
in the form of a series of “RETLW
B’xxxxxxxx’;” commands that can be
copied and pasted directly into the
POV assembly code. The image data
is read one pixel at a time as a series
of 32 concentric rings. Each group of
eight rings ends up occupying one
memory page.
Because of the limitations of QBasic, it has been made to read headerless RAW files. The images must be
700x700 pixels, eight bits per pixel,
TRADE-IN Offer
Any Brand – Dead or Alive
Up to 20% trade-In Value
towards your
new Tektronix Instrument
Enabling Innovation
Trade-in*1 your
Analog or Digital
Oscilloscopes,
Function and/or
Waveform Generators
or Logic Analyzers
for the advanced
Tektronix range.
Trade-In*1 Any brand instruments –
savings of up to 20% towards your
New Tektronix instruments.
ACT NOW!
Equivalent instruments will be
traded-in towards any of the
following Tektronix models:
Digital Phosphor & Sampling
Oscilloscopes (DPO7000/DSA8200)
Mixed Signal & Digital Phosphor
Oscilloscopes
(MSO4000/DPO4000/TDS3000B)
Digital Storage Oscilloscopes
(TDS2000B/1000B Series)
Arbitrary Waveform Generators
(AWG5000)
Arbitrary Function Generators
(AFG3000 series)
Logic Analysers (TLA5000B/TLA7000)
Offer expires on the
30th September 2007
*1 Conditions apply - Trade-In value may vary depending on
instrument type, model & condition of trade-in instrument. Please
call 02-99113888 or enquiries<at>tekmarkgroup.com to inquire
Authorised Distributor in Australia:
Certificate No: AU07/3011
TekMark Australia Pty.Ltd
Suite 302, 18-20 Orion Road,
Lane Cove, NSW 2066
Email: enquiries<at>tekmarkgroup.com
Website: www.tekmarkgroup.com
Phone: 02-9911 3888 Fax: 02-9418 8485
September 2007 29
30 Silicon Chip
1k
10k
IC1 PIC16F628A
(FACE
DOWN)
1
RED DOTS INDICATE VIAS OR
SOLDER-THROUGH LINKS
1
IC2 STP16C596
16109071
INNER COLUMN OF
LEDS MOUNTED ON
TOP OF BOARD &
SOLDERED UNDER
OUTER COLUMN OF
LEDS MOUNTED ON
UNDER SIDE &
SOLDERED ON TOP
IC3 STP16C596
1
10k
GN
D
+V
GN
D
Fig.2: the PC board component overlay (shown from the component side) with matching top and bottom-side photographs of the PC board. The fingerprints
are an optional extra! Seriously, the boards should be coated with a PC board (ie, solder-through) lacquer immediately they are made to prevent this from
happening – especially as these boards will be out in the weather on the pushbike. In fact, we’d even go so far as to give the whole thing a good spray once
finished – making sure you don’t get it in the two connectors.
10F
100nF
HS1
1k
1
CLK
DAT
MCLR
GND
(BEND
DOWN 90o )
10k
REG
CON1
siliconchip.com.au
FIRMWARE
Ian Paterson’s firmware for this project – 628h.asm,
povslope.bas & povimage.bas can be down-loaded from
his website at www.ianpaterson.org/projects
with the pixels being either pure black (0x00) or pure
white (0xff).
Such a file can be created with Photoshop or many
other graphics programs. When you’ve finished creating the image, the final file size should be exactly
490,000 bytes.
To stop the LEDs from lighting up when the bike is
stationary, the last raster line is always set to zero (off).
Because the firmware stops incrementing the raster
line counter when it reaches the last line in the image, having all LEDs off in that line will cause them to
remain that way until the next trigger pulse from the
Hall Effect sensor.
Construction
After checking the PC board, start with the three
10kW and two 1kW resistors, followed by the 100nF
and 10mF capacitors. Of these, only the 10mF capacitor
is polarised. As this is a double-sided PC board, we
should mention that the components mount on the
side with the writing in the copper!
Next solder in the three IC sockets (the right way
around!) and two connectors, followed by the polarised
regulator (REG1) and Hall Effect sensor. For me, the
most troublesome part of this project is soldering the
Hall Effect sensors without damaging them.
Because they are sensitive to both mechanical and
thermal stress, you must use great care when attaching
them to the circuit board. Their leads must be bent down
90° towards the face which has a chamfered edge on its
top. This means that the face will actually be towards
the PC board surface when fitted.
When bending the leads, you must hold the sensor
lead with needle-nose pliers between the plastic case
and the point at which the lead is being bent. This is to
prevent mechanical stress at the point where the leads
enter the sensor’s case.
When soldering, you must also use needle-nose pliers
as a heatsink to prevent damage from excessive heat.
Once the sensors have been successfully soldered onto
the board, there is little risk of further damage.
Soldering the LEDs
You have probably noticed that we have left the LEDs
until last. That’s because there are a lot of them and they
too can be a bit tricky to solder. There are 32 LEDs to
be soldered to each side of the PC board.
Note first of all which is the anode and cathode
of the LED – there is a flat spot on the bottom of the
LED next to the cathode (labelled “K” on the circuit
diagram). Also, the anode lead is longer.
At right are the same PC boards shown opposite, this
time fixed to their backing “plate”, ready for mounting
on the wheel. Note the semi-circle notches at the bottom
end to fit into the axle. The top end is rounded to fit
against the rim.
siliconchip.com.au
September 2007 31
Parts List*
3 PC boards, each 50 x 245mm,
code 16109071
3 18-pin IC sockets
6 24-pin IC sockets
3 7.2V or 8.4V 700mAh (or higher)
battery packs (do not use 8.4V
with red LEDs) – see text
3 magnets – see text
Material for backing plates – see
text
Semiconductors
3 PIC16F628A microcontroller
programmed with 628h.hex
(IC1)
6 STP16C596 LED driver (IC2,
IC3) – see alternatives below
3 DN6851 Hall Effect sensors
(HS1) – see alternatives below
3 LM2931AZ-5 low-dropout regulators (REG1)
192 high brightness LEDs (LEDs
1-64)
Capacitors
3 10mF 16V electrolytic
3 100nF MKT polyester or monolithic (code 100n, 104 or 0.1mF)
Resistors (5%, 0.25W)
9 10kW (brown black orange gold)
6 1kW (brown black red gold)
Alernative Parts
ST Microelectronics STP16C596
LED driver alternatives:
Allegro A6276EA
Maxim MAX6969ANG
Maxim MAX6971ANG
Panasonic DN6851 Hall effect
sensor alternatives:
Melexis US5881EUA
Allegro UGN3113 (may be
discontinued)
Allegro A1101LUA-T
Allegro A1103LUA-T
* This list is for all three modules
On the top (component side) of the
PC board, the LEDs are arranged with
their cathodes oriented towards CON1
(the 4-pin connector) while on the bottom side, the reverse is true.
The LEDs are controlled in pairs,
one for each side of the board, thus
allowing the POV image to be viewed
from either side of the bicycle. The
LED pairs are connected in series by
way of small jumper wires through the
32 Silicon Chip
In daylight, you can see the arrangement of the PC boards and batteries inside
the spokes of the wheel. The PC boards, mounted 120° apart around the wheel,
fit against the axle and are secured at the rim end via a couple of cable ties onto
the spokes. It’s important to keep the battery packs (which ever form you use)
close to the axle to prevent the wheel getting out of balance.
PC board that serve the same purpose
as a PC board “via” – connecting the
copper on both sides of the PC board
together where required.
The biggest challenge in soldering
these jumpers is that the heat from
your soldering iron will travel along
the wire and melt the connection on
the other side of the board. I found it
helpful to use those “Helping Hands”
soldering aids with alligator clips to
hold the wire in place.
If you are able to obtain or make PC
boards with vias, then these jumpers
are not necessary.
Finally, plug the three ICs into their
sockets. Be careful to line up the notch
in the end of the IC with the notch in
the end of the socket. A second check
is a small paint dot or indent beside
pin 1 – make sure this goes where pin
1 is shown on the component overlay.
Loading an image
Since this POV design stores the image in program memory space, the microcontroller must be re-programmed
every time you want to load a new
image. The process is as follows:
• Create a 700x700 pixel, 8-bit per
pixel image and save it with an 8-character filename.
• Edit POVIMAGE.BAS so that it
references the new image and run the
program. It will save its output with a
.ASM extension.
• Copy and paste the .ASM output
into the POV firmware file (628h.
asm).
• Compile it to produce a .HEX file
and program the POV board via the
4-pin In-Circuit Serial Programming
(ICSP) connector. This connector does
not supply power to the board during
programming, so you must supply
power from a battery pack or an external supply.
Testing
Test the operation of the POV board
before fixing it to the spokes. It’s a lot
easier to fix mistakes on the bench
than on the bike! Of course, the microcontroller should be programmed
at this stage
Apply power and wave a magnet
in front of the Hall Effect sensor. You
should see the LEDs illuminate. They
won’t make much sense (ie, there will
be no picture to see) but at least you
will know the microcontroller is doing
its thing.
If they don’t light up, turn the magnet
over and try again. The faster you wave
the magnet in front of the sensor, the
faster the LEDs should flash. If this test
siliconchip.com.au
fails to illuminate the LEDs, the most
likely causes are a defective Hall Effect
sensor or a bad program.
The batteries
The battery voltage needs to be
high enough to allow the regulator to
provide 5V for the microcontroller and
also just high enough to allow the LED
drivers to deliver up to 20mA through
each LED pair. Try using a 7.2V battery pack for LEDs with a low forward
voltage (such as red) and 8.4V for other
colours (such as white and blue). Be
sure not to use a battery voltage that’s
more than about 2V higher than 2x the
forward LED voltage, otherwise the
LED drivers may be damaged.
In the prototype, battery packs were
made up from AA NiMH cells. I used
700mAh cells but with 2500mAh
now available, 1000mAh and even
1500mAh are becoming quite cheap.
The larger the capacity, the longer your
display will last.
You can use six cells (for 7.2V) or, as
long as you don’t use red LEDs, seven
cells (8.4V) in your battery packs –
it’s more a case of getting a suitable
holder. All three packs should be the
same weight to avoid unbalancing
the wheel.
An alternative, albeit a bit heavier,
is to buy 7.2V or 8.4V battery packs
intended for radio controlled models.
High power (3500mAh+ ) ones are expensive but you can often find lower
capacity types on eBay for less than
$20. Just make sure you mount them
so they can’t fly off!
Wheel mounting
The accompanying photo shows the
position of the PC boards on the bike
wheel. It’s important to note that the
inner edge of the PC board sits right
up on the axle and the whole thing is
centred between the spokes, so that
the board is right in the centre of the
wheel.
To mount the PC boards in the
wheel, I made a protective backing out
of 3mm sintra (often used as a rigid
backing onto which printed material
can be mounted), covered one side
with anti-static plastic (cut from a
motherboard bag), and attached it to
the solder side of the PC boards using
plastic cable ties.
I’m not sure if the anti-static plastic
is of any benefit but I used it as a precaution in case a static charge builds
up on the sintra as the wheel spins.
siliconchip.com.au
RIGOL SCOPES SALE
... SAVE UP TO $300
Rigol DS5062MA 60MHz
Rigol DS5102MA 100MHz
60MHz Bandwidth
1GS/s Real Time Sampling
2 Channels
Mono LCD Display
4K Memory Per Channel
20 Automatic Measurements
Advanced Triggering on Edge,
Video & Pulse
Built-in FFT
Built-in USB
3 Year Warranty
100MHz Bandwidth
1GS/s Real Time Sampling
2 Channels
Mono LCD Display
4K Memory Per Channel
20 Automatic Measurements
Advanced Triggering on Edge,
Video & Pulse
Built-in FFT
Built-in USB
3 Year Warranty
ONLY $
799
ONLY $
ex GST
1,099
ex GST
300
200
SAVE $
SAVE $
* Offer valid until 30th June 2007 or while stocks last.
Sydney
Melbourne
Tel 03 9889 0427
Tel 02 9519 3933
Fax 03 9889 0715
Fax 02 9550 1378
email testinst<at>emona.com.au
Brisbane
Adelaide
Perth
Tel 07 3275 2183
Fax 07 3275 2196
Tel 08 8260 8166
Fax 08 8260 8170
Tel 08 9361 4200
Fax 08 9361 4300
web www.emona.com.au
EMONA
On one end of the sintra, I cut a
crescent-shaped notch that matched
the radius of my front hub shaft. On
the other end, I cut a notch for the
spoke nipple.
All that is needed to secure a PC
board to the wheel is two cable ties at
the spoke nipple end – the other end
stays put because the crescent-shaped
notch engages around the wheel hub.
To keep the hub end of the boards
in place, I used two short sections
of plastic hose, slit down one side,
wrapped around the hub shaft and
attached with cable ties. These act as
spacers that prevent the boards from
sliding laterally along the length of
the hub shaft.
Note: these boards will fit a 26-inch
or larger wheel. Also, when using three
boards, it’s easier to mount them in a
wheel with a number of spokes that’s
divisible by three (eg, 36 spokes).
Mounting the magnet
To trigger the Hall Effect sensors, I
used a stack of four magnets from an
old 3.5-inch hard drive.
The stack of magnets was placed
on the inside of one of the bike forks
immediately above the region under
which the Hall Effect sensor passed,
then secured in place with a piece
of tape.
Other suitable magnets would be one
or more of the rare-earth or so-called
“super magnets” which are enormously
powerful for their size.
More information?
There are a lot more notes, flowcharts, firmware and graphics on the
author’s website: www.ianpaterson.
SC
org/projects
September 2007 33
|