Category Archives: microcontroller

Opentech 2011, ULU London

Dorkbot talk Saul & Pete

(As usual) I had a fabulous time at this year’s Opentech 2011, a multi-stream conference that brings hacker, open source advocates, civil servants, open rights and other communities together to discuss, debate, chat and drink beer. It’s a great day of talks intersected with a fab geek social, it traditionally occurs at ULU in London.

Taken straight from their website intro: “OpenTech 2011 is an informal, low cost, one-day conference on slightly different approaches to technology, transport and democracy. Talks by people who work on things that matter, guarantees a day of thoughtful talks leading to conversations with friends.” It is certainly all these things.

Hard curves, soft electronics
Photo by @PSD

I gave a presentation titled “Hard Curves, soft electronics – code, tech and textiles” – at which I demonstrated some of my wearable technology pieces, specifically those made with LilyPad Arduino (an open source technology) sewable microcontrollers, sensing modules and conductive threads and textiles. These included Twinkle Starduino, I <3 0X0, Twinkle Tartflette and 'Yr In Mah Face', plus I mentioned some of my mbed work. I also discussed how e-texiles and the LilyPad help dismiss the idea that electronics are grey, sharp and cold. I also feel that the rise in tinkering with Arduino and e-textiles is a great way of encouraging girls / hobbyists / anyone to have fun and see beyond the stigma of electronics and coding being a dull and difficult to pursue.

Here's a link to my slides, plus one of the videos I showed during the presentation which demonstrated my ‘Yr In Mah Face‘ temperature / mood sensing t-shirt.

Talks I enjoyed this year included, a history and expose under the sheets of London dorkbot – ‘doing strange things with electricity’ from janitors Saul Albert and Peter Brownell. The session included some hilarious, bonkers and touching reminders from dorkbots of the past. The London dorkbot chapter was second to evolve, after New York being the first and has been going for nearly 10 years.

Paul Downey of OSHUG gave a lovely introduction to open source hardware, some examples of projects, events, plus various groups and people hacking tech.

Opentech: PSD on open hardware

Russ Garrett, spoke about the London Hackspace and gave a brief history of how it grew from small beginnings and venues into a very organised space today with at the time of the event, membership being nearly 300 people.

Open hardware questions: Russ

It was good to hear an update from Suw Charman-Anderson on Ada Lovelace Day: a celebration of women’s achievements in science, technology, engineering and maths – a subject very close to my heart.

Steve Goodwin gave a talk about digital archeology and the difficulties in creating and archiving retro technology. Steve concluded by showing his EMF emulator framework for a ZX 81.

A bit of light hearted and NSFW fun came from Jag who was inspired by his father’s knowledge of morse code, to play with it and come up with “an attempt to acquit extremely offensive & censured words using morse code, din & music”.

After the talks concluded, everyone made their way to the ULU bar to chat with friends old and new, plus quaff beer. Sadly the kitchen wasn’t open in the evening – I’m sure it would’ve done a roaring trade in its legendary curly fries. An awesome day – thanks to Sam Smith and all the lovely organisers for a very well executed day, the only shame is that I’ll have to wait till next year for the next one!

Ourduino PCBs
A couple of Ourduino’s beautiful PCBs.

Maker Faire UK, Newcastle

Busy Maker Faire UK
Maker Faire main hall – there were several other rooms…

On 12-13th March the third Maker Faire UK took place at Newcastle’s Centre for Life as part of their Science Week. I have no idea what it’s like to visit an American Maker Faire and I *boggle* at what the sheer scale of their events must be like as I hear that about 80 thousand people visit them! But, what I do know is that the UK Maker Faire is one of the best technology and science events you can ever visit in the UK. Why? It’s because Maker Faire is all about getting to participate and have fun, whether it be playing with sound, solder, a pinhole camera, bacteria, making a pie or knitting a neuron, the visitor gets to experience tech and science first hand, it’s participatory and not a sitting back and watching experience.

Maker Faire
The Room of 29 Things stand

This year, Maker Faire UK was twice the size as last year and if I remember correctly last year was twice as big as the first. I must say I’m pleased that Maker Faire UK has grown so quickly over the last two years and aroused so much interest, as technology and science certainly has the best toys. But seriously, it’s a brilliant way to encourage and nurture fledgling (and not so fledgling) interest in these subjects, I remember science certainly wasn’t so much fun when I was at skool and it’s also really, really important to encourage engineers and scientists of the future for all sorts of reasons. Finally, I’m also pleased it grew in size enough not to be in a chilly marquee, as I remember how chilly it was for the first Maker Faire UK ;-)

