chebe: (Default)
2025-04-02 01:00 am

Digital Sparkle Collar

History )

Collar )

Circuit )

Attachment )

Putting it all together )

Finishing touches )

Coding )

Testing )


Photo of the neopixel collar, closed, and turned on, with four wires meeting in the middle, leading to the Gemma in a translucent bright green 3d printed circular case, inside yet another in a translucent bright green 3d printed circular case, with the LEDs in various shades of green, yellow, white, and off.

Digital Sparkle Collar, with more robust case situation
Photo by [personal profile] chebe

chebe: (Default)
2025-03-19 02:40 pm

MPU-6050 Arduino libraries code archaeology

Compare and contrast getting normalized accelerometer values, where the raw value is -13248.00. (A.k.a. Please, make it make sense.)

Library 1; jarzebski's Arduino-MPU6050 - https://github.com/jarzebski/Arduino-MPU6050/
Library 2; Adafruit's Adafruit_MPU6050 - https://github.com/adafruit/Adafruit_MPU6050
Library 3; i2cdevlib/ElectronicCats' mpu6050 - https://github.com/ElectronicCats/mpu6050


Library 1;


code )

Formula for normalized acceleration value at MPU6050_RANGE_2G;
raw * rangePerDigit * gravityConst
(raw * (1.0/16384)) * gravityConst
== (raw / 16384) * gravityConst
(-13248.00 * .000061) * 9.80665 = -7.92502845
== (-13248.00 / 16384) * 9.80665 = -7.92959589


Library 2;


code )

Formula for normalized acceleration value at MPU6050_RANGE_2_G;
(raw / accel_scale) * gravityConst
(-13248.00 / 16384) * 9.80665 = -7.92959589


Library 3;


code )

No normalized functions in MPU6050.cpp. Can use MotionApps files, but they go through Quaternions.
code )

Formula for normalized acceleration value at MPU6050_ACCEL_FS_2;
// jarzebski way;
raw * accelerationResolution * gravityConst
-13248.00 * 0.000122 * 9.80665 = -15.850057

// adafruit way;
// (raw * (1.0/16384)) * gravityConst
// (raw * (2.0/16384)) * gravityConst
(-13248.00 / (2.0*16384)) * 9.80665 = -15.85919
((-13248.00*2.0) / 16384) * 9.80665 = -15.85919

Result is twice that of the others. accelerationResolution itself seems to be twice the others, so half it? Not sure if this is a mistake, or I'm missing something about MPU6050_ACCEL_FS_2 vs MPU6050_RANGE_2_G.
raw * (accelerationResolution/2) * gravityConst
-13248.00 * (accelerationResolution/2) * 9.80665 = -7.9250

accelerationResolution and get_acce_resolution() only exist in the ElectronicCats version, they're not accessible in the i2cdevlibs version. That version seems to really want you to use the Quaternion path. But you can always use the range values from the other versions yourself on the raw values.
chebe: (Default)
2025-03-19 12:00 am

MPU-6050 with Arduino and Processing, data visualization code archaeology

