Input Devices

Introduction

In this week we are introduced to various input devices and sensors, and we are going to measure something by adding a sensor to a microcontroller board reading its output.






Water Sensor

For the second sensor i chose is the water sensor. Water sensor is designed for water detection, which can be used in sensing rainfall, water level, and even liquid leakage which can be used in many different projects. The sensor board has several copper traces on it that are not connected and are bridged by water when available.The more of the traces that are bridged by water the easier current can pass. Keeping in mind that water is not conductive, it’s actually the minerals and impurities in water that makes it conductive.
The connection here is straight forward as the S pin is connected to any analog pin. As water is detected, a greater value will be displayed. Code worked well and water droplet was detected.
Downloads

Keypad

For the first input i chose a sixteen-button keypad. Keypads allow users to input data while a program is running. They are a great way to let users interact with their projects, it can be used to navigate menus, enter passwords, and control games and robots etc..
The hardware of this keypad is quite thin and can easily be mounted wherever needed. The connection was simple where the 8 pins from the keypad were connected to digital pins 3 to 10 respectively. I installed the “keypad.h” Arduino library and used the code and only changed the pins used. Code ran smoothly and successfully where i was able to try all 16 inputs and were displayed on the serial monitor.
Downloads


Final Project Input Devices

GP20U7

Since my final project requires tracking the drones, I chose the GPS to read the location using the arduino microcontroller, which will also be used later in the board i designed during the Electronic Design week.
  1. First i installed the GP2U07 library on arduino.
  2. Then i connected the GP2U07 to the arduino.
  3. I uploaded the code from the installed library.
  4. I got an error and that was because during uploading the code, the RX pin was connected to the GPS, it is because the RX and TX pins are being used by the USB to serial converter, so I upload the code while disconnecting the RX pin and after that i reconnected the RX pin to start reading the location.
  5. In order for the GPS to start reading, i need to go out and it might take a while to produce results. Results were then out and were compared to google maps and turns out to be successful.

Downloads









Barometric Pressure BMP180

For my final project, i will be needing a reliable way to check the altitude during the drone flight to send alerting messages if it exceeds the approved level.The hardware of this sensor is very tiny and thus recommended since it won't use much space. The connection is very simple, i used it with my final project PCB:
  • SCL to PC5 pin
  • SDA to PC4 pin
  • VDD to VCC
  • Connect GROUND to common ground
To use this sensor and calculate the altitude and barometric pressure, there's a lot of very complicated and unpleasant math, that is found in the datasheet, luckily this is all summarized and wriiten in a nice Arduino library. I installed the “Adafruit_BMP085_U.h” which is compatible with the current version of my sensor Arduino library and used the code. We know that pressure drops as we gain altitude (that's why air is so thin on mountain-tops) we can compute the current altitude knowing the pressure and temperature. Calculating altitude with reasonable accuracy requires pressure, sea level pressure for the position at the moment the data is converted, as well as the ambient temperature in degress celcius. Usually the sea level hPa have a 'generic' value of 1013.25hPa can be used defined as "SENSORS PRESSURE SEALEVELHPA" from "Adafruit Sensor.h" library, but this isn't ideal and will give variable results from one day to the next.A more accurate value can be taken from the local Aviation Meteorology NCM for UAE in my case. The main concept behind the altitude calculation is using the hypsometric equation, there is also an online link that can calculate whenever the input is found, Calculator, which is also shown in the screenshot on the left.
Downloads




PCB microcontroller decision

In the Electronic Design Week, I was able to design and fabricate Attiny44 PCB and explored the features and limitations compared to Atmega328p on an Arduino Uno. The Attiny 44 isn’t quite powerful enough, but it is a great option for running simple Arduino programs, it’s small, cheap and relatively easy to use.There are fewer pins, meaning that I can’t connect as many components as i need especially if i encounter problems in the future and needed to add extra components which is the case in any project. Ofcource if it is a simple project that requires only a few simple inputs and/or outputs, an ATtiny44 would be perfect.
For my final project, the choice of input and output devices greatly influenced my decision of the microcontroller, which is the Atmega328p. Since all devices i chose had libraries in Arduino, it made it easier for me to modify the codes based on my requirements. Also when it comes to testing, i can use the same code with arduino and pcb whenever needed.
In the Electronic Design Week, Board number 2 was the initial version of my final project pcb, i also explored Flatcam instead of Fabmodules for exporting Gerber files. However, things didn't go well with the FT232RL, which is why i replaced it with FTDI in the last version that is shown in my Final Project Page.




Group Assignment

For this task, we need to probe an input device(s)'s analog and digital signals.I chose to use the input device for my Final project which is the Pressure Sensor BMP180. I uploaded the code and monitored the results and checked the Current and Voltage on the multimeter, and the voltage again but on oscilloscope.


Experience

A very intresting week since i got the chance to explore different input devices and try the available sensors and test the functionality of them and take the readings. Of course i wasn't able to try all sesnors but i'm sure i will whenever i get the chance.