This week I decided to make ATMEGA 328 board.
Some of the Features of ATMEGA 328 are
I designed ATMEGA 328 board in EAGLE. The design files are available here
The schematic diagram of the circuit is given below
In the fab library in EAGLE there is no ATMEGA 328 IC . So I used ATMEGA 88 having same pin configuration as that of ATMEGA 328
This is for the first time I manually routed my board . The traces of the board near the ATMEGA 328 pin are made 14 mil instead of 16 mil in order to optimize the clearance. But this procedure made my pcb soldering very very difficult. But I was having no other option.
The mill trace and cut trace are given here
After milling only I could realize the problems in my board routing . The main problem is the ground and vcc lines are very much close. Next time I have to be more careful.
I edited the cut trace in gimp.
Roland MDX 20 Milling Machine is used for milling . The screen shots are given below
I used 0.4 mm bit for milling. So I selected 1/64 trace.
I used 0.8 mm bit for cutting. For that I selected 1/32 cut trace
The final milled pcb is obtained,but holes were not made by machine because the diameter of the holes which I designed were less than 0.8mm ie 1/32 mil.
The Soldering process was difficult because the traces were minute,next time I decided to go for a better design.
In order to connect an LED and PIR sensor I have designed a breakout board which has red led and 499 ohm resistor
The schematic and board screenshots are provided above.It can be seen that there is a provision for led,resistor,pin header thats all.This circuit makes the job simpler.
The mill trace and cut trace of the breakout board is given above.
The Design files for Breakout board for PIR sensor are available
Finally it has been milled in modella machine ,the screenshots for milling process and cutting process is given above.
milling and soldering process for the breakout board is finished.
In order to ensure that my board is working properly I just wrote a program to blink an LED(I used RGB LED).
open the terminal window from the folder containing
the blink file and the make file .Run the command
$ make program-usbtiny
The make file is given in the figure below
The output obtained is given below.
I have written a program which will detect the presence of motion and turn on the RGB led.
There are multiple variables that affecting the Pyro Motion Detector input and output.The PIR sensor itself has two slots in it, each slot is made of a special material that is sensitive to IR. The lens used here is not really doing much and so we see that the two slots can 'see' out past some distance (basically the sensitivity of the sensor). When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected.
PIR sensor detect only bodies (hot materials and living objects) in motions not the static ones. This sensor uses Infra red beam to detect the motion and only covers a certain space based on the sensor model, This sensor module gives only two output states that is logic High 1 which is equivalent to 3.3 V and logic low 0 equivalent to 0 V.So connect the output of the PIR sensor to a digital input pin,and connect GND and VCC to the microcontrollers GND and VCC respectively.For more details visit the page here
The programming concept I used is simple ,digital pin PC0 is connected to the output of PIR sensor and PD3 is connected to the RGB led .When a motion is detected PCO pin will be high,which in turn will turn on the LED.
The program and the make file used are
The connections are made using the breakout board and the hero shot is provided in the figure below.
Finally when the motion is detected the LED is turned on and if no motion it will be off.