The MPU-6050 is an accelerometer and gyroscope (with added thermometer), that contains a Digital Motion Processor (DMP) to handle a lot of the heavy maths lifting of turning the raw sensor values into useful motion values before they reach the microcontroller. It seems (caveat; I'm new to this area) that the original code is only available as a binary, or as some demo code. But some very determined people have pulled a library together.

/* Source is from the InvenSense MotionApps v2 demo code. Original source is
 * unavailable, unless you happen to be amazing as decompiling binary by
 * hand (in which case, please contact me, and I'm totally serious).
 *
 * Also, I'd like to offer many, many thanks to Noah Zerkin for all of the
 * DMP reverse-engineering he did to help make this bit of wizardry
 * possible.
 */


Well, actually, it seems quite a lot of people have pulled libraries together, to different levels of functionality, with very similar names. But the one most people seem to use is this one. Which includes the MotionApps files. This is important, not just for the right function calls, but because you need other libraries from this collection as well, particularly the I2Cdev one. These libraries, although for Arduino, are not findable inside the Arduino IDE's Library Manager. You need to side-load them, old school style. Which means downloading and extracting the .zip file. Then copying the specific libraries (being the folders that contain an 'Examples' folder as a first level child) for MPU6050 and I2Cdev into your Arduino > libraries folder. And restarting the IDE.

(I've also, after the fact, found what seems to be a copy of the MPU6050 library in an ElectronicCats repo, that is in the Library Manager, and seems to have rolled the I2Cdev code into itself. But the oldest change here seems to be 6 years ago. Whereas the i2cdevlib seems to be about 13 years ago. It does seem to have more recent updates than i2cdevlib though. So the choice is yours. I'm telling you, it's a nightmare finding what's what, especially when the code linking to it won't even compile with it.)

To help us get a feel for how the boards movements are interpreted, there's a nice demo we can try out. You can find the MPUTeapot Processing project inside the MPU6050 Arduino library; MPU6050 > examples > MPU6050_DMP6 > Processing > MPUTeapot.

First step is to install Processing. I'm using P4. Copy that MPUTeapot.pde file into a new sketch (or the whole folder to wherever you save your sketches). This sketch requires another stack of libraries, the Toxi/c libraries, which we need to side-load again. Download the newest release, extract the .zip file, and copy the libraries (being the folders that contain an 'examples' folder as a first level child) into your Processing > Libraries folder. Restart Processing.

Illustration of Arduino Mega board wired up to MPU6050 board as described below.

MPU6050 Circuit
Made with Fritzing



Wire up your MPU6050 to your Arduino (I'm using the Mega 2560). You need to connect the Interrupt pin to Digital pin 02 (on most Arduino boards). SDA -> SDA. SCL -> SCL. VCC -> 5V. GND -> GND.

Open the MPU6050 > MPU6050_DMP6 example, and load it onto your Arduino. By default it runs in readable yaw-pitch-roll mode. Open the Serial Monitor at 115200 baud. After finding and initialising your MPU6050 it will await char input. Send any char, and you'll get a lot of lines like;
DMP ready! Waiting for first interrupt...
ypr	0.01	-0.01	0.44
ypr	0.01	-0.01	0.44
ypr	0.01	-0.01	0.44
ypr	0.01	-0.01	0.43

Which are your yaw-pitch-roll Euler angles in degrees.

If you comment out the #define OUTPUT_READABLE_YAWPITCHROLL line, and uncomment the #define OUTPUT_TEAPOT line you'll prepare the code for use with the Processing demo. Instead of nice readable yaw-pitch-roll values the info is packed into a 42-byte FIFO packet buffer; [quat w][][quat x][][quat y][][quat z][][gyro x][][gyro y][][gyro z][][accl x][][accl y][][accl z][][]. Upload to your Arduino.

Moving over to Processing now, open the MPUTeapot demo. I find it nostalgic that this is running in OpenGL mode. If you want to increase the window size, go ahead and do that. Otherwise you just need to set the correct portName. For me that meant commenting out line 72, and uncommenting line 75, while updating line 75 to say "COM7". The demo is straight-forward, handling the drawing of the virtual plane, reading and unpacking the packets back to quaternion w,x,y,z values, and handing off the complications to the Toxi/c libraries. But when it works it's a lot of fun to manipulate the virtual plane by moving your MPU6050. And really helps you connect the board movement to what you want your project to detect/react to, in your mind.

Animation of a block plane (red board, green wings and tail fin, blue nose cone) rotating in 3D space.

MPUTeapot demo
Gif by [personal profile] chebe

chebe: (Default)
2025-03-12 12:00 pm
Entry tags:

MG90D Servos with Arduino

Take one Arduino Uno, and run some servos. Seemed straight-forward. Seemed.

Firstly, I couldn't find any Unos or Duemilanoves, I must have used them all. Guess it's time to finally break out the Mega 2560.

The servos are the MG90D micro servos. And using the Servo.h library.

Basic circuit set up like the sweep tutorial; on a breadboard, using a 100 µF capacitor (servo is 4.8V to 6V DC voltage), and external 9V power supply. Sweep worked fine, but setting exact angles via write() would only sometimes work.

Illustration of Arduino Mega board, with 9V power source, connected to a servo with power through a breadboard with capacitor, and connected to Digital/PWM pin 09.

Servo Circuit
Made with Fritzing



After some poking around I learned that I needed to set the minimum and maximum pulse lengths for these particular servos. (The values from the product description on Adafruit. Also note, this servo will 'hold' the position even when no signal is sent.) And then I could set the degree of rotation (0°-180°) as expected.


#include <Servo.h>

Servo myServo;

int minPulseWidth = 750; // µs == 0.75ms
int maxPulseWidth = 2250; // µs == 2.25ms

void setup()
{
  myServo.attach(9, minPulseWidth, maxPulseWidth); // digital pin (with PWM) 9
}

void loop()
{
  myServo.write(90); // angle in degrees, 0-180
  delay(1000); // ms
  myServo.write(180); // angle in degrees, 0-180
  delay(1000); // ms
  myServo.write(0); // angle in degrees, 0-180
  delay(1000); // ms
}
chebe: (Default)
2022-10-19 08:05 pm
Entry tags:

Adafruit HalloWing M0 displaying images from SD card through Arduino

I went to an event at the weekend. Which meant I needed an event badge. Time to dust off my HalloWing badge. I finished the last post saying I would update once I got the badge reading images from the SD card shield. Well, dear reader, I was pleasantly surprised to discover that at some point I had gotten it working! At least to the point of auto-rotating through all the images on the card.

I don't really remember what I did to get the SD card working, but from the code the main bits are;
#include <SPI.h>
#include <SD.h>

const int chipSelect = 10;
File root;

void setup(void) {
  if (!SD.begin(chipSelect)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");

  // List files on the SD card
  root = SD.open("/");
  printDirectory(root, 0);
  root.close();
}

printDirectory(root, 0) uses dir.openNextFile(); which sorts through your files alphabetically. bmpDraw(...) (see code below) is what what reads the bmp file and translates it into what the tft wants. Nice.

But I wanted more. First thing you need to know is that Adafruit have moved on and really want us to use the Arcada library to work with the badges in Arduino. But if I wanted a simple life I would have gone with the CircuitPython option. I travelled the frustrating path instead.

I set up two of the buttons to 'scroll' left/right through the images. The images have overlays that display matching usernames. One of the buttons toggles on/off the tft backlight, and the other button toggles on/off the on-board NeoPixel. For a while things weren't working, and after a lot of digging I discovered that Adafruit had made breaking changes, including deprecating a function they had used in the examples I was working from.

setAddrWindow(...) was changed, from (start_x, start_y, end_x, end_y) to (start_x, start_y, width, height). So the change was from;
tft.setAddrWindow(x, y, x+w-1, y+h-1);
to;
tft.startWrite();
tft.setAddrWindow(x, y, w, h);
tft.endWrite();


pushColor(...) is deprecated. After experimentation I discovered that;
tft.pushColor(tft.color565(r,g,b));
needs to be replaced with;
tft.startWrite();
tft.writePixel(col, row, tft.color565(r,g,b));
tft.endWrite();


For the buttons a library is required;
#include <Adafruit_FreeTouch.h>
Then you need to create each of the four buttons (A2, A3, A4, A5);
Adafruit_FreeTouch qt_1 = Adafruit_FreeTouch(A2, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE);
Each of which you qt_1.begin(); in setup(void), and then read with qt_1.measure() as in;
if (qt_1.measure() > 700) { /* do stuff */ }

The backlight and NeoPixel parts were straight-forward. And the only other thing I did was add an extender to the battery JST connector so it's easier to reach. I wrapped the leads around the shield, and tucked the battery between the shield and board.




Back of the badge, with SD card shield in place, and battery tucked between
Photo by [personal profile] chebe






Front of the badge, displaying an image with overlay, and NeoPixel backlit
Photo by [personal profile] chebe



Messy code dump cobbled together from various tutorials )
chebe: (Default)
2020-09-06 02:32 pm

3W LEDs, from Micro-controller, via MOSFETs

Time to play with some super bright LEDs! (Just remember; do not look directly at them while powered.)

Kitronik have some lovely 3W LEDs (with unfortunate name) in a star shape for heat dissipation. They provide a datasheet with example circuit for 5V power source. It requires 2.2 ohm power resistors, which are new to me. But when I tried regular resistors there was a lot of smoke, so they are definitely required.

I want to control the lights from a lower voltage micro-controller, so I'm going to need some N-channel MOSFETs. This is my first time using these. The Data pin (from the Arduino) acts a switch to complete the higher power circuit that lights up the LED.

All together the circuit looks a bit like this.

Images )
chebe: (Default)
2020-06-23 09:48 pm

Generate -5V to 5V signal from Arduino

An Arduino microcontroller can generate a square wave on PWM pins to simulate an analog wave. But the wave alternates between 5V and 0V, it doesn't change polarity.

If you have a component that expects an AC signal you need to change the 0V to 5V signal to a -5V to 5V signal.

One simple way to do this is with a SparkFun Transceiver Breakout. Connect the Power pin to either 3.3V or 5V on the Arduino, GND to GND, T2IN to a PWM pin, and T2OUT to your component. analogWrite() your required frequency to control your component.



Back of SparkFun Transceiver Breakout with labelled pins visible
Photo by [personal profile] chebe

chebe: (Default)
2020-04-28 08:20 pm

Time Cuboid

I find myself, like many of us, sitting at my desk a lot. I sit there for work. I sit there again for the many video and/or voice socials that have been set up. I sit there to play games or watch films. I even clear off the computer stuff and sit there to solder and work on projects. I am, in fact, sitting there now as I write this. So basically, I sit there a lot. And it got so that I found it difficult to know what time it was, whether early or late, start of the day, or end. I know, I thought, possibly aloud, no-one will ever know, I need a clock.

But I didn't want to go buying lots of unnecessary things, or wait until my usual suppliers were back in full swing. So I dug around in the piles of boxes that comprise my electronics stash. Back at GaelHack (seven years ago) I started on a clock, but it never left the breadboard. I dusted that off, and found most of what else I needed.

Making it all fit together )

Given the purpose of the device, and age of most of the components, I had half a mind to refer to this as a Time Capsule, but Time Cuboid seems more self-explanatory.
Overall it looks something like this;



Time Cuboid, on
Photo by [personal profile] chebe

chebe: (Default)
2017-09-23 10:00 pm
Entry tags:

Mega Pro Mini 3.3V

I finally opened up my Mega Pro Mini 3.3V, long retired it turns out, for something. Luckily I had bought the necessary connectors at the same time, and I always have an FTDI breakout board handy. But things I needed to figure out;

You need to add Sparkfun to your "Additional Boards Manager URLs" in the Arduino IDE;
https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json

Then select your Board as "SparkFun Mega Pro", and Processor as "ATmega2560 (3.3V / 8 MHz)".

But also, that each of the pins in output mode only supply about 40ma. Not the 200ma these lamps require. *sigh* Back to LEDs!
chebe: (OnTheVergeOfSomethingWonderful)
2017-02-26 06:24 pm

Open Theremin V3

Gather:
- active/powered speakers with a 3.5mm stereo audio jack (bonus points if the power plug is grounded)
- camera tripod
- Arduino Uno, from wherever it has been gathering dust (and USB/power cable)

Acquire:
- Open Theremin Arduino Shield
- 1m of aluminium round tube; 6mm external thickness, 1mm wall thickness, 4mm internal diameter, from your local hardware shop

Do:
- Cut tube in half, and bend (or get bent) each half into the shape described in the diagram
- Solder shield together. (The button and LEDs are surface mounted. I scorched a leg pad of the yellow LED, so no blinky yellow for me.)
- Program Uno
- Plug all the bits together. The whole lot should be grounded, but both my speakers, and the Arduino, are powered over USB, and I could not find an earthed USB-converter plug. So, at the moment, they are plugged into my laptop, which is plugged into the mains. (There is a ground pad on the shield that I should hook up in future.)
- Power up, leave to warm up, trigger auto-calibration
- Make ALL THE NOISE



Theremin!
Photo by [personal profile] chebe



- Start band
chebe: (WalkSign)
2016-08-15 09:32 pm
Entry tags:

4x4x4 LED Shield

You know the story; you go into Maplins for solder, and you walk out with an LED Cube Shield. (It can't be just me.) Anyway, building one of these yokes seems to have become a kind of rite of passage for the makery sort. So, I made one!

Couple of photos )



Not so straight LED Cube, completed
Photo by chebe



Pretty!
chebe: (AsciiC)
2015-09-23 09:11 pm
Entry tags:

Uno and LilyPad and Adafruit 2.2" TFT LCD

Further experiments with the LCD screen.

Install two libraries;
Adafruit_ILI9340
Adafruit_GFX


Uno pins;
- 13/SCLK to SCLK
- 12/MISO to MISO (not needed)
- 11/MOSI to MOSI
- 10/SS to CS
- 9 to DC
- 8 to RST

Arduino Uno breadboarded to 2.2inch LCD

Uno works smoothly
Photo by chebe





LilyPad Maincontroller pins;
- 13/SCLK to SCLK
- 12/MISO to MISO (not needed)
- 11/MOSI to MOSI
- 10 to CS
- 9 to DC
- 8 to RST

Arduino Lilypad Maincontroller breadboarded to 2.2inch LCD

Lilypad Maincontroller works as well!
Photo by chebe

chebe: (WalkSign)
2013-06-30 02:43 pm

GaelHack, and Arduino digital real-time clock

The first GaelHack took place a couple of weeks ago, the weekend of Friday 7th to Sunday 9th of June. It was a nice way to start a new tradition, with about twenty people from all over Ireland attending. (I think all but two of the hackerspaces were represented.) It was held on a scorcher of a weekend, in a boarding-school-converted-into-Scouts-Centre, with the option of camping or boarding in the hostel like rooms.

We took over a large room with a bunch of tables and chairs, set up the projector, and got started. There were a few presentations, a couple of hands-on workshops, and a few excursions out-of-doors into the beautiful sunshine to play with aerials and satellites. And to get the occasional ice-cream. In some ways the location was ideal (sunshine, quiet, facilities), but it did lack in some respects (insufficient internet, barely any phone signal, children everywhere). It was definitely a good start though, and at the end there was a great discussion, with people from different hackerspaces volunteering to look around their own localities for alternatives. I'm looking forward to next years. (There's a very thorough write-up by another attendee on the way, I'll link to it here when it's live. *EDIT* link)

