Week 10

Input Devices

Objectives

Individual Assignment
Measure something: add a sensor to a microcontroller board that you have designed and read it.

Group Assignment
Probe an input device(s)'s analog and digital signals
view page

Learning Outcomes
Demonstrate workflows used in sensing something with input device(s) and MCU board

Individual Assignment

Input device is a piece of hardware equipment used to provide data and control signals to an information processing system such as a computer or information appliance. Examples of input devices include keyboards, mouse, scanners, digital cameras and joysticks.
In this week we need to design a PCB with a Sensor and Vishualize the data to a computer.So for my final project PCB I need a sensor to monitor human presence , so I choosed an Ultrasonic sensor.



In my project the ultrasonic sensor is used to monitor the presence of human within a area. If there is a human within the confined area, then the reflected wave will reach the receiver side of the sensor.

ULTRASONIC SENSOR (HCSR04)

The HC-SR04 ultrasonic sensor module uses sonar sound to determine distance to an object like bats do. It offers excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package. From 2cm to 400 cm or 1” to 13 feet. Its operation is not affected by sunlight or black material (although acoustically soft materials like cloth can be difficult to detect). It comes complete with ultrasonic transmitter and receiver module.


Pins
  • VCC: +5VDC
  • Trig : Trigger (INPUT)
  • Echo: Echo (OUTPUT)
  • GND: GND
Features
  • Power Supply :+5V DC
  • Quiescent Current : 2mA
  • Working Current: 15mA
  • Operating Frequency : 40KHZ
  • Effectual Angle: 15°
  • Ranging Distance : 2cm – 400 cm/1″ – 13ft
  • Resolution : 0.3 cm
  • Measuring Angle: 30 degree
  • Trigger Input Pulse width: 10uS
  • Dimension: 45mm x 20mm x 15mm
datasheet :- https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf

How Does it Work?
The ultrasonic sensor uses sonar to determine the distance to an object. Here’s what happens:
  1. the transmitter (trig pin) sends a signal: a high-frequency sound
  2. when the signal finds an object, it is reflected and
  3. the transmitter (echo pin) receives it.
The time between the transmission and reception of the signal allows us to know the distance to an object. This is possible because we know the sound’s velocity in the air . (Source :- https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/)

PCB Designing

For designing the PCB circuit I used AUTODESK EAGLE. I used ATtiny44 as the microcontroller, I also included a 2x2 Pin Head for I2C communication for future so that I can use this same board for Embedded Networking and communication week.



Change the design rule. Follow the steps in Week 6 - Electronics Production

Then I arranged the components to obtain the board circuit



Then I exported the board circuit as PNG file.






PCB Milling

For milling the traces and outline of the circuit board, I imported the PNG files to mods









Soldering

I then picked up the required smd components from the lab invetory.



I soldered all the smd components to the board.



I then connected the board to my PC and checked if it works.





Luckily the board worked!!!!


Programming

Program to measure the distance on arduino.


Then I wrote a program to identify human presence within 10cm and 30cm, because it is a part of my final project.