This is only a preview of the October 2011 issue of Silicon Chip. You can view 28 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 "Let’s Get Quizzical: A Quiz Game With A Difference":
Items relevant to "Digital LED Lighting Controller For Christmas Lights":
Items relevant to "Build A Loudspeaker Protector":
Items relevant to "The USB MIDI-Mate: A MIDI Interface For PCs":
Items relevant to "High-Performance Stereo Headphone Amplifier, Pt.2":
Purchase a printed copy of this issue for $10.00. |
No more boring old buzzers for us . . .
Let’s get
Quizzical!
We’ve all seen them: boring electronic quiz games which sound a
buzzer or bell and light a light to tell you which contestant has pressed
their button first. Ho-hum. Yawn. But there’s nothing boring about our
QUIZZICAL! It will certainly judge the winner – even if there’s only
microseconds between contestants hitting their buttons!
But wait, there’s more: you don’t just hear a buzzer or bell, you hear a
sound effect or tune that’s different for each player. And you can change
that sound effect or tune whenever you like.
I
f you’ve ever watched the quirky
British show “QI” (here’s today’s
trivia or tomorrow’s quiz question – it stands for Quite Interesting),
or perhaps the witty Aussie “Talking
About Your Generation” you’ll know
what we are talking about.
When each player or contestant
presses their buttons (well, more often
than not, belts their buttons!) as well
as judging who’s first, each responds
with individual sound bites. Those
sounds are often surprising, sometimes outrageous and always humorous. And they’re never the same from
one episode to the next.
Build the SILICON CHIP Quizzical!
and similar, virtually limitless sound
possibilities are yours. That’s because
the Quizzical! uses a Secure Digital
(SD) memory card to store the sound
files and so any MP3 file can be included for play.
There is no limit to the types of
sounds that can be produced – any12 Silicon Chip
thing from animal noises, explosions,
opera and classical music through to
one liners from cartoons, comedy skits
or movies. Like “Go ahead, make my
day!”
How?
If you know how to save an MP3
sound file on your computer and can
then copy that to an SD card, you can
use the Quizzical!. It doesn’t record
files itself; it simply plays back files
that have been stored onto the SD
memory.
What?
For suitable sound files, you don’t
have to search far. In just a few minutes
searching on the net, we found literally
millions of MP3 files.
These ranged from Warner Brothers
Bugs Bunny cartoon classic one-liners,
by JOHN CLARKE
Monty Python sound bites, Star Wars
and other science fiction sounds, bell
sounds and music MP3 files and ring
tones.
You can edit sound files to any
length before placing these onto the
memory card. If they are other formats
(eg .WAV or .M4A) there’s plenty of
free software around to convert them
to MP3.
Or you can record your own sounds
using an MP3 player with recording
facility or using a computer and microphone and freely available software.
Even bits of CD tracks can be converted
to MP3 format suitable for the Quizzical!. (Bear in mind the warning in the
“Legalities” panel).
Who?
Quizzical! caters for up to four contestants plus the adjudicator (dare we
call him the QuizzMaster?). Once a player has pressed his or her button to answer a question, his/her unique sound
siliconchip.com.au
Quizzica
l! Features
• Up to four contestants
plus QuizzMaster
• Unique sounds played
for each contestant
• Unique sound during
answer period and at end
of answer period
• Up to five separate set
s of theme sounds can be
stored on SD card
• Internal speaker
• External speaker output
connector
• Volume control
• Optional externally-acce
ssible SD card slot
• Adjustable contestant
play sound period
• Adjustable answer per
iod
• Unlimited types of sou
nds possible
starts to
play and
his/her button lights up. And
all other answer buttons are locked
out at this time.
The contestant sound play period
can be set by a trimpot adjustment and
is available from between 1.3s and 18s.
But if those periods are not suitable,
there is also the option to have the play
period set by the sound file length.
The QuizzMaster can cancel
any sound playing by pressing the
QuizzMaster button.
This pushbutton also has a LED indicator. Additionally, the QuizzMaster
can start a timer to limit the time period
allowed between the quiz question
and for an answer. During this answertiming period, a new sound (the
QuizzMaster sound) can be played.
When?
This answer-timing period can be
siliconchip.com.au
set internally
to between 1.3s and 35s
or by the file length itself. At the end
of the timing period, a different sound
can be played to indicate timeout. The
QuizzMaster LED lights during the
answer-timing period.
If another contestant presses a
contestant button during the answertiming period, then his or her contestant sound is played.
But that sound arrangement is quite
flexible – you have the choice to play a
“silent” file during the answer-timing
period which, of course, means that
no sound is heard.
At the end of the answer-timing period a sound indicates the time has expired. Or you could have a sound played
during the answer-timing period with
a silent
file for
the end of
the timing
period.
If the ans w e r- t i m i n g
feature is not required at
all, the QuizzMaster
does not press the QuizzMaster button
to initiate the answer-period.
If the QuizzMaster button
is pressed unin-tentionally, the
button can be pressed again to immediately cancel the answer period sound.
The contestants’ buttons still operate in the same way, where as soon as
one button is pressed the other contestant buttons are inactive until the
contestant sound file finishes playing.
Themes and variations!
The Quizzical can include up to
five separate sound themes that are
written onto separate folders on the
October 2011 13
14 Silicon Chip
siliconchip.com.au
A
K
K
LED1
A
5x
100nF
OR
6
9
7
12
10
3
13
15
16
17
5x 68 (a) or
5x 330 (b)
4
10k
S
(b)
RB0
RB3
RB1
RB6
RB4
RA4
RB7
14
RA2/AN2
RA3/AN3
Vdd
5
Vss
K
LED
A
RB2/Rx
RA1
RB5/Tx
IC1
PIC16F88
-I/P
RA6/OSC2
RA7/OSC1
RA0
MCLR/RA5
(b) 330 TO DRIVE
1x RED LED
(ONE OF THESE
FOR EACH
CONTESTANT
AND QUIZMASTER)
S
R
T
QUIZZICAL!
K
A
S
T
R
S
T
R
S
T
R
S
T
R
S
T
(a) 68 TO DRIVE
3x WHITE LEDS
8
18
11
VR3
10k
VR2
10k
(ONE OF THESE
FOR EACH
CONTESTANT
AND QUIZMASTER)
S
R
T
ANSWER
PERIOD
1
2
PLAY
PERIOD
100nF
Fig.1: the circuit consists of the player push-buttons/LEDs, a PIC
microcontroller, a proprietary MP3 module and an audio amplifier.
Construction shouldn’t take much more than an hour or so. The five
resistors between the sockets and PIC can be 68 (for the modified shed
lights) or 330 if you use a single red LED in the box.
2011
SC
S
(a)
(QUIZZMASTER)
CON5
(CONTESTANT 4)
CON4
(CONTESTANT 3)
CON3
(CONTESTANT 2)
CON2
(CONTESTANT 1)
CON1
R
+5V
13
15
IN
SD1
EXTERNAL
SD CARD
CONNECTOR
(OPTIONAL)
*
19
CD
WP
CD
WP
MP3
MODULE
TDB380
20
GND
SD CARD
CONNECTOR
IN MODULE
*
BUSY
Rx
100 F
16V
OUT
REG1 7805
7
6
5
4
3
2
1
9
8
7
6
5
4
3
2
1
9
8
R
L
17
18
47
47
100 F
16V
K
1N4004
A
100nF
100 F
16V
* NB: USE ONLY
ONE SD CARD
CONNECTOR
AT A TIME
(NOT BOTH!)
VR1
1k
VOLUME
NP
10 F
+11.4V
+11.4V
2
3
1
4
A
K
IC2
LM386N
6
LED
10 F
7
5
2.2k
K
8
K
IN
GND
47nF
10
470 F
A
D1 1N4004
LED6
A
POWER
S6
OUT
7805
–
+
GND
INTERNAL
SPEAKER
CON6
EXTERNAL
OUTPUT
CON7
12V DC
INPUT
SD memory card.
By way of example, the first
folder might contain the four
separate files for the contestants,
an answer period file and end
of answer period file, all based
on a cartoon theme. The second
folder might have a science fiction theme and the third folder
might have a classical music
theme and so on.
Other uses
The MP3 module which the
Quizzical! is based on is quite a
useful little device. So much so
that we imagine the Quizzical!
will not be restricted to games use.
The push buttons can be used for
other purposes to initiate sounds.
Perhaps you’d like a doorbell
where each doorbell push-button
switch gives a different sound?
Easy with the Quizzical!
Alternatively, the Quizzical!
could be used simply as a sound
bite generator to generate a variety
of sounds on demand. Want to
introduce sound effects to a school
play? Store ’em on the Quizzical!
and play them (perhaps over a PA
amplifier?) at the appropriate time by
pressing the appropriate button.
But its main use is, of course, for
quizzes and games. You could take
control over all the contestant and
QuizzMaster buttons and play suitable
interjection noises associated with answers: for example cheers for correct
answers, boos for incorrect answers.
You get the picture (or actually the
sound), we’re sure.
Inside the Quizzical! case – this does
have the external SD card slot added but
it’s under the PCB. Fig.2, below, shows
how and where.
S
T
S
T
S
T
T
S
CON2
CON3
CON4
CON5
CON6
R
R
R
R
R
R
100nF
100nF
100nF
100nF
100nF
*
*
*
*
E MA G ZIU Q
11101180
SOLDERED
TO POT
BODY
LED6
A
10 F NP
LINK
47
47
47nF
10
VR3
100nF
100 F
SY
RX
D
10k
100 F
1
2.2k
VR2
*
REG1
20
K
470 F
BU
GND
L
R
12V
7-WAY
ICD
SOCKET
STRIP
100nF
SPEAKER
OUT
IC2
LM386
* 5 x 68 (a)
OR 5 x 330 (b)
TDB380
MP3
MODULE
S6
IC1 PIC16F88
4004
D1
QUIZZICAL!
siliconchip.com.au
S
T
CON1
CON7
Physically speaking . . .
Quizzical! is housed in a small plastic case, which contains all the electronics except for the contestant and
QuizzMaster pushbutton switches.
These are connected via suitable
lengths of twin shielded cable and
3.5mm stereo jack plugs which connect into the back of Quizzical!.
We’ll have more to say on these
pushbuttons a little later because we
have something pretty special lined
up there . . .
There is a small loudspeaker within
the case to produce the sounds but
for best sound, a socket is included
to connect a larger loudspeaker or
for connection to a sound system.
When a jack plug is inserted into this
socket, the internal loudspeaker is
S
T
SD1
(OPTIONAL – UNDER)
10 F
100 F
VR1 1k LOG
08110111
October 2011 15
An enlarged view
of the TDB830
MP3 module
and its method
of connection to
the underlying
PCB. The seven
wire connecting
links at the right
side can be made
with resistor lead
offcuts (assuming,
of course, they’re
long enough!).
automatically disconnected. A volume
control is included on the front panel
along with a power switch and power
indicator.
The SD card
The card normally slots into place
in a connector directly on the MP3
module. However, this is inside the
case and may be at least a little inconvenient to use – especially if you want
to swap sounds.
So we have made provision for an
external SD card, accessed via a slot
on the front panel.
This requires the addition of a
few extra parts including an SD card
connector. Having the externally accessible SD card connector does not
prevent use of the SD card connector
that is on the MP3 module itself but
note: only one SD memory card can
be used at the one time.
At the rear of the Quizzical! are six
3.5mm stereo jack sockets – four for the
leads to the contestant pushbuttons,
one for the QuizzMaster pushbutton
and one for the loudspeaker outlet.
Power is via a DC power socket using a
9 or 12VDC plugpack or a 12V battery.
It is not recommended to use a small
9V battery to power the Quizzical!, as
the battery will be discharged rather
quickly.
Maximum current drain is about
200mA or so while playing sound at
maximum volume, so using a 12V gel
cell is perfectly practical and proper!
It drops to as low as 45mA on standby.
Circuit
The Quizzical! is based around a
Tenda Electronics TDB380 MP3 Module and a PIC16F88 microcontroller
(IC1). The microcontroller is used
to monitor the contestant switches
(S1-S4) and QuizzMaster (S5) switch
and to drive the LEDs associated with
each switch. The microcontroller also,
operates the MP3 module via a serial
connection and monitors the trimpots
provided for playback and answer
period adjustment.
Switches S1 to S5 are monitored
via the RB4, RB6, RB1, RB3 and RB0
inputs of IC1 (respectively). The
switches and LEDs share a common
ground; each of the switches connects
to the 3.5mm plug tip while the LEDs
connect via the ring.
Internal pull-up resistors within IC1
keep the switch inputs at 5V unless a
switch is pressed, pulling the input
to 0V. Each switch input is bypassed
with a 100nF capacitor to prevent
noise and interference from falsely
triggering an input.
Switch contact bounce is not a problem as the microprocessor responds
to the very first switch closure and
ignores any other switch input – from
that switch or any other.
Indicator LEDs, LED1 to LED5 associated with each switch are driven
from the RA0, RA7, RA6, RB7 and
RA4 outputs respectively via suitable
series resistors (we’ll have more to say
on these shortly).
Trimpots VR2 and VR3 connect
across the 5V supply and therefore
provide a voltage to the AN3 and AN2
inputs ranging between 0 and 5V. The
microcontroller converts the voltages
into digital values which in turn set
the timeout for the answer and play
periods.
VR2 settings between 0V and about
4.5V provide a play period between
1.3s to 18s respectively. Similarly,
VR3 settings between 0V and 4.5V
provide an answer period between 1.3s
and 35s respectively. The advantage
of these timers is that the MP3 file
lengths for each sound do not have to
be individually edited to set the playing period. Instead the timers handle
all play lengths.
However, if you want longer periods or if you want different length
play periods for each player, then the
required trimpot (or both) can be set
fully clockwise. This results in 5V at
the AN3 and/or AN2 input. Then the
The rear panel of the Quizzical! has is a DC power socket (9-12V DC from plugpack or gell cell battery), along with six
3.5mm jack sockets – four for the contestant push-buttons, one for the QuizzMaster push-button and one for the mono
external speaker output (which could also be used to connect it to an external amplifier/speaker for some really dynamic
sound)!
16 Silicon Chip
siliconchip.com.au
shorter than about two seconds in
length. If a second contestant pushbutton were pressed within a couple
of seconds after playing this short file
then the second file would not always
play. We overcame this quirk by checking the busy signal to find out if the
second file has started. Should the
second file not begin to play a second
or two after the first file has finished,
then the ‘play the second file’ command is re-sent.
Ceasing play of a file that is two
seconds or less in length using the
QuizzMaster pushbutton is not always
possible with this module. But it is
not really a problem as it is only a
short file anyway. You will just have
to wait it out.
The tiny 8 speaker is glued to the case lid after you first drill a series of “sound
holes”. Note also the glob of silicone sealant (at left) providing strain relief.
MP3 file length sets the timeout period. This period can range from zero
seconds to any file length.
The TDB380 MP3 Module is controlled by the microcontroller using a
serial connection between the transmit
(Tx) output of IC1 (pin 11) to the Rx
input of the module.
Baud rate is 4800bps with 8-bit data
and one stop bit. A precise baud rate is
not critical and we tested for successful operation with baud rates ranging
from 5000bps to 4464bps. With that
range of workable baud rate, the microcontroller can run from its internal
oscillator that has a nominal 2% tolerance at normal room temperature,
rather than having to use a crystal for
a more precise baud rate.
With serial control any number of
files can be selected, from 1 to 199 in
any one folder. There are 15 folders
available. For our Quizzical! we only
use up to six files in each folder and
there are five folders that can be accessed. The default folder is folder 1.
This is also called the root directory.
Sending a play command to the
Rx serial input of the module plays a
file. Each file is individually selected
using a separate serial code. When
the module is playing a file, a stop
command can be sent to the TDB380
to cease play. Stop has high priority
and operates immediately.
This is in contrast to sending a file
‘play’ command when a file is already
playing. The module will wait until
the file has completed before playing
the next file. To play a new file before
siliconchip.com.au
the current file has finished playing,
a stop command has to be sent first to
stop the current file playing and then
the new file command is sent.
The busy flag output from the
TDB380 module is monitored by the
microcontroller’s AN1 input for indication of when a file has finished play.
During play, the busy pin is low (close
to 0V) while the end of file is indicated
with a high (2.2V) signal which indicates the module is not busy. The AN1
input checks if the voltage is above
or below the mid point of these two
voltage levels. So if voltage is below
1.1V, then the module is busy and if the
voltage is above 1.1V then the module
is ready (not busy).
Monitoring of the busy signal is useful for determining when a file has finished. That information is used by the
microcontroller to ensure a contestant
cannot play his or her unique sound if
another contestant has already pressed
their button, starting a file playing.
The busy signal also informs the microcontroller when the answer period
has expired, when this is set to the file
length of the answer period file.
For files that are longer than about
two seconds, pressing the QuizzMaster
switch will cease play immediately.
Also another file can be played immediately after the first file has completed
by pressing a contestant pushbutton.
These are the expected responses
from the MP3 player to stop and play
commands.
The MP3 module has a few quirks
that occur when playing MP3 files
Audio out
Audio signal from the MP3 module
is at the left and right channel outputs
at pins 18 and 17 respectively. We
used two 47 resistors to mix the left
and right channels into a mono signal.
The mono signal is AC-coupled via
a 10F non-polarised capacitor to a
1kvolume control. These resistances
are made low in value to minimise
induced noise into the audio from the
MP3 player as the Player reads the SD
memory card.
Low-level switching noises in the
audio signal would otherwise be
evident, especially when using the
external SD card connector. Another
way we minimise this noise is to use
a metal front panel, which connects to
Legal issues
Strictly speaking, with the exception of sounds you create and record
yourself, any sound files you play
using the Quizzical! are subject to
copyright – especially if you use it in a
public place or for example, broadcast
a quiz using them.
That applies to sounds you download from the web, grabs from CDs,
even things like ringtones (which
we imagine will be pretty popular on
Quizzical!).
More information concerning the
playing of copyrighted sounds in
public, including sampled sounds,
can be found in the information sheet
G089.pdf from the Australian Copyright Council (copyright.org.au) on
Music: DJs.
October 2011 17
Parts List –
Quizzical
Main unit
1 PCB coded 08110111, 115 x
102mm
1 ABS Instrument Case 140 x
110 x 35mm
1 SD memory card 32MB to
8GB (A lower range capacity
is all that is required)
1 TENDA TDB380 MP3 module
1 134 x 31 x 1mm sheet of
Aluminium for front panel
6 3.5mm PCB mount stereo jack
sockets (CON1-CON6)
1 PCB mount DC socket with
2.5mm contact pin (CON7)
1 SPDT PCB mount toggle
switch (S6) (Altronics S1421
or equivalent)
1 40mm Mylar 8 speaker
1 DIP18 IC socket
1 knob to suit VR1
3 PC stakes
4 M3 x 6mm screws
1 60mm length of 0.7mm tinned
copper wire
1 150mm length of hookup wire
Semiconductors
1 PIC16F88-I/P microcontroller
(IC1) programmed with
0811011A.hex
1 LM386N 1W amplifier (IC2)
1 7805T 5V three terminal
regulator (REG1)
1 1N4004 1A diode (D1)
1 3mm green LED (LED6)
Capacitors
1 470F 16V PC electrolytic
3 100F 16V PC electrolytic
1 10F 16V PC electrolytic
1 10F NP electrolytic
7 100nF MKT polyester
1 47nF MKT polyester
Resistors (0.25W, 1%)
1 10k 1 2.2k 5 330/68*
2 47
1 10
(* see text)
2 10k horizontal mount
miniature trimpots (VR2, VR3)
1 16mm 1klog potentiometer
with two nuts (VR1)
Externally accessible SD Card option
1 SD memory card holder
(Altronics P5722 or equivalent)
1 7-way wire wrap socket strip
1 120mm length of 0.5mm tinned
copper wire
18 Silicon Chip
Quizzical! Specifications
Power supply:....................... 9 to 12VDC at up to 250mA. Standby current 60mA.
Loudspeaker power:.............. Typically 0.4W into 4 and 8
Contestant sound play: ........ 1.3s to 18s (or sound file length)
Answer sound play: .............. 1.3s to 35s (or sound file length)
File type:................................ Plays MP3 files (only) with standard bit rates
ranging from 32kb/s to 320kb/s.
Memory card:....................... 32MB to 8GB SD card using FAT16 or FAT32
Folders:................................. Up to 5 folders accessible with six MP3 files per folder
the volume pot body and circuit earth
and forms a shield.
Using the 1k volume potentiometer, bass response is rolled off due
to 1F audio coupling capacitors in
the left and right channel outputs on
the MP3 module itself. If you require
more lower frequency bass, then the
potentiometer should be replaced with
a 10k log pot instead (at the risk of
more noise).
Following the volume control, signal is coupled via a 100nF capacitor
into an LM386N amplifier, IC2. This
drives a loudspeaker via a 470F coupling capacitor. Supply bypassing for
IC2 is with a 100F capacitor across
the 11.4V supply and the 10F capacitor at pin 7. The 10 resistor and 47nF
capacitor connected in series at the pin
5 output prevent high frequency oscillation when an inductive load such as
a loudspeaker is connected.
Power
Power for the Quizzical! is from a
9V or 12VDC plugpack or from a 12V
battery. Diode D1 provides reverse
polarity protection for the circuit and
switch S6 applies power with indication by LED6. The 11.4V (or 8.4V with
a 9V supply) is applied to the REG1
input, the TDB380 module supply pin
and the pin 6 supply pin for IC2.
REG1 supplies 5V for IC1. The supply is bypassed with a 100F capacitor
and 100nF capacitor. IC1 includes a
power on reset using the 10k resistor at the MCLR input (pin 4) to the
5V supply.
Note that while the TDB380 MP3
Module is powered from 11.4V, an
integral regulator reduces the voltage
to around 3.3V for the on-board ICs
and SD memory card.
Other considerations for the mismatched supply voltage are when
monitoring outputs from the MP3
module. A high level output from the
module can only reach a maximum of
3.3V and this may not be recognised
as a high by the microcontroller running from 5V. In our circuit we use
an analog input for monitoring the
busy signal and so we can set the high
threshold to a more suitable voltage as
discussed earlier.
When power is applied to the Quizzical! circuit, it takes a few seconds
before the MP3 module becomes
functional. This period is indicated by
LED1 through to LED5 all lighting up.
When the LEDs are extinguished, the
MP3 module is sent a serial command
that sets the volume at its maximum
level. This volume is an internal digital
volume control, not the external VR1
control. The Quizzical! is then ready
to operate.
Construction
The Quizzical! is constructed using
a PCB coded 08110111 and measuring 115 x 102mm. The MP3 module
mounts directly onto this PCB. The
assembled PCB is housed in an ABS
instrument case measuring 140 x 110
x 35mm.
Begin construction by checking the
PCB for shorts between tracks and
pads, missing holes and for correct
hole sizes. Make repairs as necessary.
If you intend to use the externally
accessible SD memory card socket,
this is installed on the underside of the
PCB. Solder the 13 pins at the rear of
the connector and the two pins at the
front of the connector to the PCB pads.
Take care that the 13 pins do not have
any solder shorting bridges between
them. (These can be cleared with solder wick and a soldering iron to draw
off any excess solder between pins).
Install the low profile components
first. These are the wire link, the resistors and diode D1. When installing the
resistors, use a multimeter to check
the resistance value. Diode D1 must
be oriented correctly.
IC1 is installed using an 18-pin
siliconchip.com.au
DIL IC socket but IC2 can be directly
installed on the PCB. Make sure the
IC socket and IC2 are oriented correctly. Leave IC1 out of its socket at
the present. CON1 to CON6, 3.5mm
jack sockets, can be installed now
as well as CON7, the DC socket. The
three PC stakes can be installed with
two located behind CON6 and one
adjacent to VR1.
The MP3 module has a 20-way
right angle header along one side for
external connections. The right angle
in each pin needs to be bent straight
so that the module can be installed
horizontally onto the PCB. Carefully
bend each pin using pliers so that
each pin is fully straightened. Insert
the module pins into the PCB holes
with the module sitting about 10mm
above the PCB surface. Solder the pins
to the PCB.
The capacitors, regulator and switch
(S6) can be mounted now. Make sure
the polarised electrolytic capacitors
are mounted with the shown polarity. The 10F NP capacitor can go in
either way. REG1 is mounted with
the metal tab toward the front of the
PCB. It doesn’t need a heatsink. Fit the
trimpots (VR2 and VR3) now.
If the potentiometer (VR1) supplied
has a normal-length shaft it will require cutting to 10mm overall length.
The pot body also needs to be connected to the PC stake located adjacent
to it. This is done using a short length
of tinned copper wire (eg, a resistor
lead cut-off).
To allow solder to adhere to the
outside of the pot body, a small area
(ie, immediately around where it is
to be soldered) normally needs to be
scraped off just before soldering the
wire in place.
LED6, the “power” LED, is mounted
with the anode (longer lead) closest to
VR1 and with the leads bent at right
angles 5mm back from the LED body.
The LED is positioned at the same
height above the PCB as the S1 switch
ferrule.
LAST
FEW:
$AVE $$$
TV ACROSS AUSTRALIA
Your easy ref
reference
ference gui
guide
ide tto
oT
TV
V recept
reception
tion across A
Australia
usttraliia
Travelling around Oz? Want to know where to aim your antenna? This book will tell
you! Lists channels, location and polarity of all analog transmitters and translators
(digital services are usually co-sited). A MUST-HAVE with loads of other TV-related
data too! Even if you aren’t travelling, this is highly useful in troubleshooting local
TV reception problems. All this information in one handy source!
Buy direct fromWhile
SILICON
CHIP bookshop
stocks last:
$
RRP:
39
95
29
$
External SD card socket
The externally-accessible SD card
holder (if used), needs to be connected
to the MP3 module via a 7-way IDC
socket strip and wire links (see photo).
Install the 7-way IDC socket strip
alongside the MP3 module. This
socket strip is placed so that it sits
10mm above the PCB. Seven lengths
of 0.5mm tinned copper wire, each
17mm long, then connect the MP3
module to the 7-way socket strip.
Make a right-angle bend at 5mm
along each wire length. Insert the short
ends of each wire into each socket
strip hole and position each wire to
sit over the solder pads that connect
to the seven used pins of the SD card
holder on the MP3 module. Carefully
solder each wire to the MP3 PCB.
95
+p&p
SEE P85
for handy
order form
Note that there is more than one
version of this MP3 module currently
available. We originally designed the
Quiz Game using version 1 (V1.0) of
the module. This version had the SD
card positioned to the far right and
the wires from the socket strip needed
to solder directly to the pins on the
module’s SD card holder.
The MP3 module shown in the photographs is version 8.3 (V8.3) and has
the SD card holder located centrally
on the MP3 module. This has PCB
pads available that allow connection
to the SD card connector pins without
resorting to soldering directly to the
connector pins.
There may be other versions being
sold – which one you have with will
depend on the supplier of the MP3
Resistor Colour Codes
o
o
EITHER o
OR * o
o
(*see text) o
siliconchip.com.au
No.
1
1
5
5
2
1
Value
10kΩ
2.2kΩ
330Ω
68Ω
47Ω
10Ω
4-Band Code (1%)
brown black orange brown
red red red brown
orange orange brown brown
blue grey black brown
yellow violet black brown
brown black black brown
5-Band Code (1%)
brown black black red brown
red red black brown brown
orange orange black black brown
blue grey black gold brown
yellow violet black gold brown
brown black black gold brown
October 2011 19
Placing and arranging Quizzical! sound files onto the SD memory card
The final part of building the Quizzical! is to acquire and place
MP3 files onto the SD memory card. This needs to be done using
a computer. Most computers these days have SD card readers
installed (or perhaps MMC card readers; for our purposes they
are identical).
Modern printers and monitors often have an SD slot that enables reading the SD memory when connected to the computer.
Failing this, external USB SD card readers (which invariably are
also writers) are available for just a couple of dollars.
The SD card should already be formatted with either the FAT16
or FAT32 file system. If it is not formatted, this can be done using
the format facility on your computer.
Files
The Quizzical! requires six sound files per folder. Four files are
for the four contestants sounds, the fifth one is for the answerperiod sound and the final file is for the end of answer-period
sound. The answer-period and end of answer-period files can
either be files that produce a sound when played or they can be
silent files where no sound is heard. It is important that six files
are placed in each folder.
One of five folders can be selected when using the Quizzical!.
That means that you can have five separate themes for the Quizzical! sounds with one theme per folder. It is not necessary to use
all folders and a basic setup will only require six files if access to
the other folders is not required. A maximum of 30 files will be
needed, when all folders are used.
Folders are selected on the Quizzical! itself using the four
contestant pushbuttons (S1-S4) and the QuizzMaster pushbutton,
S5. To set a new folder from 1 to 5, press a switch (S1-S5) when
the Quizzical! is powered up. The associated LED for the pressed
switch will flash until the switch is released. The flashing indicates
the new folder is now set. If no switch is pressed during power
up, the folder remains at the last used folder.
The player module used in the Quizzical! will only play MP3
types – you’ll recognise them by the .mp3 at the end of the file
name. MP3 bit rates ranging from 32kb/s to 320kb/s and including
variable bit rate (VBR) are suitable. Other file types of files such as
.wav and .m4p will have to be converted to MP3 format before they
can be used with the Quizzical!
Where do you get them?
Audio files for your Quizzical! are easily obtainable from sources
such as CDs and downloads from the Internet. Files from the CD can
be ripped and imported as MP3 files. Files from the Internet ideally
should be either ones that are purchased or free of charge and royalty
free. For more detail see the section entitled Legal Issues.
Files can be edited for length and for content within the file, so
when looking for suitable files do not be put off because the file is
too large. If it contains a section you wish to use then this can be
selected and made into a shorter file. It is important that the file plays
immediately, ie, there is no “dead air” at the start of the MP3 file.
Any “dead air” can be edited out with a variety of sound file editors.
Files that are already short may be directly suited for contestant
and end of answer-period files. The time periods these files are played
are set by the play period adjustment using VR2 or by file length. Up
to 16s play period is available via the VR2 setting or this can be set
longer as set by file length.
A file for the answer period needs to be long enough to give
contestants “thinking” time as well as answering time. The answer
period can be set (using VR3) for up to 35s or by file length. So if
you want a longer than 35s period, then the file needs to be longer
at the required timeout length. If you prefer not to have sound during
the answer-period, then a silent file can be used.
Sound files are commonly available on the Internet and a good
list of sites is available at www.teachers.ash.org.au/suel/freestuff/
sounds.html Music files are available from download sites such as
iTUNES at www.apple.com/au/itunes/ Special interest sites for
audio files include ones for the Looney Tunes cartoons at www.
nonstick.com/sounds/; Monty Python at www.intriguing.com/mp/
sounds.php; Science fiction at http://itunes.apple.com/au/artist/
science-fiction-sounds/id169052199 and general sounds at www.
soundjay.com
If the files can be downloaded as MP3 types then this will save
having to convert the files. But if a file is only available in wave format,
it is not difficult to convert the file.
.m4p files
Files with a .m4p suffix are not as easily converted to MP3 format
as they are AAC protected files (MPEG-4 protected Advanced Audio
Coding audio files). Most of the files that are downloaded using
iTUNES are .m4p files.
You could purchase a commercial m4p to mp3 converter (such
as available from www.m4p-mp3.com) or alternatively, a relatively
inexpensive way when only a few files are to be converted is to first
make a CD of the .m4p files you wish to use. This can be done in
iTunes where the required files are placed on a playlist. The CD is
burnt as an audio CD rather than as a data disc.
You can use mono or stereo MP3 files as the stereo output is
mixed into a mono signal.
File handling
Audacity can be downloaded from the net (http://
audacity.soundforge.net/download/) and is perfect
for editing and converting Quizzical! file formats if a
suitable MP3 codec (eg lame_enc.dll) is first loaded (eg
from http://lame.buanzo.com.ar/).
20 Silicon Chip
Once you have the necessary MP3 files for your Quizzical! you
may wish to edit them. Editing can improve the sound file by having
the relevant section of the file start as soon as the file is played and
you can set the file length.
siliconchip.com.au
File editing can be done in Audacity. The start and end position
of a file can be selected by wiping over the required file section with
the mouse cursor and exporting the selection as an MP3 file. Editing
allows a file to start exactly at the sound point you require. It can
also select when you wish the file to end.
Additionally, it may be worthwhile normalising or compressing each
file. Normalising sets the effective volume of the file to a standard
level, while compression reduces higher volume levels reducing the
overall dynamic range. With these processes, each file will have a
similar sound level when played.
To do this, select the file and Effect/Normalise or Compressor.
Other Effects that you might wish to use is to change the pitch,
speed or tempo, reverse the file or add in echo. These features are
also available under the Effects tab.
Two screengrabs showing the difference between an
unsorted file list (above) and the same files having
been sorted into correct order (below).
Creating a silent file
When you wish to play silence rather than a sound for the Quizzical!, you will need to have an MP3 file that has no sound.
To create a silent MP3 file, first open a new file (file, new) then
select Generate/Silence. Type in the desired length (in seconds)
then click OK.
Placing files onto the SD card
The SD card needs to have each set of six sound files placed in
separate folders. The first folder is the root directory (folder1). This
folder is not named but it is assumed to be the 01 directory. It should
contain the first set of four contestant files; the answer-period sound
file and the end of answer period sound file totalling six files.
For the Quizzical! to work correctly, these six files must be present.
Files can be silent if required but a missing file cannot be used in
place of a silent file.
Another set of six files can be placed in folder2. You can create up
to five folders. Folders should be named 02, 03, 04 and 05. The first
folder is the root directory where the first six files are placed. In the
accompanying screen shot, (see SD Folders screenshot below) we
show .mp3 files named from 1.mp3 to 6.mp3 in the root directory
plus the other four folders.
One thing to note is the order that the Quizzical! plays the files. The
first four files (1 to 4) should be the contestant sound files. The next
file (5.mp3) should be the answer-period file and the end of answerperiod file is 6.mp3. This is straightforward – but there is a trap.
On a computer you can arrange files in order based on alphabetical order, file size, file type etc but this is not so with the MP3 player
module. The module plays files in the order that they are arranged on
the file allocation table (FAT). This is a limitation of the file handling
ability of the MP3 player. The file arrangement on the FAT is not
necessarily the same order that the files are seen on the directory
when viewed using a computer.
Screen grab of our “SD Folders” with files ready for use by
Quizzical! Note the order and naming is important – it’s
explained in the text.
siliconchip.com.au
The simplest way to get the file order correct is to start with a
blank folder and then copy the files onto it one at a time, in the order
required. This operation must also be applied to folder creation,
ie, they must be created in numerical order. However, there may
be some situations in which this approach can fail.
Another method is more certain to ensure correct file order
when the Quizzical! operates. Files are renamed in each folder to
1.mp3 to 6.mp3 corresponding to players 1-4 and 5.mp3 for the
answer-period file and 6.mp3 as the end of answer-period file. A
file sorting utility is then used to rearrange the FAT to correspond
to the file numbering.
For more detail on this file order problem see www.anerty.net/
software/file/DriveSort.php. You can also download the Drive
Sort utility from this site and the ‘download file’ button is at the
bottom the page at that site. Once the file has downloaded, open
the zip file; extract the files and place onto a suitable directory
(folder) on your computer hard drive. Run the DriveSort.exe file.
Once the utility is running, select Disk open
(see left) and open the SD
memory card. Select the
folders and the contained
files will be shown, in the
order arranged by the FAT.
Note that the files are not
necessarily in numerical
order.
To order the files, Select:
Order/Ascending and then
Folder/Sort. Folders will be
sorted in ascending order.
Then select Folder/Save to
save this file order.
Repeat for all folders
including those at the
root directory. This also
sorts the folders in order.
Select Disk/close to exit the
program.
The “Drive Sort” utility downloaded from www.anerty.com
(see text).
October 2011 21
module and how much stock they have
of a particular version.
Enclosure
Work can now begin on the enclosure. It’s a two-part box and you
will find that the two halves only
go together one way. Front and rear
panels are separate and, as mentioned earlier, an aluminium panel
is substituted for the plastic front panel
supplied.
Holes are required for the power
switch, LED and potentiometer on
the front panel and for the 3.5mm
jack sockets and DC socket on the rear
panel. Hole positions and hole sizes
are shown in the panel artwork (downloadable from siliconchip.com.au)
with hole positions and sizes shown.
When the externally accessible SD
memory card holder is used, a slot is
also required on the front panel. The
outline for this cut-out is shown on
the front panel artwork.
The small loudspeaker is positioned
inside the top lid toward the rear of
the box. Holes are drilled through the
lid over the loudspeaker cone area (before the speaker is glued in!) We used
neutral cure silicone sealant, although
many other types of glues are suitable
including hot melt, contact adhesive
and other plastics glues. Simply run a
in the case.
The PCB and panels are secured in
the bottom half of the case with four
M3 screws that screw into the four
corner posts of the box. There are extra
R = “RING”
mounting posts in the case that foul
T = “TIP”
CABLE LENGTHS
(CONNECTS TO (CONNECTS TO
the PCB, preventing it from sitting flat.
TO SUIT
LED ANODE[S])
SWITCH)
CONTESTANTS
These can be removed by twisting off
using pliers. Finally, the speaker is
LED ANODE IS
SWITCH
LONGER LEAD
NOT
K
wired to the PCB loudspeaker PC
A
POLARISED
stakes using hookup wire. A dollop of glue can be used to hold the
CABLE BRAID
= SOLDER
speaker wires to the case lid, removing
any stress on the soldered joins.
Fig.3: here’s how to wire each of the
S = “SLEEVE”
(CONNECTS TO LED
CATHODE[S] AND
SWITCH COMMON)
contestant and Quizzmaster pushbuttons to the 3.5mm plugs.
thin bead of glue around the speaker
edge and allow it to dry.
The front and rear panel labels,
which are glued to the panels, can be
printed onto paper, photo paper, film
or similar and glued to the panel. Cut
the holes out with a sharp craft knife
or leather punch.
The finished panels are attached to
the front and rear of the PCB with the
nuts for the 3.5mm sockets securing
the rear panel and the pot nuts securing the front panel. We used two nuts
on the pot, one behind the panel and
the other on the front of the panel. The
rear nut is to space the panel from the
pot so the panel is positioned correctly
Testing
With all four player and single QuizzMaster pushbutton units
plugged in, apply power and switch
on with S1. Check that LEDs 1-5 light
for a few seconds after powering up.
The power LED (LED6) should remain lit. Measure the voltage between
pins 5 and 14 of the IC1 socket. This
voltage should be close to 5V. If the
voltage is outside the range of 4.85
to 5.15V, then check for a possible
short circuit across the 5V supply.
Also check that there is voltage at the
input to REG1.
When the 5V supply is correct,
switch off power and insert IC1. Further testing can be done after the SD
card is written with MP3 files.
TENDA Electronics TDB380 MP3 player module
Measuring 51 x 33 x 8mm, the MP3 player can be used as
a music player, a sampler sound box, doorbell, announcer
and many other similar applications requiring sound.
The module operates from between 6V and 24V at up
to 100mA and plays MP3 files that are stored on an SD
memory card. Up to 199 MP3 files can be accessed on
each of 15 folders for a total of 2985 files. Sound output is
in stereo at up to 200mVp-p at the output. This output can
drive headphones directly, although it will be a low level and
the 1F on board coupling capacitors will roll off the bass.
There are four ways that the module can be used. Two
methods simply have switches attached to the inputs to
allow playing of the various files on the memory.
For the MP3 player mode, switches allow the module to
operate as a normal player. In this mode it has volume, play,
pause, stop, previous, next, fast forward and reverse, plus
change memory folder (directory) functions.
The second switch-operated mode allows independent
selection of up to eight files. Volume and random play are
also available. This mode is ideal for doorbell, robot sounds,
announcements etc.
The remaining two modes require a computer or microcontroller to drive the MP3 module via parallel or serial
data connection.
Each mode is selected by setting two solder link connections as either open or closed. For the serial mode, this will
22 Silicon Chip
operate with any jumper link setting.
The data sheet for the TDB380 module is available from
www.thaieasyelec.net/archives/Manual/TDB380%20
datasheet%20V2%5B1%5D.0%20.pdf
The MP3 module is manufactured by Tenda Electronics (www.tendaelectronics.com) and is based around a
Shanghai Mountain View Silicon Technology AU6850 MP3
decoder.
Some of its features include:
•
SD/MMC card reader controller
•
Supports MP3 (MPEG 1/2/2.5 layer-III decoder) at 32320kbps and Variable Bit Rate
•
Supports 9 sampling frequencies: 8kHz, 11.025kHz,
12kHz, 16kHz, 22.05kHz, 24kHz, 32kHz, 44.1kHz
and 48kHz
•
Supports FAT16 and FAT32 file systems
•
Embedded 16-bit sigma-delta audio DAC
•
Embedded headphone amplifier
The module is available from the USA at www.mdfly.com/
for approximately $16.00 inc postage. You could also try
Rictech in Melbourne (graeme.rixon<at>yahoo.com).
Failing that, Tenda Electronics do sell direct to the public
as “samples” but their website doesn’t have a shopfront: you
have to do it all by email and Paypal.
Also watch the one-off freight charges – they can be very
steep (eg, four times the unit price!).
siliconchip.com.au
THE “EASY” PUSH-BUTTONS
When we first developed
this project, we used ordinary push-button switches
mounted with a high-brightness LED in a small translucent jiffy box.
Now there is nothing
wrong with this approach
but having watched QI
and TAYG many times, we
thought they were a little
underwhelming. We wanted
a PUSH-BUTTON, not a
Player and QuizzMaster
switch and indicator
PUSH-BUTTON.
Admittedly, this approach is probably a bit
easier so we’ll show it here, along with its
parts list, for those who want to go this route.
It’s not at all critical where the pushbutton
goes (but logic suggests the centre) and as
it and the LED share a common (-) connection, the LED could simply have its cathode
soldered to this point.
(Uses 330resistor on PCB)
5 UB5 (83 x 54 x 31mm) clear
boxes (eg, Jaycar HB-6015,
H0205)
5 SP momentary push button
switches (S1-S5) (Altronics
S1080, Jaycar SP0716)
5 5mm high intensity LEDs
5 5mm LED panel clips
5 cable glands for 3mm cable
5 stereo 3.5mm jack plugs
2-core screened cable (length to
suit installation)
THE “PRO” PUSH-BUTTONS
We went searching for the large push
buttons as used on those shows and yes,
they were available but no, they were FAR
too expensive.
That’s when we started thinking “outside
the square” (OK, I was taking a walk through
my “other home” – Bunnings) and I came
across the small (100mm) battery-operated
LED lights pictured here.
They’re sold as either push lights or night
lights, depending where you shop. Brand is
“Magic Living”; (Bunnings barcode 9337897
001 942).
The price was certainly right – about $7
for two! – but the only problem was they
had push-on, push-off switches. We needed
momentary.
I also spotted a larger version of the same
thing, with somewhat similar electronics,
which would be perfect for the “QuizzMaster”
controller.
After disassembling one of these to see if I
could get the switch apart easily and convert
it to momentary, I quickly gave up that idea.
Too small, too flimsy (although if you want to
give it a go, be my guest. Nothing ventured
and all that!)
So I thought “what about fitting a different switch?” The biggest problem here was
that the moulding suited the fitted switch
and nothing else that
I could find would go
close.
The other difficulty
was that the travel in
the switch had to be
pretty well spot-on.
After various measurements and tests, I
bought a couple of tiny
momentary switches
from Jaycar (SP-0603)
and glued them in
place using JB Weld.
While that was drying I turned my attention to the LEDs. There
are three of them, all
white high-brightness
types, mounted in parallel on a small PCB,
along with a tiny inverter to step up the 3V
from the two “AA” cells to give enough to
light the LEDs.
As the PIC outputs 5V, I knew I didn’t need
the inverter so I whipped it out and tested
the whole thing out on a 5V supply. Voila!
The 330 resistor specified in the original
circuit is much too high to get the required
brightness so I replaced it with a 68,
which limits the current to safe levels for
Remove the four screws (carefully!)
to reveal the 3-LED PCB and switch.
Prise out the switch and glue a
mini momentary type switch (eg
Jaycar SP-0603) in its place. Make
sure the height of the new switch
actuator is the same as the original
switch. Also prise out the LED PCB
and unsolder the two components
(arrowed) – they are not required.
siliconchip.com.au
the PIC output.
And that is how we ended up with our “pro”
contestant push buttons. A length of two-wire
shielded cable, exactly as per original, was
soldered to the PCB and run out through the
now-vacant battery area.
The 150mm light has a 6V supply (4xAA
cells) so therefore has no inverter. But you will
need to remove its internal resistor, change
the switch to momentary and run it as above
SC
from the PIC and 68resistor.
Wire a suitable length of
shielded two-wire cable to
the LED PCB and the switch.
They share a common earth.
Reassemble the light (don’t
lose the tiny springs or
screws. . .) and you’re ready
for action. Repeat for the
other four push-button lights.
October 2011 23
|