This is only a preview of the August 2024 issue of Silicon Chip. You can view 45 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. Items relevant to "The Styloclone":
Articles in this series:
Items relevant to "Dual Mini LED Dice":
Items relevant to "JMP007 - Ultrasonic Garage Door Notifier":
Items relevant to "JMP009 - Stroboscope and Tachometer":
Items relevant to "Beer Can Filler":
Items relevant to "180-230V DC Motor Speed Controller Part 2":
Purchase a printed copy of this issue for $12.50. |
Mini Projects #009 – by Tim Blythman
SILICON CHIP
Stroboscope and
Tachometer
Stroboscopes and Tachometers are
handy tools for measuring how fast an
object like a flywheel is spinning. This
Stroboscope/Tachometer is easy to build
from a few Arduino modules and other
parts.
Warning: flashing lights, particularly in the lower frequency range from
about 5Hz (300RPM) upward can induce seizures in people subject to
photosensitive epilepsy. Flashing lights can also trigger a migraine attack.
We recommend that people prone to these effects avoid stroboscopic lights.
S
troboscopes are devices that use
a rapidly flashing light source to
help observe a rotating object. If a light
is flashed at the same rate as the object
is rotating, the object is lit at the same
location on each rotation. In this case,
human persistence of vision means
that the object appears stationary.
This lets you observe something
spinning too fast to see. Also, if you
know the flash rate when the object
appears stationary, you can estimate
the rotation rate.
Another way to measure rotation
speed is with a fixed light source and
a light sensor. The light sensor detects
the light changes as the object rotates;
a reflective sticker is often applied to
assist this detection. Measuring the
time between rotations allows the rotational speed to be calculated. Such a
device is called a Tachometer.
This project combines a Stroboscope
and a Tachometer into one simple
device. As it is based on an Arduino
Uno, it is easy to modify and experiment with.
We published a more advanced version of this device in the August and
September 2008 issues of Silicon Chip
(siliconchip.au/Series/52). We also
produced a Strobe to check the speed
of record turntables in December 2015
(siliconchip.au/Article/9640). This
simpler design could perform many
of the same jobs.
Hardware
We built our prototype using an
Arduino Uno mainboard and a Jaycar
XC4454 LCD Shield. Since the shield
has pads to break out unused I/O pins,
we simply soldered the required components to those pads on the shield.
Parts List – Stroboscope (JMP009)
1 Arduino Uno R3 main board [Jaycar XC4410]
1 Uno-compatible LCD Keypad shield [Jaycar XC4454]
1 5mm white LED [Jaycar ZD0290]
1 3mm infrared (IR) LED [Jaycar ZD1946]
1 IR photodiode [Jaycar ZD1948]
1 100kW ½W 1% metal film axial resistor [Jaycar RR0620]
2 220W ½W 1% metal film axial resistor [Jaycar RR0556]
5cm length of 5mm diameter heatshrink tubing [Jaycar WH5553]
1 USB cable to suit the Arduino Uno [Jaycar WC7701]
58
Silicon Chip
Australia's electronics magazine
The LCD Shield
also includes
several tactile pushbuttons, so we have
everything we need for a complete
user interface.
The character (alphanumeric) LCD
on the shield is driven in four-bit mode
by pins D4-D7 of the Uno, with D8 and
D9 providing the RS and E signals,
respectively.
The pushbuttons are connected to
a resistor chain that sends a different voltage to the A0 analog input,
depending on which buttons are
pressed.
Fig.1 shows how to wire up the
external components. At the top, the
white LED connects between D12 and
D11 with a 220W resistor in series.
This makes up the Stroboscope, with
the processor driving D12 to control
the flash rate. D11 is permanently held
low to create a convenient alternative
to a ground connection.
The IR LED is powered by the 5V
and GND pins, so it is always on. Its
job is to provide an IR light source for
the IR photodiode to detect. With the
arrangement we are using, the photodiode behaves somewhat like a solar
cell, generating a voltage on its anode
relative to the cathode.
Since the photodiode behaves
more like a current source than a
voltage source, a parallel resistor is
siliconchip.com.au
provided to turn the current into a
voltage that the ADC peripheral of
the Uno can measure. We use a photodiode as they can respond faster
than devices like LDRs.
For this project, we have used an
Arduino Uno R3 as other processor
boards like the Arduino Leonardo use
their processor to handle their USB
interface. Since the Uno has a separate USB interface chip, it has fewer
interruptions, making it better at managing the precise timing needed in
this project.
Fig.1: practically all the wiring is done
by soldering components directly to
the LCD Shield. You can also see the
connections we’ve made in the photos.
Software
The software consists of an Arduino
sketch and two libraries. The library to
drive the LCD panel is included with
the Arduino IDE, while an external
‘TimerOne’ library is used to manage
the strobe timing.
The sketch sets up a timer interrupt to drive the white LED with a
duty cycle of 10% (ie, off for nine
times longer than it’s on) at a rate you
can control. The strobe can also be
switched off. Professional strobes use
a much lower duty cycle at a higher
power level to more accurately ‘freeze’
the view.
The sketch also samples the photodiode voltage at 10ms intervals
(100 times per second), then calculates and displays a rate based on the
time between detected pulses. The
display can be set to RPM (revolutions per minute) or Hz (revolutions
per second) for both the Strobe and
Tachometer.
The Stroboscope/
Tachometer uses a white
LED for the Stroboscope;
the strobe rate can be
set by pushbuttons. The
Tachometer consists
of an IR LED and
photodiode to sense
changing light
reflection due
to rotation.
Assembly
Start by soldering the LEDs to their
220W resistors by cutting each anode
(longer) lead short. Cut down one
lead of each 220W resistor to a similar length. Solder the resistor to the
LED and use a few centimetres of heatshrink tubing to cover the resistor.
You can then solder the LED assemblies to the LCD shield as shown. The
white LED connects between the second and third pads at the top of the
shield, with the cathode on the third
pad.
The IR LED (which is blue) is wired
between 5V and GND, with its cathode
to GND. Trim any excess lead length
from these components.
Solder the 100kW resistor between
the other GND pin and A1; it should
be a comfortable fit. The longer anode
lead of the photodiode is also soldered
siliconchip.com.au
Australia's electronics magazine
August 2024 59
to A1, with the cathode going to GND.
The active area of the photodiode is
the curved lens, so bend its leads to
point the lens in the same direction
as the IR LED.
Finally, plug the LCD shield into
the top of the Uno and hook it up to
your computer for programming. You
should see the power LED on the LCD
shield light up.
Programming
You can download the Arduino
sketch for this project (siliconchip.
au/Shop/6/448). We have included a
copy of the TimerOne library with the
sketch download, but it can also be
installed by searching for “timerone”
in the Arduino Library Manager.
Use the Arduino IDE (download
from www.arduino.cc/en/software)
to upload the sketch to the Uno, being
sure to select the correct port and use
the Uno board profile. Screens 1, 2 &
3 show some of the typical displays.
Using it
Screen 1: this help screen can be seen when the SEL button is held down. The
SEL button also toggles between the RPM and Hz displays, shown in Screen 2
and Screen 3, respectively.
Screen 2: pressing the LEFT button should cause the white LED to start
flickering. You can change the rate with the UP and DOWN buttons.
Screen 3: the RIGHT button will change the steps by which the rate is
changed. This is always shown in RPM, even if Hz is selected as the unit.
To use it as a Stroboscope, shine
the white LED at a rotating object and
adjust the rate until the object appears
stationary. Remember that the object
will also appear stationary if the rate
is a fraction (eg, 1/2 or 1/3) of the rotation
speed. The correct rate is the highest
rate at which the object appears stationary.
When using the Stroboscope,
remember that the object that appears
stationary might not be! This can be
dangerous if that object is machinery,
as you might be tempted to touch it. So
take great care when using the Stroboscope near running machinery.
The Tachometer is used by aiming
the IR LED and photodiode at a rotating
object and reading out the value in the
lower-right corner of the LCD screen.
You should be able to get a reading of
a few Hz or a few hundred RPM by
waving your hand a few centimetres
in front of the LED/photodiode.
If you don’t get a good reading,
check that the IR LED is emitting by
pointing a mobile phone camera at it.
The camera should show a red or purple glow that isn’t visible to human
eyes. Other IR emitting sources (eg,
remote controls) might cause interference, so keep the unit away from them.
Remember that objects like fans
with multiple blades will cause multiple events per revolution, so you
may have to account for this in your
calculations. One way around this is
to place a piece of reflective tape on
the object so that you can easily pick
up one event per revolution.
Summary
Assembly of the
Stroboscope involves
plugging the modified LCD
Keypad shield into an Arduino Uno (shown above).
60
Silicon Chip
Australia's electronics magazine
The Stroboscope/Tachometer is a
simple and handy tool for checking
the speed of rotating objects. It may not
be the best tool for calibrating heavy
machinery, but we think it would be a
convenient way to check if your record
turntable is spinning at the correct rate,
for example. To check a turntable rotation speed, you also need a separate
strobe disc with markings.
SC
siliconchip.com.au
|