Monthly Archives: December 2011

An Arduino general purpose detector!

I’ve been spending some time getting acquainted with my new Arduino Uno.

I did the first Blinking LED tutorial which went exactly as expected.  This particular board has a built-in LED connected to pin 13, so I didn’t even need to do any wiring!

Having forced the on-board LED to blink, I decided to get a little more ambitious.  Along with my Arduino, I bought a bag of LEDs which came with the appropriate resistors for building simple circuits with the board I have.  I attached a 2nd LED to a small Bread Board and wired it up to pin 12.  After modifying the program a little bit, I got the two LEDs to alternate blinking.

Not wanting to stop at using only 2 LEDs, I strung up 5 more to the Bread Board and connected each to a corresponding pin from 7 to 11.  With everything wired up, I coded up a simple function that would take a number from 0-6 and light up an appropriate number of LEDs.  0 leds if 0 were passed and 6 if six was passed.  You can see that segment of the code here:

void light(int i) {

  if(i < 0) { i = 0; }
  if (i > 6) {  i = 6; }

  for(int j = 0; j < 6; j++) {
     int reg = 12 - j;
     if (j < i) {
        digitalWrite(reg, HIGH);
     } else {
       digitalWrite(reg, LOW);

The first time running it, I simply cycled through numbers from 0 to 7 which resulted in the LEDs lighting up one at a time then resetting.

Finally, I decided to mess around with the Arduino’s Analog Input capabilities.  The input seems quite sensitive because as I touched the wire that I connected to the input, it immediately began registering a voltage.   In my program’s main loop, I scaled the analog input to the 0-7 range of my LED array.  Now when I touch the wire, the more fingers I touch the wire with… the more LEDs light up!  Here’s the pic!

Here, I was holding the wire with three fingers; my thumb, pointer  and middle finger… four of the LEDs lit up.  Presumably, if I connect up any random sensor (light, sound, etc), the intensity will light up a corresponding set of LEDs.  That aught to be more useful than detecting fingers touching a wire.

Spherical Robots and Arduino Uno!

Back in November, I was at the Academy of Science for Nightlife and found nestled in the creepy taxidermy (African Hall), I ran into Spherical Robots rolling around. Check out the video:

This particular set of robots were originally created for Burning Man, but it’s no surprise to me that they would tour around the more sciency venues of San Francisco.  I’d never really considered a spherical robot before… but I guess it’s a “thing”.  Go ahead! Google it!

Now to me, the easiest way to get a sphere moving would be to have a rod running through an axis of the ball and you roll around it using either weight or a gyroscope on whatever internal mechanism you’ve got driving.  In this design you effectively have one HUGE wheel. These robots, however did not seem to do that.  They were able to roll in arbitrary directions.  They didn’t have to turn to change direction.

My initial gut feeling was, it used a pair of gyroscopes offset from each other by some angle.  When the orientation of the two gyroscopes change, the sphere’s effective center of gravity would shift causing it to move.  After doing some reading, though, it seems like that is not the case. A more likely scenario is… you have a large pendulum style structure which is moved around with a pair of solenoids.  This apparatus is dangled from a stable platform.  When the pendulum is pushed in a direction by the solenoids, the center of gravity shifts and the ball rolls.  The amount that the pendulum can move the ball is proportional to the weight at the end of the pendulum.

All of this conjecture has lead me to conclude that I need to try it out.  So… I’m off to learn a little bit of robotics.  So… how does one get started in robotics?  One dives right in!

I’ve been wanting to work with the Arduino family of microcontrollers, and this seems like an ideal project.  I ordered myself an Arduino Uno, a couple of add-on boards and am ready to rock!

My first goal will be to familiarize myself with the Arduino programming language and generally make myself comfortable with the tools involved.

There is some soldering involved.  You can see in the above image, my new toys.  The blue circuit board is the actual Arduino itself.  Below the magnifier is an add-on board that will allow me to control two motors.  (some assembly required).   I have a 2nd add-on board coming which will have add a small LCD display. I’m sure that board will be the one I play with the most (At least at first).

Naturally, I had to try to put together the motor controls, but it seems like fate would have other plans… Look at what happened to my soldering pencil:

Yeah. So… a new one is on the way. I guess soldering will have to wait a few days.

Smoke Simulation and the Make Human Project

Over Thanksgiving, I spent time back in Miami, where I grew up.  During that time I essentially took a break from everything… including projects.  However… I did find some interesting material regarding 3D that I made note of to try…

First, check out this tutorial on Blender Smoke Simulation!

I’m pretty impressed with the tutorial.  I need to try to make something that uses this sweet feature!

The 2nd thing is the Make Human project.  Essentially it’s a programmatic way of generating human meshes.  It turns out that I have a very important use of this project… In the first Little Robots animation, I need hands, arms and legs.  Hopefully I’ll be able to use this project for the initial meshes! It’ll save me a HUGE amount of time!