Twitchy

February 27, 2009

I made the Servo example from the Arduino IDE, and took it to class. Everyone loved it. Also, I made an Arduino To-Go kit. I keep it in an old SparkFun box. Look quite nice, actually…

My ISP is wacking with my interweb connection, so I can’t access Flickr right now. Guess photos can wait :-(


Exposition of Rangefinder

February 18, 2009

I showed off my range finder in one of my classes today. Every was saying this: “Ooh! Cool!” They had never seen an Arduino, or a PING))), or an LED! They didn’t understand that it was a simple project, and that the code was a few lines. Bah!

But the good news is that I’m starting an electronics workshop at my house. Many people seem interested, and I’m going to start them off with the basics, then build up their knowledge in a set of many workshops. Each one is about 2 hours, and since no one even knows what a resistor is, I have to start at the beginning. But by the end of the class, I’ll have them (my class of 5-10) using the Arduino. I’m even thinking of buying Arduino’s for them.

That was my goal in the long run, to get people to use Arduino. I really do want other people to know that they can do all sorts of things with Open Source technology and have fun and learn something. I want people to learn about and use Open Source as a principle in their lives.


Welcome to Brain Drink!

February 16, 2009

Hello, and welcome to Brain Drink, a blog about my exploits and adventures in the world of Open Source programming, hardware hacking, building, and Open Source in general. In this blog I’ll mostly cover projects based on the Arduino microcontroller development board, the Arduino IDE, and Processing. So, sit back, have a brain drink, and enjoy my world of  Open Source technology.


Ping… Ping…

February 16, 2009

I got a Ping))) sensor from RadioShack yesterday. I just hooked it up to my Arduino/ ProtoShield combo and modded some code so that if an object is within 70cm of the device, it will light up an LED which is tied to DIO pin 13. So, basically, I made a rudimentary motion detector. Once I get my NEW Xbee’s, their breakout boards, and an LCD for my Arudino, I can work on my new wireless motion detector!

Images:

Code:

int pingPin = 7;
int inConst = 70;
int ledPin = 13;

void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}

void loop()
{
long duration, inches, cm;

// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// We give a short LOW pulse beforehand to ensure a clean HIGH pulse.
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);

pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);

// convert the time into a distance
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);

if(cm < inConst) {
delay(100);
digitalWrite(ledPin, HIGH);
}

if(cm > inConst) {
digitalWrite(ledPin, LOW);
}
delay(100);
}

long microsecondsToInches(long microseconds) {
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds) {
return microseconds / 29 / 2;
}


Follow

Get every new post delivered to your Inbox.