Sunday, August 28, 2011

PICAXE 18M2 Robotic Hand [Complete]

Using a PICAXE 18M2 uC, five servos, a few resistors and some random 'stuff' around the house, we built this robotic hand. Then we wrote some software to control the hand. Hardware wise, an input line on the PICAXE is held HIGH via a 10K ohm pull up resistor. This input line is pulled LOW upon pressing the red Normally Open button. While the PIXACE waits for a button press it happily generates random numbers that are associated with gestures the hand has been programed to perform. At the press of the red button the PIXACE uses that random number to call a gesture routine.

Here is a pic of the front of the hand. The toggle switch turns the rig on and off. You can also see the red button mentioned above. Note there are three servos mounted on the front side of a piece of plexiglass; two on the backside.
-----
This pic of the backside of the hand shows the two other servos. Wiring to the PICAXE is straightforward, but there are a lot of wires due to all the servos. Note the audio jack. That is actually a programming jack that allows you to download different software routines into the PICAXE and change the robot's personality.
-----
You may have notice a soft blue glow under the platform that holds the robot hand. We rescued a blue LED from something we had around the house. When the rig is powered on (5.25VDC) this blue LED glows.

-----
The video below shows the rig in action on a few gestures. Like I said before, these come up randomly. Here is what we got:
-----
The awesome site HackaDay.Com featured the hand before we were complete.
-----
I'll send the source code to anyone that is interested in seeing it.
-----

Saturday, August 20, 2011

Robot Hand Mimics Real Life Hand


PC webcam image monitored by program written in RobotSee. The image is processed and the appropriate subroutine is called upon recognition. The RobotSee program then outputs to the ColdFire uC to control five servos on a toy robotic hand to mimic the webcam image.
-----

Wednesday, August 17, 2011

VistaQuest VQ1005 Controlled by TI MSP430 LaunchPad

We show you how.


There are a lot of things about the TI MSP430 that I like. First of all, the price from TI is crazy cheap at $4.30!!! Hats off to TI for making their development kit so inexpensive that anyone who even wants to casually experiment with micro-controllers can do so. Even though it only cost $4.30, the MSP430 LaunchPad is a very capable micro-controller and the free SDK (Code Composer Studio) used to program the MSP430 is nice as well.

Long ago I broke open a VistaQuest VQ1005 and used a 555 timer to snap pics automatically. I wanted to replace the 555 timer with the TI MSP430 LaunchPad because 1) it would allow more programmable control over the delay between pics and 2) the additional I/O on the MSP430 would allow me to get around the VistaQuest VQ1005 wanting to go to sleep after 60 seconds on inactivity.

The integration of the VistaQuest VQ1005 to the MSP430 LaunchPad is one that is cheap and easy given some guidance. If you are looking for a uC project to get your feet wet, this hack is sure to work and will cost less than twenty bucks if you watch for deals on the VistaQuest VQ1005. By now almost every household has an old digital camera around, so it's easy to substitute an old 'free' camera for the VistaQuest VQ1005 if you want. The integration concept to the MSP430 LaunchPad is the same.

First, get a TI MSP430 LaunchPad from here and a VisaQuest VQ1005.

They will look like this:
----

If you don't know which is the MSP430 LaunchPad and which is the camera then you can stop reading now...

The first thing I did was solder header pins to the Vcc, GND, P1.5, and P1.7 "holes" on the MSP430 LauchPad. We are going to be connecting wires from the camera to those places. If you want, you can just solder the wires from the camera straight into the holes, but the header pins will allow you to unplug the camera from the MSP430 LaunchPad if you ever so desire.

Next open up the VistaQuest VQ1005. This is easy. You will remove four small screws on the outside case. Once inside you will see two PCB boards. The trigger board (the board that presses the button to take the pic) looks like this:


See the red circle labeled "T"? Solder a thin wire to that location. This is the trigger wire that will ultimately be connected to P1.5 on the MSP430 LaunchPad. We are going to use the MSP430 to bring this wire LOW (zero volts) to take a pic. Don't worry, the code to do this and more pics are below to help you with this.

Now we want to remove the VistaQuest VQ1005 "ON/OFF" control PCB. This is the same PCB that holds the camera lens and is attached with two small screws. Remove the screws and remove the PCB. See the red circle labeled "O" in the pic below? This is the "ON/OFF" control point. Solder a wire to that point. This wire will ultimately connect to P1.7 on the MSP430 LaunchPad. We are going to use the MSP430 to bring this wire LOW (zero volts) to make sure the camera is ON and ready to take a pic. Again; don't worry, the code to do this and more pics are below to help you with this.