Throughout the activities, in spare cycles, we worked on our own projects. It struck me how awkward Ardunio can be when you don't have an awful lot of internet to go looking for, and downloading, documents, tutorials, and libraries. But I persevered, emboldened by fellow attendees reminding me that there is almost always a library out there already. I got started learning to use I2C, real-time-clocks, and seven-segment-displays. Obviously I built a clock. This is the first step towards something else, but let's not get ahead of ourselves.

Arduino Uno, (you can ignore the MicroSD-shield, it's not doing anything here,) Sparkfun Real Time Clock Module, Adafruit 4-digit 7-segment display. The display requires you to install two libraries details here, and even though I'm using the Sparkfun RTC it uses the same chip as the Adafruit one, and Adafruit provide a library here.

The only gotcha that I ran into is that the RTC time is not set, and it is not running when you get it. (It also needs to be hooked up to 5V, otherwise when you query it you get a nonsense response.) To set the time to the time on your computer there's a section in the Adafruit example setup().
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }

By default it doesn't execute. I had to remove the not to get it to run, i.e.
  if (RTC.isrunning()) {


You only need dto do this whenever you want to change the time, so ideally just the once. After that I just played around with the display, and got the colon blinking like commercial digital clocks.

Photo and video )
chebe: (Voices (Firefly))
2011-04-11 09:38 pm
Entry tags:

