Figure 3. Relay (or any
inductive coil) driver.
Figure 4. BlueSMiRF config wiring.
should do the trick.
I could not find a
datasheet on it so I
don't know how large it
is, but the price was
right ($2.95). You
could also try gutting
inexpensive relays for
the solenoid section;
this will give you a
small, inexpensive solenoid of marginal power for your
application. However, that will require experimentation to
find adequate power for the throw that you might need.
Table 1. ATMEGA UART baud calculations.
(which is very easy to do.) If you are having problems
getting your bootloader to work, I strongly recommend
that you download a free Arduino environment and use
one of their files as your template for yours. Your basic
problem is that buried deep in the documentation for the
Atmel ATMEGA168 is the fact that the UART does not like
to operate when the bit error is greater than 2%. If you
look at Figure 4 (which is a table of baud rate values for
various settings on an ATMEGA168 running at 8 MHz),
you'll see that the fastest bit rate you can get without more
than a 2% error is 38400. I walked this whole table and
verified that the UART truly is that picky. Not one setting
whose bit error was greater than 2% would work for me.
So, the answer is simple:
Modify your bootloader code
and your BlueSMiRF Gold to
communicate at 38400 or
change your ATMEGA168
clock frequency to one that
will allow a 115200 baud
rate with a low error rate.
There are several other clock
frequencies that allow much
more precise serial baud rate
If you want to modify
your baud rate, it isn't too
hard to do. First, you'll need
to know how to change it
on your BlueSMiRF device.
The SparkFun site has the
datasheet for this Bluetooth
dongle here at www.spark
Here is how to change
the baud rate on the BlueSMiRF Gold unit:
(This assumes that you have already paired your
BlueSMiRF unit with your computer and you have correctly
gotten all of your devices worked out. Since you have been
working with this for a while, I'm assuming that you have
all of this working.)
Q. I am a new subscriber to SERVO. I have been
working on wireless re-programming for months.
I have not been able to figure it out for the life of
me. I am using an ATmega168 at 8 MHz, a BlueSMiRF
Gold for UART, and the Bootloader from AVRfreaks.com.
Hope you can help!
— Brandt Daniels
A. Welcome to SERVO, Brandt! It just so happens that
I have the same kind of project going, but I used the
Arduino bootloader as my base and modified it
16 SERVO 02.2009
1) Set your BlueSMiRF up so that you can configure it
from your computer's favorite terminal emulator. I'm on a
Macintosh so I tend to use ZTerm. People have reported
problems using the Windows default terminal emulator
Hyperterminal, but it usually works. You can't just talk to
the BlueSMiRF from your terminal emulator; you need to