Space Science
Space Science ladies showing kids some fun stuff

I had my own stall this year, a bit of an undertaking as previously I’d been on the BBC R&D stand, but I enthusiastically set out with two trolleys, a rucksack and two bags (a slight mare to steer all that lot of ones own is an understatement) but I managed to make it to Newcastle for Friday set up day. I took three interactive LilyPad Arduino interactive sound artworks: Twinkle Tartiflette, I <3 0X0 and Twinkle Starduino, plus a selection of my electroluminescent wearables, including the Neon-Victoriana Queen outfit and crown.

Me at Maker Faire UK
Me and some of my electroluminescant / microcontroller wearables

My stand at Maker Faire
Sideways look at my stand

Hats off and huge thanks to the organisers and all the makers and hackers who put on such an inspiring show. I’ve tried to compile a list of inspirations, but as I was on my stand just about the whole show (except for running out to get lunch), I didn’t really get to view the rest of the show but I reckon my hacking heros Mitch Altman and Jimmie Rodgers must have helped a couple of thousand peeps have a go at soldering a blinking LED badge and the London Hackspacers (there were several other UK Hackspaces represented too) got up to mischief with Brightarcs’ tesla coils! At lunchtime I peered over the atrium to see tons of people having fun with Jam Jar and Curiosity Collective’s toys. Next to me were the Room of Things 29 with Bubblino and other exciting hacks, and on the other side Clockwork Zeppelin were inspiring people with their Steampunk jewellery workshop. I also saw my former BBC R&D colleagues totally busy with all their fab toys and could barely view Lush Project’s Lunar Lander and Bicycle Pong for players queuing up.

Maker Faire UK
Curiosity Collective

For a taste of some of what was on show, here’s my little vidjo, it’s in no way comprehensive because I was busy on my stall most of the time and yes, there’s a lot of images of my work ;-)

A few thousand people came through the doors and I saw a queue wiggling nearly all the way to the entrance to the Centre for Life. A good percentage of the attendants were kids and I hope this event has inspired a fair few to nag their families to let them have a hack at something fun. Plus, there were many artists and hobbyists looking for tips and tricks, and I got asked a huge amount about where I buy my EL-wire and Arduino kit.

Mitch soldering at Maker Faire UK
Mitch Altman & Jimmie Rodgers, doing a bit of soldering prep

The following quote says something quite magical about Maker Faire UK; during Saturday evening dinner @Oomlout declared “It’s our two year anniversary – it’s two years since we all met” – it’s true, Maker Faire UK has brought together some brilliant people who were previously working disparately and who now stay in touch all year and help each other out with ideas, solutions and bits of kit – I’ve made some wonderful friends and co-conspiritors \(*v*)/

Mitch Altman sums it all up with “At Noisebridge Hackspace, SF, we have one rule ‘Be excellent to each other'” and I think the Makers and Hackers of the UK and beyond certainly are!

Oomlout stocks at Maker Faire UK
Oomlout stocks

PS, now that Oomlout’s crazy impresario has his new laser cutter I vote we make an Arduino catapult for the Oomlout stocks and have them in the Centre for Life courtyard – I’d pay to toss a tomato!

IMG_3502
Twinkle Starduino – my interactive musical artwork

My stand at Maker Faire UK
I <3 0X0 – Interactive & musical game

Kinetica Art Fair, 2011, London

Kinetica

Kinetica is an art show that showcases work combining science and technology, in forms such as electronics, light, time-based and kinetic mediums. It’s produced by the Kinetica Museum and for the past couple of years has been shown as P3 in Westminster University Campus at Baker Street, London.

The atmosphere for visitors entering Kinetica is quite overwhelming, in that they walk into a warm, underground, bunker space and are hit by a cacophony of sound emitting from the artworks that clank, whirr or make music. There is so much to see from artists from all around the world working in so many specialisations with all sorts of materials and reasons for doing so. The sight of kinetic art is magnificent and awe inspiring – it’s worth going just to stand back and gawp, or get in and play with the artworks. The artists are usually always on hand to demonstrate and answer the what, why and how questions. It is hot and dark and round every corner lies something eclectic, visually stunning, technically awe-inspiring or deafening!

Tea time

This year I exhibited as part of the ArtHertz curators collection of contemporary artists whose work uses technology, unconventional spaces, film, DJ-ing, music or emphasizes themes such as electricity or stories to tell from ghosts of past eras. ArtHertz is run by Dennis Da Silva and co-curator, Beverley Bennett.

Here’s my modest video of the work on show on the ArtHertz stand:

I exhibited two artworks that use LilyPad Arduino sewable microcontroller technology: Twinkle Tartiflette, a stylus driven, embroidered, music making, interactive shirt and I <3 0X0, an interactive, music playing game of noughts and crosses using conductive Velcro. They both prove to be challenging in the public exhibiting environment as they’re so delicately constructed – I was able to let people have a play with both of these, but had to demonstrate how delicately their fabrics and conductive materials were first. I’m definitely on the look out for more sturdy conductive fabrics – I think this will become quite a difficult challenge to source as my work aims to prove that electronics do not have to be sharp and hard – which sometimes makes it tough to show these exhibits in such a lively and interactive show!

Twinkle Tartiflette & I <3 0X0

I also exhibited/wore some of my electroluminescent outfittery, here’s a slo-mo video of my Neon-Victoriana outfit that features in my other two Kinetica 2011 vidjos – warning: you might get sick of seeing this outfit ;-)

I was honored to be in such great company on the ArtHertz stand… Sarah Angliss’ work, Ventricle, snapped and pinched to Sarah’s heartbeat in a way that scared rather than soothed. The handbag it was fashioned from shimmering blood red material and a tempting five pound note (not placed in there by the artist) for some time tempted passers by to try to pull it out without getting their fingers bitten.

Sarah's Ventricle

Andrew Back’s, Time for Tea, by comparison gently and stylishly informed us of when there were changes in voltage in the UK National Grid caused by peaks in usage during different times of the day, these times helpfully inform us when best to put on a brew.

Time for Tea

Adrian Lee’s Search for Extra Terrestrial Existence (SETI) Citrus Division’ hopefully directs a laser pulsing ‘we are here’ in morse code to aliens, by the awesome power of 65 lemons. Like a sekrit project by a mad professor it projects mournfully upwards and onwards, seemingly forever.

Lemon laser

Outside of the ArtHertz stand there were many other highlights to see. Some of these were huge, imposing and downright scary, such as the whirring, pulsating The Particle by Alex Posada which I nervously viewed incase it took off and went postal. Some tiny exhibits, beautifully made were a joy to observe such as the ferrous piece by PE Lang or the mechanical constructions inspired by nature from Tim Lewis. I could give you a long list, but it may be easier to just view my video that whizzes through some of my highlights.

There were also some great talks and performances by art legends such as Stelarc and the Musion Academy showed some of its awesome work throughout the show. Plus upstairs you could get your hands on Arduinos and other bits of kit to make synthesizers and all sorts of fun makes.

Cybersonica & Manchester Art Gallery – Make it yourself
pot80

Musion Academy
Musion

Anna Dumitriu & Alex May’s stand
Trollololo

Poietic Studio – Floating Forcaster

Lovely Stelarc & Rain
Stelarc & Rain

Twinkle Tartiflette – an Arduino driven interactive word/music artwork

LilyPad Arduino is a great platform for rapid prototyping, for my standalone interactive art projects and wearable artworks. It’s also a fun way to learn about electronics and programming.

Here’s how I created Twinkle Tartiflette, an interactive artwork, using various LilyPad modules connected with conductive thread.
My inspiration came from a Stylophone Beat Box that I recently purchased as a present and had a play with. I pondered how one would go about making an interactive artwork using LilyPad components.

I decided that I wanted to combine words, image and sound into an interactive experience, brought to life by touching the words with a stylus. I began to think about how I’d build this and firstly decided on re-using the frequencies for notes worked out for a favourite ditty, Twinkle Twinkle Little Star, that I’d used in another artwork. I would transfer the first two verses word for word onto felt stars, one star for each verse.

Sewing Twinkle Tartiflette

There are 6 notes in the 2 verses so I needed to map out a schema for the conductive thread to pass from the words to the Lilypad, joining each word to the right note pin on the LilyPad – being careful to select conveniently located pins.
First I cut out 2 star shapes and began sewing the words onto them, not being an experienced embroiderer this wasn’t easy or terribly pretty.

After about a week of evenings I had two stars with conductive thread sewn words in the right order. I was mindful to sew the words carefully so frayed thread did not touch and cause any shorts – fabric glue is good for sticking down frayed thread and keeping close knots apart.

With the word stars completed it was time to deploy the main sewing schema – I’d mapped notes to the words and then words back to pins on the LilyPad.

Twinkle Tartiflette schema

After an intensive couple of weeks of sewing evenings later, I thought I’d sewn all the words to the right notes and pins, also adding buzzer and battery modules. There were some interesting insulation/bridging issues to be solved between the various paths of conductive thread, but I was ready to extract code ideas from my brain to see if it would compile!

