Author Archive

Coop door opener update.

Here are some pictures of my coop door opener. Its coming along… slowly. So far I have built the winch assemboly, the motor driver and the light sensor. I have some code done, but I’ve been having issues with using the Arduino Time Library without syncing time. Here are some pictures of the build.

I’m really happy with the BBB freeduino I’m using for this project. But I think next time I’ll just make a custom ‘Roboduino’ pcb.

Here is a schematic if you’re interested.

This is the motor driver wiring.

The light sensor uses a photocell and a 330 Ohm resistor.

Here is the actual winch that will pull the cable that lifts the door. Its built from a cd-rom drive, legos, and plywood.

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.

Return top