Archive for January, 2010

Ohms law

I bought Make: electronics ebook from the app store yesterday and haven’t been able to put it down. Ever wonder why you have to put a resistor on your LED? or WTF a resistor actually does? This book answers all those “But why?” questions. The first of the basics this book covers is resistance.

A week ago I was asking “k, wtf is an ohm?” Now I know it’s just stupid maths. This is the formula for calculating resistance(Ω), voltage(V) and current measured in amps(I).

  • V=(I*Ω)
  • I=(V/Ω)
  • Ω=(V/I)

So an example of figuring out voltage lost through resistance would be like so: Say you have a wire that has a resistance of .6Ω resistance and you need to run 12 amps through it. Due to the resistance you’re going to lose some voltage.  So what we know is Ω=.6 and I(amps)=12 so your equation will need to be V=(12*0.6) which happens to be 7.2 V.

What would the implications of this be? Serious, if you’re using a 9v battery you’re going to be cut down to 1.8v. That is why car battery wires are really thick, to lessen resistance.

Another example of Ohms law would be an LED with a proper power supply. If your LED reccomends you use 3v at 12mA and you have a 9v battery, which resistor should you pic? V in this equation stands for the difference in voltage between the battery and the LED. So you take 9-3=6. We’ll need to trim 6V. And the amperage we’re looking for is 12 miliMmps or .12 amps. So the math would look like this:

  • Ω=V/I or Ω=6/.12 or 50Ω

The resistor you’ll need is a 50Ω to properly light this made up 3v 12mA LED with a 9v battery.

Anyway, this is more for me than anyone. Enjoy.

Arduino Motor Control With L293D

I’ve done a lot of digging regarding Arduino motor control without the 20$ motor shield. I’ve come up with a lot. It might seem like a lot of work at first but is really not all that complex.  You’ll need some capacitors 470uF and .1uF, motors and a motor driver like the L293D. I use this driver from SparkFun.

This instructable will show you a way that works, and a way that really works to drive DC motors.

http://www.instructables.com/id/Control-your-motors-with-L293D-and-Arduino/?ALLSTEPS

If you’re still wondering why one way works better than the other I highly suggest you read this article on power regulation and pick up the caps and diodes.

Chicken Coop Door Code

I’ve been writing the code for my arduino controlled chicken coop door. This is what I have so far:

// Troy Watson Arduino Powered Chicken Coop Door
// Waits for the sun to come up, turns a servo to open a drawbridge then waits and closes the bridge.

#include <Servo.h>

Servo servo0;  // create servo object

int sensVal = 0;  // analog pin used for light sensor
int rotateDeg = 1080;    // number of degrees to lower drawbrigde
int darkVal = 55;

void servoUp()
{
servo0.write(rotateDeg); //tells the servo to turn out the winch
}

void servoDown()
{
servo0.write(-1*rotateDeg);  //writes the servo to turn back up?
}

void setup()
{
servo0.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop()
{
if (sensVal > darkVal){                      // duh
delay(360000);                         // waits 6 minutes
if (sensVal > darkVal){                // checks the sensor again to make sure its really the sun not just some retard in the neighbors driveway
servoDown();                     // lets door fall open gracefully
delay(43200000);                 // waits 12 hours.
servoUp();                       // pulls door back up
}
}

}Download it here.

CyberClean® — “Just Press and Pull!”

I got a free sample of CyberClean® at CES on saturday and must say its pretty cool stuff. It’s somewhere between lysol and flubber but definitely cleans the gunk out of the dark, nasty orifices of your gadgets.  The guy demoing the stuff grabs my iPhone and rams it in the back hatch with this ball of yellow gel while chanting his mantra “Just press and pull, as easy as that. Removes dust and dirt, not only dust and dirt, but also germs, kills germs on contact. Just push and pull, don’t rub.”

I was skeptical of the claims of germ killing power until I looked up a few of its ingredients on wikipedia:

I’m impressed. This stuff really works. Just as advertised it pulled all the dirt, dust and hair out of the bottom port of my iphone with ease. It sure beats a q-tip and scrubbing. And it’s fun to play with.

Return top