Wednesday, October 19, 2011


I got this used for $45 and can now run external loads through a transistor circuit.

Friday, October 7, 2011

Baby Steps

The software is controlling the LEDs I put together on the breadboard. No big deal for anyone, big deal for me. Baby steps. Gotta be able to control that LED, before you can program a software with inputs and outputs that can make a UAV fly safely from A to B.

External links
Code for Arduino example CIRC-02

Tuesday, October 4, 2011

Coping with Rotary Encoder

while RotaryEncodeBehavior <> good
drink beer

Monday, October 3, 2011

How to Make an Animated Rabbit Ear

I have the Arduino for over a week now and I just couldn't wait to actually make and animate the first sub-component of the robot I want to make. The robot will be called "Vigilant Rabbit" - that's what I think right now. The first sub-component of that is its ear. From a product design perspective, that ear needs to be able to rotate around its vertical axis, and for cuteness it needs to be able to bend 90 deg at midpoint. It will also need to look and feel absolutely realistic. How it will interact with its environment will be revealed in future posts.

For now, I've made the skeleton of it from 14 AWG solid copper wire (about 2 mm diameter), soldered with lead-free solder (97% SN, 3% CU). That's attached to Servo 1, which - for now - is controlled by a rotary pot. Servo 1 is fixed to the rabbit or robot head (since I don't have that yet, I used a half full pot of salt as you can see in my photos and video). The ear has another on-board servo, that controls the 90 degree bend. This for now is taking its directions from a second rotary pot. See video below for the animated ear. It got done at 2 am in the morning that night.

If you want to find out about how I made the ear's skeleton, see pictures below, and some hints. I also attached the Arduino code below.

For the skeleton I used soldered 14 AWG solid copper electrical wire. This roll of 25 feet has 3 separate wires in it, so I actually got 75 feet for $12 at the hardware store.

The center wire can just be pulled out.

Remove the plastic around the wire to get to the good stuff.

Bend your wires and bring them in contact using a third hand. Then solder the joints. I used 600 degrees F and a Weller ETD tip.

Finished ear skeleton with servos and code from the starter guide.

Finished ear hooked up to Arduino.

Cutting a hole in the salt container for the servo.

Done for now. The animated ear is now attached to the salt container and I'm ready to try it out. Things that need improvement:
- the two servos seem to cross-feed, or interfere with each other
- the ear does not bend 90 degrees yet
- need ear number two

Arduino Code to make the servo-driven rabbit ear work.

Saturday, October 1, 2011

using two pots to influence led behavior

i wanted to try something independent from the given examples and came up with the following (trying to understand that everything is a building block). so i wanted one physical input that controls the time my led is on. and one physical input that controls the time my led is off. my two rotary potentiometers served me well for this. in order to see on my computer screen what values the pots return, i plotted their values into the serial monitor. i can now run the sketch on the arduino and adjust the frequency and on-vs-off-time-ratio with the two pots. see movie below to see what i mean.

Here's the code:

int sensorPin1 = A0; // select the input pin for the potentiometer one
int sensorPin2 = A1; // select the input pin for the potentiometer two
int ledPin = 9; // select the pin for the LED
int sensorValue1 = 0; // variable to store the value coming from pot1
int sensorValue2 = 0; // variable to store the value coming from pot2

void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT:
Serial.begin(9600); // start serial com to monitor values visually as i change pots


void loop() {
// read the value from the sensors:
sensorValue1 = analogRead(sensorPin1);
sensorValue2 = analogRead(sensorPin2);
// turn the ledPin on as per value of pot1
digitalWrite(ledPin, HIGH);
// stop the program for
// turn the ledPin off as per vaalue of pot2:
digitalWrite(ledPin, LOW);

Serial.println(sensorValue1); // output the value to see what it is in the monitor
Serial.println(sensorValue2); // output the value to see what it is in the monitor

it took me a while to realize this, and it was an eye opener:
- your inputs and outputs are not physically connected, just through the software
- the code is a bit confusing because it uses variables to camouflage what it's doing kind of
- the two blue pots send their signal as a voltage input to the program (follow red arrow)
- the outputs send the corresponding information to the led as an output (follow green arrow)
- in reality, the code runs on the arduino, not on your pc (so the arrows stay on the board), but it's easy to visualize it that way