Gabriella Levine

ongoing and past work

crankshaft music

things i’m learning from the mp3 trigger that i forgot:
>>power it using usb or 5V? extension
>>Status light:
1 long blink – No formatted microSD media found.
1 long blink, followed by 1 short blink – microSD media found, no MP3 files located.
Constant short blinks – Hardware problem with MP3 Decoder.
3 short blinks – microSD media found, at least 1 MP3 file located.

–>Track names have to be as followed:

and so on

—>IT Supports a bit rate of up to 192 kB

Initially I think my problem is the SD card, if I remember correctly:
What I’m trying to set up now :

–>spin an crank shaft that is somehow attached to an encoder, when the encoder recognizes motion, trigger a song. To trigger a song, this should happen when jumping one of the “mp3 tracks” to ground on the mp3 trigger, ie writing low to one pin that is connected to the mp3 trigger track pins.

using any encoder code:

and this schematic:

— > Step 1. Only if there is a change in state of encoder position, write LOW to the pin.
Let’s start with pin 13, just to see if I can have this happen with the light.
AND , once the state changing stops, write HIGH (ie don’t play the song)

Simply, this takes an arduino input (ie the encoder) but then outputs a DIGITAL signal to trigger a track. So here, D13 triggers a track to play when written LOW.
The outer strip on the mp3 trigger pins are GND; the inner pins are what D13 should be connected to;

After a while this proved not to be so simple:
things learned: use a pull up resistor for triggering clean, LOW output. ; if any of the pins are “pulled high” none of the pins will work…

eventual code:

Documentation of Sneel_002

Soon I will make a how-to guide for Sneel_002 on, as I did for the first version of Sneel, (i’m working on that) but until then…

Sneel swam in central park

The hardware:

Like a real snakes vertebrates:

I used Arduino Mega with multiple servos attached, using multiple 6V NiMh battery packs, placed along the body, with an xbee mounted on top to control three parameters of wave behavior: period, wavelength, and amplitude.

I taped the bottom of the Arduino so nothing shorted:

First I stuffed the arduino + xbee into a waterproof sac:

Then I decided that was overkill so I just stuffed everything into the tube (as I had sealed each servo motor with epoxy and had a water tight seal on the tube top and bottom)

See the waterproofed servos:

See wires etc. stuffed in the tube:

The Software:

A diagram of the control firmware and the relationship between the classes:

I wrote an Arduino library called ServoWave to control period, amplitude and wavelength of the oscillation for Sneel’s swimming behavior.

Here is it on github.

See how each servo motor oscillates – in the following graph, I print out values of each servo as each motor rotates in a sine wave slightly out of phase from each other. The x axis is time and the y axis is angle, and each colored line is a different motor.

After getting everything packed up in the tube, I tested Sneel_002 on the floor of ITP.

He seemed sort of real:

Sneel in the wild:

Well, Sneel_002 swam pretty well, sort of like a real snake, but there’s much work to be done…

Model shot:

bellflower voltage logging solar panel

logging voltage here:

arduino code here:

php and more to come…

BLINK detection –> blinding LIGHT

code here

I like the concept of always trying to reach something, or always trying to see something, but you cannot penetrate barrier in order to reach / see it. In a sense, something only occurring when you blink, to me seems like you straddle the threshold of perception… well, i dunno. I have to develop this more and figure out what it actually is I’m trying to see that I never can

Here is a video of me testing my blink mechanism then trying to implement it in the dark, as I thought that would be dramatic. However, there was a delay in the dark, as I guess the camera vision was more difficult.

A few tests with others:


for the fusebox festival, payphone revival project, in austin texas

using a mp3 trigger, and getting into the matrix circuit behind the keypad (luckily the phone was OPEN and not locked) we’re going to allow people to pick up the phone

The payphone is so much simpler than I thought! the coin slot is just a bunch of gears, then the circuitry for the buttons and the receiver etc… nice

So I soldered some wires onto the already working switch so when the receiver is picked up a dial tone plays, then working on the matrix to activate different tracks when I button is pressed


the mp3 trigger is pretty simple with a micro sd card, FAT 16 formatted (<2 gb)- either it can be digitally controlled, by closing the switch on pins 0-17 (which switches between 18 tracks), Or it can interface with arduino serially. [gallery]


Following the below circuit, I made used a transformer to make a variable voltage DC power supply, from 0-32 V. Here is the link:

This was from Eric Rosenthal’s Basic Analog Circuit class

snake servos

AC DIMMER Circuit!!

I adapted this from info from Dmitri Grinberg’s post on Hackaday, “Lamp Fading and Remote Control for the Lazy”.

I have been trying for a number of weeks to perfect this, as in, find the correct transistor that would not overheat or burn out (one that is rated for a high enough voltage since it’s using AC 120 V). I followed this circuit from Dmitri’s blog, except instead of the IRF 250 I used an IRF730.

At first, I was using the IRF 520, with a 100 V drain source voltage and a 9 amp continuous drain current. It worked fine at first, and then it burnt out (there was connectivity between the gate-source and gate-drain). So I got an IRF540, with a 100 V drain source voltage and a 33 continuous drain current. This similarly worked at first, then burnt out.

Finally, I used the IRF730 which works pretty well so far! And doesn’t burn out – it is rated upto 400 V (which far surpasses the 120 V wall voltage in the US).

It works for a light (a resistive load):

and a fan (an inductive load):

Here is the simple dimming code used with the infrared detection sensor. I used a universal sony remote as the transmitter.


I’ve switched over to this sensor as a solid state temperature sensor:
I will use thermocouples for rapid rate of changes of liquids but for environmental sensing:

from adafruit:

temperature from tmp36 sensor:

0.73 volts
22.75 degrees C
72.96 degrees F
0.73 volts

//TMP36 Pin Variables
int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade with a
//500 mV offset to allow for negative temperatures

* setup() - this function runs once when you turn your Arduino on
* We initialize the serial connection with the computer
void setup()
Serial.begin(9600); //Start the serial connection with the computer
//to view the result open the serial monitor

void loop() // run over and over again
//getting the voltage reading from the temperature sensor
int reading = analogRead(sensorPin);

// converting that reading to voltage, for 3.3v arduino use 3.3
float voltage = reading * 5.0;
voltage /= 1024.0;

// print out the voltage
Serial.print(voltage); Serial.println(&amp;amp;quot; volts&amp;amp;quot;);

// now print out the temperature
float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge - 500mV) times 100)
Serial.print(temperatureC); Serial.println(&amp;amp;quot; degrees C&amp;amp;quot;);

// now convert to Fahrenheight
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
Serial.print(temperatureF); Serial.println(&amp;amp;quot; degrees F&amp;amp;quot;);

delay(1000); //waiting a second

IR proximity sensor

Here’s the Sharp product i’m using:
bought from here:

This code is simply smoothing an analog input value (0-5V), and it seems to work ok, but I have to see – I’m working on graphing the values (using Excel and CoolTerm) to make sure that my linearizing function I got from here: = has worked correctly

const int numReadings = 100;

int readings[numReadings]; // the readings from the analog input
int index = 0; // the index of the current reading
int total = 0; // the running total
int average = 0; // the average

int inputPin = A0;

void setup()
// initialize serial communication with computer:
// initialize all the readings to 0:
for (int thisReading = 0; thisReading &amp;amp;lt; numReadings; thisReading++)
readings[thisReading] = 0;

