Some photos from today’s demo show of work-in-progress for We Are Here. Including one working Arduino prototype with sound generator.
Category: prototyping
XBees connected
Managed to get the XBees talking to each other, following these steps. The video shows two completely unconnnected Arduino circuits. The one on the right (coordinator) sends the reading from the potentiometer to fade the light on the board on the left (receiver).
Getting the Space Rocks to talk to each other
Configuring the XBees.
Am using the Digi XBee wireless connectivity kit to allow the Space Rocks to communicate with each other. Following the tutorials on Sparkfun, I have managed to get them talking via X-CTU. Which is a good start.


And these two are also now communicating with each other.

And inside the plastic shells, at a distance of about 5 feet apart.
Arduino – Mozzi Piezo input tests
“A piezo creates a varying voltage when you squeeze it. [We’ll] use it as a sensor by measuring the voltage the piezo produces across a 1 megaOhm resistor…Notice it has a very fast response, especially a sharp attack and decay when it’s knocked.”
This first test was changing the frequency as the piezo was scraped and touched.
And the audio version:
Piezo sample trigger (& speed)
Piezo sample scrub
And finally an example of an external speaker circuit. Will need to work on the output level for this.
Arduino audio – further Mozzi tests
A video showing an Arduino Nano running the Mozzi library, which allows sounds generated from sensors. This uses the LDR + resistor as input to Analog Pins A1 + A2, and using the code from Arduino➞File➞Examples➞Mozzi➞03.Sensors➞Knob_LightLevel_x2_FMsynth
And here’s the attendant audio.
Space Rock – latest 3D prints
Some photographs of the latest 3D prints for We Are Here.
Arduino networked lamp test
Working through this tutorial currently, trying to understand how Processing can be used to network an Arduino and power the colour of a lamp from words featured in an XML feed (in this case my blog feed – replacing the word ‘love’ with ‘space’ and the word ‘peace’ with ‘rock’). This generates the colour #3C4C2C.

And after adding this post to the feed…
Note the slight colour change.
This is the circuit I used, from this website. The LED is a 4 pin one, which can generate any combination of RGB colour as light:

And the two versions of it that I built:


Here is the code used in Processing:
//Arduino Code for the Arduino Networked Lamp - Processing
#define SENSOR 0
#define R_LED 9
#define G_LED 10
#define B_LED 11
#define BUTTON 12
int val =0; //variable to store the value coming from the sensor
int btn = LOW;
int old_btn = LOW;
int state = 0;
char buffer[7];
int pointer = 0;
byte inByte = 0;
byte r = 0;
byte g = 0;
byte b = 0;
void setup() {
Serial.begin(9600); //open up serial port
pinMode(BUTTON, INPUT);
}
void loop() {
val = analogRead(SENSOR);
Serial.println(val);
if (Serial.available() >0) {
//read incoming byte
inByte = Serial.read();
if (inByte == '#') {
while (pointer < 6) {
buffer[pointer] = Serial.read();
pointer++;
}
//now need to decode 3 numbers of colors stored as hex numbers into 3 bytes
r = hex2dec(buffer[1]) +hex2dec(buffer[0])*16;
g = hex2dec(buffer[3]) +hex2dec(buffer[2])*16;
b = hex2dec(buffer[5]) +hex2dec(buffer[4])*16;
pointer = 0; //reset pointer
}
}
btn = digitalRead(BUTTON);
//check if there was a transition
if ((btn == HIGH) && (old_btn == LOW)) {
state = 1-state;
}
old_btn = btn; //val is now old,lets store it
if (state == 1) {
analogWrite(R_LED, r);
analogWrite(G_LED, g);
analogWrite(B_LED, b);
}
else {
analogWrite(R_LED, 0);
analogWrite(G_LED, 0);
analogWrite(B_LED, 0);
}
delay(100);
}
int hex2dec(byte c) {
if (c >= '0' && c<= '9') {
return c- '0';
} else if (c >='A' && c <= 'F') {
return c - 'A' + 10;
}
}
And the code in Arduino:
//Arduino Code for the Arduino Networked Lamp - Arduino
#define SENSOR 0
#define R_LED 9
#define G_LED 10
#define B_LED 11
#define BUTTON 12
int val =0; //variable to store the value coming from the sensor
int btn = LOW;
int old_btn = LOW;
int state = 0;
char buffer[7];
int pointer = 0;
byte inByte = 0;
byte r = 0;
byte g = 0;
byte b = 0;
void setup() {
Serial.begin(9600); //open up serial port
pinMode(BUTTON, INPUT);
}
void loop() {
val = analogRead(SENSOR);
Serial.println(val);
if (Serial.available() >0) {
//read incoming byte
inByte = Serial.read();
if (inByte == '#') {
while (pointer < 6) {
buffer[pointer] = Serial.read();
pointer++;
}
//now need to decode 3 numbers of colors stored as hex numbers into 3 bytes
r = hex2dec(buffer[1]) +hex2dec(buffer[0])*16;
g = hex2dec(buffer[3]) +hex2dec(buffer[2])*16;
b = hex2dec(buffer[5]) +hex2dec(buffer[4])*16;
pointer = 0; //reset pointer
}
}
btn = digitalRead(BUTTON);
//check if there was a transition
if ((btn == HIGH) && (old_btn == LOW)) {
state = 1-state;
}
old_btn = btn; //val is now old,lets store it
if (state == 1) {
analogWrite(R_LED, r);
analogWrite(G_LED, g);
analogWrite(B_LED, b);
}
else {
analogWrite(R_LED, 0);
analogWrite(G_LED, 0);
analogWrite(B_LED, 0);
}
delay(100);
}
int hex2dec(byte c) {
if (c >= '0' && c<= '9') {
return c- '0';
} else if (c >='A' && c <= 'F') {
return c - 'A' + 10;
}
}
This didn’t work the first time I ran it, so I had to specify the Arduino port that Processing should use and then…
Space Rock shapes – 3D printed prototypes, so far
The latest 3D printed prototypes for the Space Rock shapes.
Plus a video of the shells glowing, courtesy of Arduino.
Latest Space Rock prototypes
Some low resolution 3D prints. Getting used to the process, investigating how to add the electronics for audio and interaction and also working out the most ergonomic size for the final objects. In this case, bigger is definitely better.
Sound Systems
Today was partly spent constructing four identical containers for the speakers and nano boards to start playing with the interactions and connectivity of the various space objects / Rocks.

















































You must be logged in to post a comment.