Probe an input device(s)'s analog and digital signals.
Document your work (in a group or individually)
Individual Assignment:
Measure something: add a sensor to a microcontroller board that you have designed and read it.
Learning Outcomes:
Demonstrate workflows used in sensing something with input device(s) and MCU board.
Steps in General:
Step(1): Designing the circuit on KiCAD
Step(2): Preparing the png files on Gerbv and GIMP
Step(3): PCB Fabrication, Assembly and Soldering
Step(4): Circuit Programming and Testing
Introduction
In this week I decided to design a board that supports the ultrasonic sensor in order to measure the distance between the US sensor and an object. The used equation here is that distance = Velocity * Time, as we know the air velocity is 320 m/s, so if it is multiplied by the time of sensing it will generate the actual distance between the sensor and the object.
Steps in Details:
Step(1): Designing the circuit on KiCAD
I imported the components into the KiCAD Shematic and did the wiring as shown
In the PCB Layout, I routed all the traces on the top layer and drawed the board outline.
Finally, I exported the Gerber files of the top and outline layers.
Step(2): Preparing the png files on Gerbv and GIMP
I used Gerbv to export a .pdf file which includes the top layer and the outline in one file and in black color.
Then, I used GIMP tp export .png file for the top (traces in White with black background) and .png file for the outline (Outline in Black with White background)
Step(3): PCB Fabrication, Assembly and Soldering
I used the Fab Modules and the MonoFab milling machine to fabricate the PCB, we have learnt how to produce a PCB in the Electronics Production week.
I prepared the needed components as follows,
Component
Description
QTY
ATTINY45
IC AVR MCU 4K 10MHZ 8SOIC-
1
Ultrasonic Sensor
HC-SR04.
1
609-5161-1-ND
6 Positions Header Connector 0.100" SMD
1
311-10.0KFRCT-ND
RES 10.0K OHM 1-4W 1% 1206 SMD
1
FTDI Connector
6 row SMD connector
1
445-1423-1-ND
CAP CER 1UF 50V X7R 10% 1206-
1
I soldered all the components from the centre to outside.
Step(4): Circuit Programming and Testing
I used the USBasp to program the circuit, I conncted it through the ISP connector.
Uploaded the code in Arduino IDE and did the compiling
It is important to make sure we select the ATtiny45 as Board and processor, Internal 16 MKz Clock ,the USBasp as programmer, and the correct port.
I uploaded the code to the board by using the "Upload Using Programmer"
I connected the bard to the FTDI cable and coneccted it to my laptop.
I selected the port (here is COM4)
I started the Serial Monitor and began moving my hand in front of the sensor to read different distances.
Here is a video of this operation.
Group Assignment
In this assignment we are going to probe the analog and digital levels of input devices. We choose the microphone module and PIR sensor for this assignment.
Probing analog levels of a microphone module: We used the oscilliscope to probe the analog ouput pin of the microphone module. When someone talks near the microphone, the below waveform is observed on the oscilliscope.
Probing digital levels of a PIR sensor: We used the oscilliscope to probe the digital ouput pin of the PIR sensor. When a motion is detected the digital ouput is observed to be HIGH then after a while it turns off to the default state of level LOW.