The code I have written uses the speaker module to produce simple musical notes from connecting to the words with a stylus. I originally used a chart to match frequencies to the different notes.

Sewing Twinkle Tartiflette with conductive thread

With code loaded to the Lilypad, via an FTDI breakout board, it’s time to test – annoyingly there was a problem! The buzzer was not playing notes correctly, after some thinking and testing with a multimeter, croc clips and a single resistor – a solution was concluded – I’d need to add some resistors.

Unconnected the circuit is connected to high, but when the stylus touches a word it creates a simple circuit through the resistor and pulls it to low, but I needed some resistivity in-between. Looking through a ton of resistors 10k ohm seemed like a good fit, but where and how to add them was another question! A small LilyPad protoboard I had was just the job to solder the resistors to. I have six notes, so the protoboard was just right – I only had 5 x 10k ohm resistors, but found another resistor that was near enough to work (reading up later I found out that 20K pull-up resistors are built into the Atmega chip that can be accessed from software, so I didn’t really need need to add the resistors if I’d known that – hey ho, lesson learnt for next time!).

Soldering resistors to the protoboard

After some soldering, I had some more complex routing of conductive thread to do for the resistors on the protoboard. When testing I discovered I’d fix0red one problem, but had found another to debug! Earlier, I said to be mindful of the pins – I had accidentally connected to pin 13 which is the LED pin and has it’s own resistor which is set too low for this project. This showed up in resistance testing with the multimeter.

The fix for the wrong pin incurred some more unpicking and re-routing of conductive thread. I used an analogue pin as it was nearer and the least hassle to route to, this pin change required to be reflected in the code. Finally I decided the best thing to use for a stylus is a crocodile clip – which worked a treat.

Testing resistance with a multimeter

After all that, yay Twinkle Tartiflette lives! All that remained to do is tidy up the sewing, ensuring there are no trailing bits of conductive thread to cause shorts and gluing down anything looking like it was going to stray or come undone with fabric glue. Lots of lessons learnt, but hurrah!

Twinkle Tartiflette finished

Twinkle Tartiflette & Rain

I’ve made two videos for your delectation below – the first (00:44 secs) is a quick demo of me playing Twinkle Tartiflette.

This second video is an in-depth (05:40 mins) explanation of how I made TT, plus examples of debugging along the way – hope you enjoy!

Here is my code – you can use it via a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported license & I’d love to know if you do!

/*
* Rainycat’s LilyPad stylo style: sound used to power Twinkle Tartiflette
*
* Uses a LilyPad speaker module to produce simple musical notes from touching words to the song
* For a chart of the frequencies of different notes see:
* http://www.phy.mtu.edu/~suits/notefreqs.html
*/

int NotePinC6 = 0; // words connected to play note C6 analogue pin!
int NotePinG6 = 12; // words connected to play note G6
int NotePinA6 = 11; // words connected to play note A6
int NotePinF6 = 10; // words connected to play note F6
int NotePinE6 = 9; // words connected to play note E6
int NotePinD6 = 8; // words connected to play note D6
int speakerPin = 3; // speaker connected to digital pin 3

// A note in one octave is twice the frequency of the same note in the octave
// below. We define here the frequencies of the notes in octave 8. To get
// notes in lower octaves, we just divide by two however many times.

#define NOTE_C8 4186
#define NOTE_CSHARP8 4434
#define NOTE_D8 4698
#define NOTE_DSHARP8 4978
#define NOTE_E8 5274
#define NOTE_F8 5587
#define NOTE_FSHARP8 5919
#define NOTE_G8 6271
#define NOTE_GSHARP8 6644
#define NOTE_A8 7040
#define NOTE_ASHARP8 7458
#define NOTE_B8 7902

// This is an array of note frequencies. Index the array essentially by note
// letter multiplied by two (A = 0, B = 2, C = 4, etc.). Add one to index for
// “sharp” note. Where no sharp note exists, the natural note is just
// duplicated to make this indexing work. The play() function below does all
// of this for you :)

int octave_notes[14] = {
NOTE_A8, NOTE_ASHARP8,
NOTE_B8, NOTE_B8,
NOTE_C8, NOTE_CSHARP8,
NOTE_D8, NOTE_DSHARP8,
NOTE_E8, NOTE_E8,
NOTE_F8, NOTE_FSHARP8,
NOTE_G8, NOTE_GSHARP8,
};

// Arduino runs this bit of code first, then repeatedly calls loop() below. So
// all initialisation of variables and setting of initial pin modes (input or
// output) can be done here.

