Still excited by the great things we saw at Reasons to be Creative, a couple of friends and I got together to experiment and create something. We set a date and met up at Pete's shared studio space in Brighton.
We didn't yet know what to make, but between us we had a couple of Arduinos, and enough motors, servos, photoresistors, push buttons, potentiometers, piezos, LEDs and wires to make something interesting.
We just needed that good idea.
Saturday morning we started playing about with some of the basic Adruino tutorials. Having some Actionscript 2 knowledge from back in the day, and knowing a bit of JQuery, it was surprisingly easy to get something working from the little device. The hardest part was trying to remember what I had learned in school about circuits.
Within a couple of hours and with some help from Pete, thanks Pete, I had managed to setup a flashing LED, attached that to a push button, then connect a potentiometer (a rotary knob) to control the rate of flashing. I then attached a piezo (basically a little speaker) and replaced the potentiometer with a photoresistor. Now the more light you blocked from the sensor, the faster and higher pitched the tone was coming out of the piezo. It sounded somewhere between minimal techno and a Geiger counter.
This was all the code it took. Which might be intimidating to a non-coder, but most of the structure was already in place from the tutorial. So it was more a case of adding little snippets.
// Setting variables for the button, LED and the dial/photoresistor. int buttonInput = 0; boolean wasOn = false; int dial = 0; //Setting which outputs and inputs are being used. void setup() { pinMode(11, OUTPUT); pinMode(3, INPUT); Serial.begin(9600); } // Everything else sits within this main repeating function. void loop() { // Reading the value of the dial/photoresistor. dial = analogRead(0); Serial.println(dial); if(dial > 500){ // Setting a maximum time of 500ms dial = 500; } else if (dial < 15){ // Setting a minimum time of 500ms dial = 15; } // Activating the flashing LED when the button is pressed. buttonInput = digitalRead(3); if (buttonInput == HIGH){ if(wasOn){ digitalWrite(11, LOW); } else { digitalWrite(11, HIGH); } wasOn = !wasOn; } else { digitalWrite(11, LOW); } // Setting the tone relative to the dial/photoresistor. int pitch = dial; tone(8,pitch,20); // Setting the delay relative to the dial/photoresistor. delay(dial); }
After lunch we sat down to form a plan. In the shared office space there is a hatch that everyone has to walk past when entering the building. We came up with a plan to create a small waving hand to welcome people as they walked past the room. Remi and Luke worked on using photoresistors to detect as someone walks past. Judit worked on taming the servo. Pete and I worked at getting little LED matrix displays to flash the word "HI".
By the end of the day we had most of the parts working independently.
All we had to do on Sunday was to put the whole thing together. Easier said than done. The big problem we had, was getting enough change in light from the corridor as someone walked past. Ideally we would have had a different type of sensor to detect the movement. The light sensor would have worked better if there was a bright beam of light being cut. But with a little Energon and a lot of luck, and completely rebuilding the circuitry, we managed to get it working. Go team.
There are lots of tutorials online, so if you get stuck with what you're making, there's probably a post somewhere that can help. We plan on getting together again soon and attempting to make some more interesting things.
I'm considering getting myself a kit, and would highly recommend getting one. There's so much you can do with them.
Photos from the day on my Flickr
JJLPR* Judit, James, Luke, Pete & Remi.