Put the VistaQuest VQ1005 camera back together. It's as simple to put together as it was to take apart. Be careful not to pull off the wires you just soldered to the two PCBs. Depending on how you route your wires you may have to make a notch or two in the camera case.

We are almost done. See the pics below to guide you through how to connect up the VistaQuest VQ1005 to the MSP430. As you can see, I powered the whole operation with two AA batteries (3VDC). The one nice thing about the LaunchPad is that it has a USB port input that you could use to provide the power for the project. Basically, you would remove the two AAs and use your USB port to power the rig.

The pic below shows the (T)rigger wire from the VistaQuest VQ1005 attached to the MP430 LaunchPad P1.5 output pin. Also, the +3VDC power from the two AAs connected to the Vcc header pin we soldered to the MSP430 LaunchPad.
---
Below is a shot of the (O)n/(O)ff control wire from the VistaQuest VQ1005 attached to the MSP430 LaunchPad P1.7 output pin. You can also see the black wire that goes to the NEG terminal of the 3VDC AAs. Note that at the bottom right I have used the Vcc and GND header pins that were already on the MSP430 LaunchPad to power the VistaQuest VQ1005 camera. These wires simple go to the "+" and "-" place on the VistaQuest VQ1005 where the battery would connect. BTW, I know the VistaQuest VQ1005 uses one 1.5VDC battery to power it and we are pushing 3VDC into it. Don't worry about that, the VistaQuest VQ1005 has the smarts to handle this.

---
Below is a pic of the two AAs that provide the 3VDC power. The battery pack is held onto the MSP430 LanchPad with Velcro.

---
In the end it should all look something like this:
---
We tested on location where our cats relax in the sun. We used the 1000+ images that the rig took and made this short video:

---
Let us know if you give this a try and what your results are. Good luck, have fun. Please reference www.WhiskeyTangoHotel.Com if you found this useful.

Oh, one more thing... The code below makes it all happen.

The code flashes the red LaunchPad LED during camera power up.
The code flashes the green LaunchPad LED when a pic is taken.
The code alternates flashing the green and red LED as it waits to take the next pic. The LEDs alternate more rapidly as the VistaQuest VQ1005 gets closer to taking the next pic.

Modify it if you want.

////////begin MSP430 Code//////////

// This program interfaces the MSP430 Laucnpad uC dev board
// to a VistaQuest VQ1005 Digital Keychain Camera.
// This allows to camera to take picutes at pre-defined intervals
// automatically without any manual interaction.

// Cost: MSP430 Launchpad: $4.30 from Texas Instruments
// VistaQuest VQ1005: $5-10 from Walmart, eBay, etc

// Developed at: www.whiskeytangohotel.com / August 2011 / Open Source, use and modify

#include msp430g2231.h

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= BIT0; // Set Red LED (P1.0) to output direction
P1DIR |= BIT6; // Set Green LED (P1.6) to output direction
P1DIR |= BIT5; // Set Camera Trigger (P1.5) to output direction (Low is Take pic)
P1DIR |= BIT7; // Set Camera ON/OFF control (P1.7) to output direction (active LOW)

volatile long i; // General loop var
volatile long j; // General loop var

volatile long d; // d is delay between pics
d = 15000; // set the value of d per guidelines below
//d = 10000; about 15 secs between pics
//d = 15000; about 35 secs between pics
//d = 20000; about 60 secs between pics
//d = 40000; abput 4.5 mins between pic
//increase d for longer delay between pics

P1OUT |= BIT5; //need to start with tigger high (because LOW triggers camera

