HASHEM JOUCKA

Projects

HTML tutorial

Output Devices

  • Date: February 19

Assignment: Add an output device to a microcontroller board you've designed and program it to do something.

For this weeks assignment, controlled a micro servo motor with light via a photoresistor and Fabduino. I will seize this opportunity to test with the code and hence utilize it in my Final Project.

What I've Learned:

- I found it a bit confusing to connect the servo to the Fabduino. Apparently this is common. The black wire is ground in most servos. The one next to it is connected to the vcc and the last one is connected to the microcontroller pin.

- Check the power requirements of the servo. The micro servo I'm using requires less than 5v to operate. You might need an external power source to power a bigger servo with more torque

If you're Fabricating your own Fabduino, These tips might help:

- Try to use thick lines when designing the Fabduino. Thin lines might be too fragile and hard to solder. Tips on soldering SMD microcontrollers are found "here" .

- If a copper trace was removed while milling (especially the traces for the microcontroller), its usually because the lines drawn on eagle are too narrow for the tool. Try to use thicker lines of possible. If its not possible, and the problem occured after fixing the files, try to perform a micro-surgery where you link the microcontroller pin to the trace with solder.

- After milling, if some traces were not neat, you can use another piece of copper board to sand the trace flat. Make sure to be gentle when doing this. Consult your tutor.


Code:

#include

Servo myservo;

int val;

void setup()

{

myservo.attach(7);

}

void loop()

{

val = analogRead(0);

val = map(val, 0, 1023, 0, 179);

myservo.write(val);

delay(15);

}

Click here to download Schematic

Click here to download Board