Arduino powered quadruped

October 31, 2012 1 comment

I’ve been meaning for a while to design a quadruped robot and I finally decided to get to work. As soon as I get my hands on some servos the build will commence. Here is a rendering of how I hope it will turn out. The frame and legs will be built out of PCB fiberglass with the copper etched off or out of laser cut plexiglass. Power will be supplied by a 2S 7.4V 1000mA Li-poly battery. The design is for 12 micro-servos which I hope I’ll get from hobbyking.com in the near future.

As soon as I get around to it, I’ll post the Arduino PCB shield schematics and board in Eagle.

Categories: AVR, electronics

Car alarm remote control repurposing

October 27, 2012 1 comment

A while ago, I got hold of a car alarm unit and its two remote control fobs. When i hooked it up to 12V I realized that it didn’t  work, not responding to any of the commands from the two fobs even though their batteries were OK. Naturally, I opened up the unit to start harvesting parts and noticed the RF module within (the one that sticks out perpendicularly ) and I figured it shouldn’t be too hard to use the module with an Arduino.

Basically, my code uses pulse in to see whether incoming pulses are longer than 1000 microseconds and if a pulse is longer than that I consider it a ’1′ and if it’s not, a ’0′. So it constructs a string called ‘codein’ about 75 characters long and then it searches for 25 character pre-defined strings within it (using the substring command) , to see whether a button has been pushed on one of the remotes. If a button push has been recorded then it prints out which one over the serial connection. Oh, and I was lucky and discovered that each remote delivers different codes, meaning that I am able to remotely control 8 channels.

To figure out which codes you need to pre-define for your buttons you can un-comment the lines which display the incoming string. So here’s the code:

// RF module receiver code for Arduino.
// The module is connected to the Arduino havin 3 pins: +5, GND and data. The data pin is connected to
//digital pin 11 on the arduino.

int inpin = 11;
 int onoff = 0;
 int i=0;
 String codein="00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";

//there are about 100 zeros in the initial codein

unsigned long duration;
 void setup()
 {
 Serial.begin(9600);
 Serial.println("setup");
 }

void loop()
 {

for (i = 0; i < 100; i++) {

duration = pulseIn(inpin, HIGH);
 if (duration > 1000)
 {
 codein.setCharAt(i,'1');
 }
 else {
 codein.setCharAt(i,'0');
 }

}
 Serial.println(codein); //uncomment these two lines to figure out your remote codes
 delay(1000); // this is the second line
 for (i=0; i<75; i++){
 if (codein.substring(i,i+25)=="0010100111000110001010000") // substitute remote codes here
 { Serial.println("lock!!!"); if (onoff == 1){onoff = 0;} else {onoff = 1;} // LED toggle on/off
 break;
 }
 if (codein.substring(i,i+25)=="0010100111000110001001000") // and here
 { Serial.println("unlock!!!");
 break;
 }
 if (codein.substring(i,i+25)=="0010100111000110001000100") //and here
 { Serial.println("mute!!!");
 break;
 }
 if (codein.substring(i,i+25)=="0010100111000110001000010") // you get the idea :) 
 { Serial.println("ring!!!");
 break;
 }

if (codein.substring(i,i+25)=="0010010110111101111001000")
 { Serial.println("lock2!!!");
 break;
 }
 if (codein.substring(i,i+25)=="0010010110111111111000100")
 { Serial.println("unlock2!!!");
 break;
 }
 if (codein.substring(i,i+25)=="0010001001011011111111100")
 { Serial.println("mute2!!!");
 break;
 }
 if (codein.substring(i,i+25)=="0010010010110111111111000")
 { Serial.println("ring2!!!");
 break;
 }
 }

// this toggles the 13 pin led on or off
 if (onoff == 1) {
 digitalWrite(13,HIGH);
 delay(1000);
 }
 else { digitalWrite(13,LOW);
 delay(1000);}
 }

 

Arduino controlled motorcycle tachometer

July 1, 2012 4 comments

I found a smashed Kawasaki dash in the dump. The speedometer was destroyed, but the tachometer was OK. The first thing I did was connect the tacho to 12v. It had three contact points marked IGN, GND and an unmarked one. I figured that IGN was +12V and the unmarked one was the signal input. So I powered up the tacho and flicked a 12V wire on the unmarked contact. Surprisingly it started indicating about 3000 revs.

I then Google’d a way to output a +12V square wave with the Arduino and I found this:

The next thing I did was hook everything up on a breadboard to test it out:

Using a potentiometer I varied the delay in microseconds for the off time of the signal used to drive the tacho.

I had to fiddle a lot with the Arduino program. I figured out that because I had inserted a Serial.println(val); to print out the value of the delay I was using to modify the signal was adding a bit of a delay. The next thing to be done is to receive some data over the serial port and display it on the tachometer.

Categories: AVR, electronics Tags: , , ,

Finally, I own an oscilloscope!

March 2, 2012 Leave a comment

After a long wait (my whole life), I was able to buy my very own oscilloscope. It’s the DSO 203 (quad). Momentarily, I’m very pleased with it, even though I haven’t used it a lot ( i got it this week), only for basic testing with its own wave generator and some PWM signals from a motor controller. Later this week I hope I’ll have some time to hook it up to my car ignition system because it’s an electronic ignition system to figure out a way to interpret the engine speed for data-logging. Sadly, I only received a single probe but i found MCX connectors on  tme.eu so I’ll be able to DIY my own logic probes at least, or if I get my hands on a BNC probe, changing the connector shouldn’t be too difficult.

DSO quad oscilloscope

The DSO 203

Before the DSO I used the sound card oscilloscope and made my probes with the help of ladyadas’ tutorial and managed not to damage my sound card. The software I used was written by Christian Zeitnitz and it was free. Still, I wanted more mobility and precision because with the sound card scope you need to drop the voltage down to a maximum of 1.5-2V and voltage spikes can damage the sound card.

I bought the Quad from diyertool.com for 200$ including express delivery being the cheapest one I could find. Shipping from Hong Kong took only three days (over the weekend). I was very pleased with that to say the least. Definitely worth the shipping cost.

The DSO looks quite well built, I chose the one with the black aluminium casing and it seems sturdy and worth the money. I recommend it to anyone in need of a cheap, portable and versatile oscilloscope.

Hello world!

March 1, 2012 Leave a comment
Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.