One fixed Uno

Just a quick follow up to my previous post with the links to fixing your Uno, otherwise known as updating the firmware. I ended up following the official doc, mostly because of the pretty pictures.

Firstly, I got two Unos in one order, and only one of them had this issue.

Secondly, they recommend soldering on a resistor, or some tricky juggling with wires. I selotaped my resistor in place for the procedure, then removed it. You think someone else would have thought of that.

Thirdly, you go get the file from github, but make sure you click the file to view it, then download from the 'raw' link, otherwise you'll end up trying to flash your Arduino with a html file. *whistles*

Fourthly, for once the program you need has the same name in the Fedora repo; yum install dfu-programmer

Fifthly, then it's a simple erase, flash, reset command combo.
# dfu-programmer at90usb82 erase
# dfu-programmer at90usb82 flash Arduino-usbserial-uno.hex
Validating...
4058 bytes used (99.07%)
# dfu-programmer at90usb82 reset


Sixthly, then you unplug the usb cable and enjoy an almost properly functioning Uno. When I try to upload sketches to the Uno it still fails, unless I press the reset button after starting the upload (when the first line of output appears on the console is a good time). Still, an improvement.
chebe: (Daria_hate)
2011-04-06 08:48 pm
Entry tags:

Links to fixing your Arduino Uno