for (;;) // Start of Endless Loop
{

P1OUT &= ~(BIT0 + BIT6); // both LEDs off

P1OUT &= ~BIT7; // Force low to turn on camera
for (i=0; i<5 data-blogger-escaped-br="br" data-blogger-escaped-i="i"> { // Delay some while camera 'boots'
P1OUT ^= BIT0; // Flash/Toogle Red LED while 'booting'
for (j=0; j<2000 data-blogger-escaped-br="br" data-blogger-escaped-j="j"> } //

P1OUT |= BIT7; // Return camera control to High
for (i=0; i<5 data-blogger-escaped-br="br" data-blogger-escaped-i="i"> { // Delay some just 'because'....
P1OUT ^= BIT0; // Flash/Toogle Red LED while delaying
for (j=0; j<2000 data-blogger-escaped-br="br" data-blogger-escaped-j="j"> } //


P1OUT &= ~(BIT0 + BIT6); // both LEDs off

// Blink the Green LED to show a pic is being taken
// and allow some delay for disk write, etc.
P1OUT &= ~BIT5; // Drive Trigger signal low to take pic
for (i=0; i<100 data-blogger-escaped-br="br" data-blogger-escaped-card="card" data-blogger-escaped-delay="delay" data-blogger-escaped-etc.="etc." data-blogger-escaped-i="i" data-blogger-escaped-pic="pic" data-blogger-escaped-process="process" data-blogger-escaped-save="save" data-blogger-escaped-sd="sd" data-blogger-escaped-some="some" data-blogger-escaped-to="to"> {
P1OUT ^= BIT6; // Blink the Green LED
for (j=0; j<2000 data-blogger-escaped-br="br" data-blogger-escaped-j="j"> } // end Green Blink/delay for pic
P1OUT |= BIT5; // return tigger to high (because LOW triggers camera)

P1OUT &= ~BIT0; // Turn off Red LED and
P1OUT |= BIT6; // Green LED ON to set up for alternating Red/Green flash rountine below
// The loop below alternates the LaunchPad Green/Red LEDs; speeding up until pic is taken
// Time between pics is define by the value of "d" set above

for (j=1; j {
P1OUT ^= BIT0 + BIT6; // Toggle LEDs
for (i = 1; i<(d-j); i++); // A decreasing delay to make LEDs alternate faster until trigger
} //end loop that alternates the LaunchPad Green/Red LEDs


} // end of endless loop
} //main

-----

Tuesday, August 16, 2011

Earth Core Hexapod Robot


-----

CatScan Robot Hi-Tech Cat Toy w/PICAXE28 uC


-----

MSP430 uC to Toy Tank


---
The goal was to learn how to program and interface the MSP430 microcontroller with a toy tank and make it drive autonomously in a square after a button is pressed. The project demonstrates simple control of two DC motors (output) and the ability to process a button press (input) with the MSP430. There was no goal to create a pretty robot and I guess I got that done as well. ;)

The material list:
$12.00 toy tank,
$4.30 TI MSP430 LaunchPad,
$2.50 SN754410NE Quad Half H-Bridge

The program is written in C and uploaded into the MSP430 via the Code Composer Studio 4.1 software.

Get your own MSP430 LaunchPad micro controller here for only $4.30.

A few early build pics:
Original Tank (with AirSoft cannon)
---
Here it is five minutes later...
---
The remote control was removed from the tank. The motor wires were hooked straight into the motor driver chip that was controlled by the MSP430 LaunchPad.
---
Below is the source code for the project:
=================
//MSP430 rogram to make tank drive in a square after button push. June 11, 2011
//After the square is complete the tanks waits for a button push to repeat process.
#include msp430g2231.h

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= 0x01; // Set P1.0 to output direction
P1DIR |= 0x40; // Set P1.6 to output direction

volatile long i;
volatile int j;

// RED LED in RIGHT motor. GREEN LED is LEFT motor

P1OUT = 0x41; // Stop motors (both LEDs ON) and
while ((P1IN & 0x08)); // wait for button press on P1.3


for (;;)
{

for (j=1; j<5 data-blogger-escaped-br="br" data-blogger-escaped-j="j"> {
P1OUT = 0x00; // RIGHT and LEFT OFF 'FORWARD'
for (i=0; i<100000 data-blogger-escaped-a="a" data-blogger-escaped-br="br" data-blogger-escaped-delay="delay" data-blogger-escaped-i="i" data-blogger-escaped-little="little">
P1OUT ^= 0x40; // LEFT ON (turn LEFT)
for (i=0; i<20000 data-blogger-escaped-a="a" data-blogger-escaped-br="br" data-blogger-escaped-delay="delay" data-blogger-escaped-i="i" data-blogger-escaped-little="little">
P1OUT =0x00; // Both OFF
for (i=0; i<50000 data-blogger-escaped-a="a" data-blogger-escaped-br="br" data-blogger-escaped-delay="delay" data-blogger-escaped-i="i" data-blogger-escaped-little="little">
} //end J loop

P1OUT =0x41; // Stop motors (both LEDs ON) and
while ((P1IN & 0x08)); // wait for button press


} //endless loop
} //main
-----

Multiple MSP430 Launchpad


-----

Another Useless Machine Build


-----

The "Ouchie" Box


-----

Perspective


-----

Installing an "always ON" Cigarette Lighter Port


-----

Auto Timer Bathroom Deodorizer Flamethrower


-----

Simple DIY LED Desk Lamp


-----

E-Flite Blade MCX RC Helicopter Charger Mod


-----

Cheap DIY Video Camera Pan Mount


-----

Potato Cannon ChairHit


-----

Time Lasped Antworks Ant Farm


-----

Simple Electric Motor


-----