LXF100 Arduino
LXF100 Arduino
Hardware hacking
made easy
Any old geek can program software, but it takes some serious commitment to
computers to want to program hardware. We show you how to get started…
A
rduino is cool. It’s cool because it’s a tiny device – parts you can plug into the Arduino to make it do more
about three inches by two inches – that comes interesting things.
with a USB port and a programmable chip. It’s
cool because you can program it using a very Getting set up
simple programming language known as Wiring. But most of Arduino boards come in several varieties, but the main three are
all, it’s cool because the entire reference design for the the Arduino NG (“next generation”), the Arduino NG Plus, and the
hardware is available under a Creative Commons licence, so Arduino Diecimila. These aren’t competing boards – rather the NG
you’re free to build your own if you want to. However, that’s came first, and was replaced by the NG Plus, then the Diecimila.
probably a little extreme for most people, which is why you We have an NG because we bought it a while ago, but if you try to
can also buy pre-build Arduino boards that are ready for buy one now you’ll probably only find the Diecimila for sale.
action, and they are available at very low prices too. The Ultimately the difference between these boards is very small: the
Arduino programming IDE is available under the GPL for NG Plus has a ATmega168 CPU compared to the ATmega8 found
multiple platforms, so the only things standing between you in the plain NG, and the Diecimila has been tweaked to make it
and your own pet hardware project are an Arduino board, a fractionally easier to load programs. The ATmega8 and ATmega168
cool idea, and of course a Box O’ Tricks – some neat little chips are very similar, with the primary difference being that the
168 has space for larger programs, but that won’t be a problem for
our purposes here – any of those three boards are suitable for
Electronics and safety following this tutorial.
As for where to get your Arduino board, we recommend PCB
Please remember that electronic parts can be very sensitive: static electricity can Europe (http://pcb-europe.net) – they have the Diecimila on
be fatal to your Arduino and many other small computing parts, so don’t shuffle sale there for 22 Euros (£15/$31 at the time of writing), and they
your feet and wear anti-static wrist bands. Equally, though, remember that are very happy to answer questions if you’re unsure precisely what
electronic parts can be dangerous to you – they often have lead in them, so make you want.
sure you wash your hands thoroughly after working with your kit! Now comes the slightly more complicated part: what do you
want to plug into your Arduino? By itself, the board has 14 digital
Resistors are so
cheap you usually
buy at least five at
a time – make sure
and look closely
at the stripes to
determine how
much resistance
they offer. You can buy a bag of pre-cut wires from any good electrical
store. If you want to look really smart, you can even use colours
for certain types of connections!
you’ll probably find your LED appears brightest when you look one is marked 9V? That’s where we can get more power from, but
straight down at it. you need to be careful – if you put too much through an LED, you
can burn it out. That’s not a big problem if you bought a mountain
Using the breadboard of LEDs, but if you only have three or four you need to make them
The solderless breadboard you have has strips of metal hidden last! However, it’s safe to plug it in for a second or two just to make
away under the holes, connecting rows of pins together as a sure it works, so please do that now: unplug your Arduino so it has
circuit. The columns aren’t connected, which means they don’t no power, then connect 5V to J33 and the Gnd next to 5V to J32.
carry a connection horizontally – only vertically. If you have a full- Now plug it in for a second: your LED should light up much, more
size breadboard like ours, you’ll have a gap between rows; the brightly (and may even start to get warm!). Once you can see that
rows on either side of these gaps aren’t connected either. To give it works, unplug the USB cable again so the light goes back out.
you an example of how this works, we can modify the simple LED Now, let’s up the complexity a little: I want to introduce you to
system we have now by introducing the breadboard and two resistors. These little things produce a voltage drop of different
wires. My board has columns numbered 1 to 60 and rows lettered levels, depending on the variety of resistor you have. The exact
A to J, as is shown in the photos of it on the previous page, and I’ll resistance is shown in the little coloured stripes on the resistors,
be using these but these are absolutely meaningless for mere mortals – don’t be
“Refer to your resistor numbers to explain afraid to keep around a resistor cheat sheet showing what the
where to put your different stripes mean. For now, connect 5V to J38 so that the LED
‘cheat sheet’ so that you wiring. Even if yours no longer has power going to it. To complete the circuit, you need
void loop()
{
lgtVal = analogRead(lgtPin);
digitalWrite(ledPin, HIGH);
delay(lgtVal);
digitalWrite(ledPin, LOW);
delay(lgtVal);
}
What do you think that sketch will do? If you’re not sure, try
assembling it, uploading the sketch to your board, and covering/
Before you try
revealing the light sensor! the right pin. Make sure your potentiometer is very firmly plugged
uploading to a
into the breadboard – they usually have thicker connectors, so you
board, make sure
More to try... might have to give it a good push! you select the
If you managed to pick up a potentiometer, these are particularly Of course, this has only really been a very light overview of correct serial port
easy to drop in once you have your light sensor working: your what Arduino can do, and that’s because the real magic comes in for your Arduino
cable to Analog 0 needs to connect to the middle pin of the the software you build. We’ve shown you here how to put together – it’s probably
potentiometer; your cable to Ground needs to connect to the left circuits to read and write data, and the next question is: what are /dev/ttyUSB0 or
pin; and your cable to the power (via a resistor) should connect to you going to do with it? LXF something similar.