Ultrasonic Distance Sensing

I really should have a running list of these mini-projects I have been cranking out. This one: using a PING))) sensor from Parallax Inc to drive LEDs for a set of values. Sounds boring, but it is sort of cool. Oh cool.

Picture time:

doing work at work, again

doing work at work, again

Follow the bump for a vid / snippet
Continue reading

Arduino Solar Cell Night Light Concept

So, I’ve formalized the solar cell project I have been poking at for a while. I managed to clean up my code and mess with some initial conditions, etc., and now have a fairly solid proof of concept for a solar cell-centered night light.

lighty

you may want to ramp up that LED a bit

As was the case in my first few runs, my sketch incorporates a five second initialization phase. This acts to set both relative minimum and maximum values which act to provide “full light on” and “full light off” values, respectively. The generated power from the solar cell is read in to the Arduino via analog input, and the LEDs are driven via digital outs. The rest is some simple math that transforms the range of the analog signal into a digital range of zero to two hundo fifty five.

It’s giant-ass-text-having snippet time!

// Solar LED IO
// Joseph Swanson | http://swantron.com
// 2011

// Define constants
const int sensorPin = A3; // Solar cell Pin
const int ledPin = 5; // varuiable LED Pin

// Define variables
int sensorValue = 0; // wipe read value
int sensorMin = 0; // set initial min
int sensorMax = 1023; // set initial max

void setup() {

// turn on Pin 11 LED…indicates calibration period begin
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);

// stay lit for five seconds
while (millis() < 5000) { sensorValue = analogRead(sensorPin); // adjust for real max if (sensorValue < sensorMax) { sensorMax = sensorValue; } // adjust for real min if (sensorValue > sensorMin) {
sensorMin = sensorValue;
}
}

// end Pin 11… calibration period finito
digitalWrite(11, LOW);
}

void loop() {
// read the solar cell analog
sensorValue = analogRead(sensorPin);

// apply a little calibration to the sensor reading
// bit from example sketch at http://arduino.cc
sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255);

// set constraint for outliers with respect to min/max
sensorValue = constrain(sensorValue, 0, 255);

// fade the LED from one to 255
analogWrite(ledPin, sensorValue);
}

Pretty straight forward. On to the vid…


It’s web2.0-too-many-script-ass-calling embedded video time!

Not too bad. Again, I used an Arduino Duemilanove and a Solar World panel. I might try to further this concept by incorporating my 120V switch and getting a lamp up in here. Stay tuned, as always.

Arduino Proof of Concept Vid

As promised, behold the much-anticipated footage of my Arduino AC Interface proof of concept. It was dark in my ‘lab,’ so the footage leaves something to be desired.

So, if anyone is in need of a strobe light, hit me up. I’m all over that.

Stay tuned…I am working on the web-side of the Android dev kit, so hopefully I will have another test coming soon. Ethernet shield, Android, Arduino, and 120V…I’m getting giddy.