void loop() {
// subtract the last reading:
total= total - readings[index];
// read from the sensor:
readings[index] = analogRead(inputPin);
// add the reading to the total:
total= total + readings[index];
// advance to the next position in the array:
index = index + 1;

// if we're at the end of the array...
if (index &amp;amp;gt;= numReadings)
// ...wrap around to the beginning:
index = 0;

// calculate the average:
average = total / numReadings;
// send it to the computer as ASCII digits

This code also is seems good but I have to check it out more closely:

int sensorPin = 0; // input pin for the sensor
int barPin[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
int barPinCount = 10;
int volt = 0; // variable to store the value coming from the sensor
int zeit = 100; // *10 = Gesamtzeit - total time

void setup() {
int thisPin;
// the array elements are numbered from 0 to (pinCount - 1).
// use a for loop to initialize each pin as an output:
for (int thisPin = 0; thisPin &amp;amp;lt; barPinCount; thisPin++) {
pinMode(barPin[thisPin], OUTPUT);

void loop() {
int volt = 0;
for(int i=0; i&amp;amp;lt;10; i++)
volt += analogRead(sensorPin);
volt /= 10;

int litCount = 0;
if (volt &amp;amp;lt;= 82) {
// &amp;amp;gt;= 80cm
litCount = 1;
} else if (volt &amp;amp;lt;= 92) {
// &amp;amp;gt;= 70cm
litCount = 2;
} else if (volt &amp;amp;lt;= 102) {
// &amp;amp;gt;= 60cm
litCount = 3;
} else if (volt &amp;amp;lt;= 123) {
// &amp;amp;gt;= 50cm
litCount = 4;
} else if (volt &amp;amp;lt;= 154) {
// &amp;amp;gt;= 40cm
litCount = 5;
} else if (volt &amp;amp;lt;= 184) {
// &amp;amp;gt;= 30cm
litCount = 6;
} else if (volt &amp;amp;lt;= 266) {
// &amp;amp;gt;= 20cm
litCount = 7;
} else if (volt &amp;amp;lt;= 328) {
// &amp;amp;gt;= 15cm
litCount = 8;
} else if (volt &amp;amp;lt;= 461) {
// &amp;amp;gt;= 10cm
litCount = 9;
} else if (volt &amp;amp;gt; 461) {
// &amp;amp;lt; 10cm
litCount = 10;

for(int b=0; b&amp;amp;lt;10; b++)
digitalWrite(barPin[b], HIGH); // Turn the bar on
digitalWrite(barPin[b], LOW); // Turn the bar off


circuit – SHT11 humidity sensor

I found a super nice library – – it’s working way better than what I had going before – Thanks!

I’m using this schematic: using this

I’m getting legible values :

Temperature: 25.4199981689C / 77.8459930419F. Humidity: 23.45%
Temperature: 25.4399948120C / 77.8639984130F. Humidity: 23.45%
Temperature: 25.4799957275C / 77.7919921875F. Humidity: 25.12%
Temperature: 25.4599990844C / 77.8999938964F. Humidity: 27.65%
Temperature: 25.3600006103C / 77.7739944458F. Humidity: 27.87%
Temperature: 25.5199966430C / 77.9719924926F. Humidity: 26.86%

circuit – 2 axis parallax accelerometer

This is on the arduino side:

int pinX = 3;
int pinY = 2;
unsigned long serialTimer = millis();
unsigned long xAcc = 0;
unsigned long yAcc = 0;
boolean flipflop;

void setup()
pinMode(pinX, INPUT);
pinMode(pinY, INPUT);

void loop()
if (flipflop == true) {
xAcc = pulseIn(pinX, HIGH);
flipflop = false;
} else {
yAcc = pulseIn(pinY, HIGH);
flipflop = true;

if ((millis() - serialTimer) &amp;amp;gt; 50 ) {
Serial.print(&amp;amp;quot;X &amp;amp;quot;);
// Serial.print(&amp;amp;quot; &amp;amp;quot;);
Serial.print(&amp;amp;quot;Y &amp;amp;quot;);

to visualize it:
in processing:

import processing.serial.*;

Serial port; // Create object from Serial class
int val; // Data received from the serial port
int xAngle;
int yAngle;

void setup()
println ( Serial.list());
size(200, 200,P3D);
// Open the port that the board is connected to and use the same speed (9600 bps)
port = new Serial(this, Serial.list()[0],115200);


void draw()
directionalLight(51, 102, 126, 0, 0, -1);
rotateX(map(xAngle,3800,6300,-1 * HALF_PI,HALF_PI));
rotateY(map(yAngle,3800,6300,-1 * HALF_PI,HALF_PI));


void serialEvent(Serial p) {
String msg = port.readStringUntil(13);
if (msg != null) readMsg(msg);


void readMsg(String msg) {

//remove non printing chars
int badChars = 0;
for (int i = msg.length() -1; i &amp;amp;gt;= 0; i--) {
char c = msg.charAt(i);
if ( c == 10 || c ==13) {
if (badChars &amp;amp;gt; 0) msg = msg.substring(0,msg.length()-badChars+1);

String[] words = splitTokens(msg);
if (words[0].equals(&amp;amp;quot;X&amp;amp;quot;)) {

xAngle = int( words[1]);
if (words[0].equals(&amp;amp;quot;Y&amp;amp;quot;)) {
yAngle = int( words[1]);


robot boat with many sensing capabilities


circuits for later

FRED Photopopper
Solenoids and Data logging shield and RTS
humidity, air pressure, photocell, rts, data shield etc…