Assignment 10
Input devices
in this week i'm going to make an input device "LDR"
First : PCB
first i used neil's board :


then i designed my own board, here's the boards :


all design files available here
in this design i used parts from the following libraries : (01_sparkfun.lbr , fab.lbr , ng.lbr ) you can easly download them from here
Design stages:
components :
* attiny 45 "from fab library"
* AVR ISP SMD "from fab library"
* FTDI connector "from 01.sparkfun library"=>"M06SMD"
* photo transistor "from fab library"
* 3 resistors 1206 "from ng library"
* 1 capacitor "from 01_sparkfun library"
* 1 LED 1206 "from ng library"
designing the bard:
"use" command to add the libraries:

"add" command to add the required components:




to make the schematic easier i used the lables
all you need to do is name the line, then eagle will ask you if you want to connect each line with the same name

after that put it a lable :

and here's the schematic after editing :

after that in alligning the board i found that i connected the FTDI cable in a wrong polarity

so i returned back to the schematic

now after editing it looks like this :

and here's the final schematic :

now it's time to draw traces in the board, here's the final traces:

after that we draw the boarders :

then export the top layer in monochrome and 500 dpi
editing the canvas size using gimp :

here's the final result :


milling the board








Then : soldering

after soldering:

after soldering i started uploading the C code
after uploading the code it didn't work, so i started debugging by writing an arduinoC code
which is available here :
#include <SoftwareSerial.h> SoftwareSerial mySerial(1, 2); // RX, TX int val; void setup(){ pinMode(A3, INPUT); mySerial.begin(9600); } void loop(){ val=analogRead(A3); mySerial.print("Reading ="); mySerial.println(val); // mySerial.print(val); }
but it didn't work! after many tries i found that the problem is in my FTDI cable, where i was using a 3.3v cable. i'm supposed to use a 5v cable

so, after using the right cable it worked on the arduino serial monitor and putty
after that i tested the code with term.py and finally it worked :)
