WEEK 13

INPUT DEVICES




Build a board with one or more input devices and program it




For this assignment, students were asked to realize a new board with one or more input devices, connected with final project. Since my final project needs sensor to survey the temperature and the proximity of people, I decided to use Ultrasonic Module HC-SR04 Distance Sensor. First of all, I gave a look to the ATTINY45 datasheet and to the HC-SR04 Distance Sensordatasheet.


I started opening Autodesk Eagle and to open a new schematic. I have added all the components I need:


1. Attiny 45
2. Resistor 10kOhm
3. Capacitor 1 uF
4. Ftdi header connector
5. ISP connector
6. Ultrasound sensor module HC-SR04



For the HC-SR04 eagle component, I have found the lbr file for Eagle.





Then, I worked on the board, by fixing the traces from the Eagle autoroute and testing the best positions for all components.




Schematic file Board file Traces PNG Cutout PNG

Here is the board before soldering components.






Here is the board after soldering components.






Before programming this board, I thought it was a good idea to try my input with a Arduino UNO and load a simple sketch with Arduino IDE. There are plenty of tutorials about that. I followed this one. In order to obtain accurate surveys about the distance, I need also the temperature of the room. I also thought that in my final project I can connect the temperature input to the ultrasound sensor calibration. After loading the .ino sketch, I opened the serial monitor and I started to get the distance between the sensor and myself. Even if the datasheet refers that this sensor can work from 1 to 400cm, I didn't succeed to get accurate surveys beyond 200cm, maybe due to not correct settings.






I connected the board with the Atmel AVR mkII programmer, and opened the terminal. I used the Neil's files: Makefile and .c file.