Continuing with my experiments in little bits of hardware, today I started sewing with arduino:
the particular arduino I’m using is called lilypad – it uses the same standard IDE you can download from the arduino website. All you have to do is get some of the conductive thread and connect the LED (you should probably buy some specifically made for lilypad but I’m sure you can figure out how to use other ones) where appropriate. I will try and show some photos later, it’s just the lighting is bad so there’s no real point right now. Here’s your basic set up I’ve done:
standard Lilypad arduino board – I bought mine from proto-pic, they stock pretty much everything you need to get going
conductive thread – I may have to order more of this, have a feeling I might mess up quite a lot
FTDI breakout board – looks like a rectangular board with a mini USB plug on one end and a chip in the middle.
an LED, colour up to you, mine is purple kind of. They come in a range of colours I’m just going with blue and purple for my necklace. You can also get mini LEDs which are even smaller.
1 – sew down the lilypad by repeatedly stitching through the “positive” (+) hole. Sew to where you want to position your power pack – the standard one is a coin cell breakout – and sew through the positive hole, then tie off. Note that if you’re not planning on having this wireless…unlikely…you don’t actually need a power breakout as your FTDI can power it through whatever you plug in the mini usb to (in my case, my laptop)
2 – sew through the “negative” (ground) hole on your lilypad and stitch the other end through the “negative” on the power breakout.
3 – pick a connector hole – e.g number 13 in my case – and do the same as before, sew through it repeatedly, position your LED and stitch through the positive hole, tie off and cut.
4 – sew through the negative hole of your LED and stitch this to join up with the “negative” on your arduino.
5 – Finally, plug in your FTDI breakout on the lilypad (the holes should lock in to the 6 pins on one side of the pad if you have the standard 328 board).
6 – At this point you need the drivers and the IDE for arduino. Go to their website (arduino.cc) and download their latest version (link for windows). Unzip this, and then plug in a mini-USB cable into your USB port and the other end into your lilypad. Open up control panel, and click “devices and printers”
As my cable is no longer available right now I can’t screenshot the next bit, but there should be a section titled “other devices” with USB UART or something similar listed there. Right click it, go properties. Without having to do this again I can’t exactly remember where, but if you click the drivers tab there should be somewhere (usually a button) that says “edit drivers”…another properties window will pop up with admin task buttons such as “update/uninstall/view drivers” etc.
Click update, then click “find my drivers on the computer” or what have you and navigate to where you downloaded your arduino software. Enter the folder, then the drivers folder, and select “FTDI USB Drivers” and let it do its stuff.
7 – Now comes the fun programming part. Go to where you downloaded your arduino software, in the main folder there should be a file called “arduino.exe”. Click it and it will open up a flashy IDE:
In Arduino practices programs are called “sketches” – the particular code seen here is from an arduino tutorial on flashing some LEDs but I’m sure you can figure it out if you know…C++ I believe it is? Some lines you’ll need:
sets up your pin for output, similar to how it works on raspberry pi.
turns off your LED.
turns on your LED. At the top you need to do a define, by the way:
#define LED13 13
8 – Once your program is written, press the “tick” button to verify your program actually works. Also whilst we’re here, let’s check that your IDE knows which board you’re using, there’s a lot:
Make sure it’s set to the board you’ve got. Next, assuming you have no errors, press the button with the right facing arrow to upload it to your board (assuming it’s plugged in). It should run straight away, and assuming your power is correctly sewn, if you unplug your FTDI board and ensure the power is switched to “on”, your program should still run…I’m still having a couple of issues with this, you might find that if you don’t get enough power running the LED won’t be quite as bright. I will ensure I know how to fix this properly when I get on to actually making my necklace, I think part of it is my material isn’t stretched flat right now so the connections aren’t quite perfect – it works fine when I plug it in to my laptop so I can gather it’s either my bad sewing to the battery breakout or the battery I pinched from home is running a little low on power.
Bits to mention:
1 – Some basic sewing points, you’ll need thread and a needle. Tie a knot in one end to ensure that it doesn’t pull all the way through, and push the thread through the other end…just thought I’d mention it If you’re struggling to get the thread through the needle, fold it and push it through or else cut the end – you could also suck it to pull the threads closer together.
2 – Make sure your threads don’t cross each other, the thread doesn’t have any safety protection so the voltage/signal intended for one LED will go to both if 2 threads cross.
OH also, I noticed that farnell had 2 gertboards on sale (unassembled) so I ordered one today and it should be arriving tomorrow, so I am very much looking forward to assembling it and seeing how it works I also signed up for Manchester raspberry jam in february…I tried to move my train times from march and cancel going to the other one, but it would have cost more to move them than to just have them and not go…that also gives me the option to decide when the day comes up – I could go to both, depends what’s going on at the time.