Assignment 4
Input Output Devices
Sensors in Mobile
- Proximity sensor- detects how close the device is to a particular target
- Motion sensor- Detection of change in orientation by measuring optical change in target field of view
- Ambient light sensor- Detects intensity if light in environment and adjusts brightness in device
- Moisture sensor- Detects when device is in contact with water
- Gyroscope- Detcts movements along six rotational axes
- GPS- Determines location of cell phone and sends/receives location data
- Face ID- facial recognition sesnor helps in unclocking the device
- Barometer- sensing air pressure and altitude measurements.
Google Science journal
Here are a few experiments performed with Google science journal app on mobile phone-
-
Sound Intensity- A song was played and volume was increased in steps. The increaseing peak in graoh corresponds to increasing volume recorded by mic in phone.
-
Pitch- is recorded in hertz. Device was placed near a speaker and it recorded peaks in the sound played.
-
Magnetometer- Device was placed near sources of magnetic field (speaker, LCD monitor etc.)
-
Accelerometer- Device was shaked continously and continous motion is captured in curve below.
-
Compass- Device is rotated cyclically and effect is captured in curve below.
-
Brightness- Sensor is covered from top and brigtness drops to -4.8 EV.
-
Barometer- Pressure is constant and won't change much with minor changes in height. Hence, it's constant.
-
Accelerometer- Device is moved along 3 directions of movement.
Social Distancing Device
For input output project, I am choosing to make a simple social distancing detector which can be used portably (if there's DC power source to connect other than laptop). In this project, ultrasonic sensor detects distance of object behind/in front and if distance is less than 100cm (1m), LED starts blinking. Here's the steps fow to get started-
- Connect Ultrasonic sensor, arduino, LED as per given in following circuit diagram
-
Install SR-04 library in arduino sketch tab and upload the following sketch-
-
After uploading the sketch, check the connections and set serial monitor baud rate to 9600
-
Here's a snapshot of serial monitor displaying real time distance data from HC SR-04-
- As the distance of object varies, the LED blinks accordingly. One major drawback as of now is that it can detect any non human object too and calculate the distance if it is in vicinity of SR-04. However, with this setup it can be used in queues and counters to maintain sufficient distance.