Because it took me too long to track this information down. Seems to only be a problem on Linux.

The problem is with the firmware. A compile flag got left out, and has resulted in all kinds of frustrations. More info from the forum: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/38#38

Fixes;
- http://www.strangeparty.com/2010/12/13/fix-your-arduino-uno-for-linux/
- http://arduino.cc/en/Hacking/DFUProgramming8U2

I haven't tried it yet, as I spent so long trying to track the problem down. Will give it a go soon.

Don't you just hate it when your shiny new toys arrive broken?
chebe: (Default)
2011-02-17 03:34 pm
Entry tags:

Momentary button setup

More for myself than anyone else, I often have trouble remembering how to set-up my 4-leg momentary buttons, so I'm making this reminder.

The button has four legs, two pairs of two essentially. The pairs have the flat ends facing each other, like brackets; { }. These pairs are connected when the button is not pressed, and current can be measured across them. When the button is pressed it switches (no pun intended) to flow from one of each pair, to its opposite counterpart. So really, only need to use two of the legs (one of each pair).

Breadboard pics )
chebe: (Default)
2010-05-05 06:27 pm
Entry tags:

Audio detection via electret microphone and Arduino, step one

I've had one of these for a while now. What is it? It's a microphone, with all the added bits necessary (opamp etc) to create a signal loud/strong enough to be read by microcontrollers, and other things. But, I've been having a hard time learning how to use it.