void setup() {
pinMode(13, INPUT); // make sure 13 is high impedance

//pinMode(NotePinC6, INPUT); — analogue pin automatically input
pinMode(NotePinG6, INPUT);
pinMode(NotePinA6, INPUT);
pinMode(NotePinF6, INPUT);
pinMode(NotePinE6, INPUT);
pinMode(NotePinD6, INPUT); // sets the ledPin to be an intput
pinMode(speakerPin, OUTPUT); // sets the speakerPin to be an output

}

// Arduino will run this over and over again once setup() is done.

void loop()
{

// special case hack for this pin:
if (analogRead(NotePinC6) < 256) {
play(speakerPin, "C6", 50);
}
if (digitalRead(NotePinG6) == LOW) {
play(speakerPin, "G6", 50);
}
if (digitalRead(NotePinA6) == LOW) {
play(speakerPin, "A6", 50);
}
if (digitalRead(NotePinF6) == LOW) {
play(speakerPin, "F6", 50);
}
if (digitalRead(NotePinE6) == LOW) {
play(speakerPin, "E6", 50);
}
if (digitalRead(NotePinD6) == LOW) {
play(speakerPin, "D6", 50);
}
}

// ————————————————————————-

// To produce a tone, this function toggles the speaker output pin at the
// desired frequency (in Hz). It calculates how many times to do this to
// produce a note of the desired length (in milliseconds).

void beep(unsigned char speakerPin, int frequency, long duration)
{

int i;
long delayAmount = (long)(1000000/frequency);
long loopTime = (long)((duration*1000)/(delayAmount*2));

//for (i = 0; i = ‘A’ && note[i] = ‘0’ && note[i] >’ operator is a useful shorthand that (for integers
// >= 0) basically translates to “divide by two this many
// times”, so we will use that:

frequency = frequency >> (8 – octave_number);

// Actually play the note!
beep(speakerPin, frequency, duration);
}
}

Thinking Digital 2010: Arduino Power Workshop

Thinking Digital 2010 kicked off with a choice of fabulous pre-conference workshops covering compelling topics such as web video, visual communication, origami and pitching. As a microcontroller enthusiast, I couldn’t help but choose the Arduino Power workshop run by Daniel Soltis of Tinker, Jamie Allen of Culture Lab and Brian Degger.

Most of the workshop attendees were new to Arduino, which was a good thing – Daniel and Jamie gave an overview of Arduino, its uses and some examples of cool projects.

We were each given a fantastic Oomlout ARDX starter kit – which is a great kit for anyone starting out or wants a nice kit with a variety of parts for projects, followed by a walk-through of a few simple sketches as a nice intro to Arduino, then let loose with various cogs, propellers, wire, balsa wood, glue guns and other bits to build and experiment with.

I created a dancing kitty, fashioned from balsa wood in conjunction with Arduino and a few bits of kit and a sketch – to become a simple example of how one can use a DC motor with a propeller to power a servo.

Here’s a little video of the simple whimsical kitty I made:

I’ve been asked to publish the sketch for this, and as all the wonderful libraries and examples in Processing are open source I’ve posted it below. As with all sketches, you can modify them to your needs or tweak the values to suit your project.

For example, you can experiment by changing one of the values in the sketch below to get the best turning response from the servo. So in line val = map(val, 0, 1023, 0, 179); – I changed ‘1023’ to the maximum value I got from the DC motor when spinning the propeller – I tested this using another sketch and while spinning the propeller and reading the voltage which in my case was ’45’.

You can just about see the breadboard / arduino pin layout in this photo:

Dancing Kitty breadboard / arduino layout

Knob sketch:

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott

#include

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}

Many thanks to Daniel, Jamie & Brian for a fab afternoon of fun & lovely ARDX kit :-D

Fun with my new mbed microcontroller

Hope you all had a fab extended chocolate eating festival weekend – I had a lovely one, thanks! I had some time to play with my new mbed microcontroller. It’s a powerful little thing for rapid prototyping, for example it has a mighty ARM chip, it supports lots of interfaces and is simple to connect to your pooter of choice via USB and uploading code is really quick, so is great for tinkering with lots of iterations – read more about mbed’s specs here! Interestingly it has a web interface for compiling – will see how I get on with this over time :-)

So my first two experiments:

I ported my TwinkleStarduino code, slightly modified for C++ classes (as mbed’s support library is different to what the Processing compiler uses). The two handy LEDS on the front of the mbed were used to make Hello Kitty’s eyes pulse to the tune of ‘Twinkle, Twinkle, Little Star’ – I used a paper image from a notebook for HK.

For my second, I used a simple 16 character black on green LCD display, connected to a breadboard by soldering a pin strip to it and ran a scrolling text script on the mbed.