Assignment
- Measure something: add a sensor to a microcontroller board that you have designed and read it.
- Demonstrate workflows used in circuit board design and fabrication
- Implement and interpret programming protocols
- Described your design and fabrication process using words/images/screenshots.
- Explained the programming processes you used and how the microcontroller datasheet helped you.
- Explained problems and how you fixed them
- Included original design files and code
This week's assignment is to built a Input Devices using sensor. I selected "Motion detector sensor" as the input device. A motion detector is a device that detects moving objects, particularly people. A motion detector is often integrated as a component of a system that automatically performs a task or alerts a user about motion in an area.
There are five technology in motion Sensor technology
- Passive infrared (PIR)
- Microwave
- Ultrasonic
- Tomographic motion detector
- Video camera software
Here I used Passive infrared (PIR) sensor.



Passive infrared sensors are sensitive to a person's skin temperature through emitted black body radiation at mid-infrared wavelengths, in contrast to background objects at room temperature. No energy is emitted from the sensor, thus the name "passive infrared" (PIR). This distinguishes it from the electric eye for instance, in which the crossing of a person or vehicle interrupts a visible or infrared beam.
Output: Digital pulse high (3.5V) when triggered (motion detected) digital low when idle (no motion detected). Pulse lengths are determined by resistors and capacitors on the PCB and differ from sensor to sensor.
Sensitivity range: up to 20 feet (6 meters) 110 degrees x 70 degrees detection range
Power supply: 3.3V - 5V input voltage.
And also I started to design my Hell.HC-SR501 board using Eagle software.





Here, I used a PIR motion sensor. PIR stands for Passive InfraRed. This motion sensor consists of a fresnel lens, a infrared detector and supporting detection circuitry. The lens on the sensor focuses any infrared radiation/wavelengths present around it towards the infrared detector. Our bodies generate infrared heat and as a result this gets picked up by the motion sensor. The sensor outputs a 3.5V signal for a period of one minute as soon as it detects us. It offers a tentative range of detection of about 6-7 m and is highly sensitive. The output from the sensor (3.5V) is used to trigger a high signal to ATtiny45 pin no. 3 (Pin 4). ATtiny45 pin no. 7 (Pin 2) is the out put of the circuit, that is connected to the computer. The output is displayed using a Graphical user interface (GUI).
I made the design files and milled it using Modela and soldered the components properly.



Program
I downloaded Mr. Neil's hello.HC-SR501.c Program and hello.HC-SR04.py Program and made some changes into it.
hello.HC-SR501.c
Code Changes: I don't change anything in the program.

First we have to burn the program for that, Open terminal from the program folder. Type the comment as shown :
$ sudo make program-usbtiny

Now Attiny is programmed. Next step is to program the GUI.
hello.HC-SR04.py
Code Changes: I changed the program code in Mr.Neil "hello.HC-SR04.py" program as shown below :

I changed the color code and output window size in python script for changing my GUI color for motion detection.
Code:- from "#b00000" (Red) to "ff4500" (Orange red)
- From "#0000B0" (New Midnight Blue) to "006400" (Dark Green)
Mr.Neil "hello.HC-SR04.py" program Graphical user interface (GUI) output.

After my Change "hello.HC-SR04.py" program Graphical user interface (GUI) output.

Download my design files:
Download Programming file :