First there was the physical hurdle, is it even connected properly? I eventually grabbed a six-pin header (female on top, like on the Arduino itself) and used three of its pins. VCC goes to 5V, GND to GND, and AUD to Analog In pin 0.

Now I'm struggling with how to read the values. If I just print the readings as fast as the Arduino can handle (by default, meaning no delay()s), I get a range that approximates a nice sine or cosine wave, centered maybe (evaluating by eye) around 510. But what do I do with it?

Well, I've managed loud sudden noise detection, like a bang, a knock, or a loud clap. It's actually rather like an analog version of the push-button switch state from my LED-top.

//You set the previous value to be the sensor value.
previousReading = sensorReading;


//Then you update the sensor value with a new reading.
sensorReading = analogRead(mic);


//You take the difference between the two values.
readingDifference = sensorReading - previousReading;


//You set a desired sensitivity rating, in this case 100.
//If the difference exceeds the sensitivity threshold it's an event, do something.
if(readingDifference > 100)
  {
    numBeats = numBeats + 1;
    Serial.print("Beat ");
    Serial.println(numBeats);
  }


So now I guess I could hook-up those lights that turn on and off with clapping, but there's not much else this would be good for. Maybe a more sensitive version for just pulsing lights with a strong bass-beat in songs? Ideas on a postcard. Have to study more about sound wave analysis to be able to use this sensor data to more advantage.
chebe: (South Park)
2009-10-08 10:50 am
Entry tags:

Stagnation

I admit it, I'm awful at updating, especially when I have nothing to update about. I got distracted from my gloves project, and am currently working on how to use audio signals. I got myself a tiny microphone, and hooked it up to my Arduino Duemilanove via breadboard. Only, I've realised that I know nothing about audio sampling or analysis! So, I'm trying to piece together a working knowledge, all the while hoping that the microphone is connected up properly (I have a sneaking suspicion that the contacts aren't being properly contacted). So this is likely to take my full attention until I either crack it, or get bored.

In other news, there is talk of workshops in TOG. One on electro-clothing (essentially playing with EL wire) will be first, in the next two weeks. Also, there may be one on more traditional forms of sewing in the next few months. Keep an ear out if you're interested.
chebe: (Default)
2009-08-04 08:44 pm

My first Arduino Lilypad project

How It All Began:

In this world there a great variety of people, with vastly different skills, interests, backgrounds, and futures. But for the sake of this post I will concern myself with only two kinds. Those who know cool electrical stuff, and those who don't. I fall into the latter category. But when a friend told me about these pre-assembled circuit boards, that are used to rapidly prototype gadgets and inventions, that are so simple to use that artists with no technical background are able to pick them up and realize their visions, well, my first thought was, 'that's kinda cool'. So idly I browsed the interwebs, for this strange thing called Arduino, and discovered it's sleeker, purple-ier, sibling, the Arduino Lilypad. It offers a subset of the range offered for the Arduino, but washable, and redesigned for use on clothing. My imagination immediately filled with visions of me dancing, trailing swirls of colours. *ahem* And other less girly things. And I just knew I had to get my teeth into it. Afterall, if it was so simple to use then I could hardly fail.
This is long, and has two photos, and two videos )


Things I Learned:

- The Lilypad is more expensive than the Arduino, so unless you want wearable tech specifically, stick to the Arduino.
- The Arduino works in a three-dimensional space. You can build flat circuits, or giant cubes. The Lilypad, although it has to shape and conform to the 3-D form of the body, works primarily in flat planes. You are fairly limited to above the fabric, and below it.
- If you don't know much about electronics the Lilypad is easier to use and understand. As you learn more you start seeing how your projects would translate to the Arduino, and just how neat and clever (both intentionally, and coincidentally) the Lilypad is.

- I have installed the Arduino IDE on both Fedora 11 and Windows XP. Both are similar and very easy. Windows does have the disadvantage of offering you many COM ports, and you just have to try them all to find the one that's connected to your Arduino. Whereas on my Fedora machine I have to launch it from the terminal, and as root.

- When using the Lilypad you may notice a complete lack of resistors. This is because the power sources readily available are about 3-5V, which is the range the Lilypad likes. But also, despite it's name, conductive thread, while being conductive relative to ordinary thread, is a quite poor conductor with regards more traditional electrical items like wire. So in essence the thread is your resistor. If you need a greater resistance, simply create a longer path of thread between the power source and your components. Adding other pieces, like clasps and such can also add a decorative touch of resistance if needed.

- Conductive thread is like unshielded/uninsulated wire. It is very important not to cross the positive and negative strands. And seeing how easily the thread frays you will need a way to seal away the knot-ends at the very least. I currently use fabric paint, and find it very good, despite a quite long drying time.