Input devices for embedded systems are all around us from the keyboard to the mouse to sensors in our phones and fuel gauge sensors in our cars.In this week I will briefly describe what Input devices are some of the technologies used to interface input devices and finally differentiate between analog and digital input devices .For my assignment i will make use two sensors ,DHT 11 and Photocell or Light dependent Reseistors as input devices .Later in my output devices section I will use an LCD to display the sensor values .
Input devices to MCUs can be broadly classified as Analog or Digital sensors .Input devices can be sensors ,Buttons or any circuit thst produces a signal that is fed into a microcontroller .In contrast an output devices is a device that gets a signal from the MCU.
Input Devices Include (i) Light sensor (ii) Button (iii)DHT 22 for Temperature & Humidity
Various sesensors are interfaced with the MCUs in different ways .These include (i) Inter-inter connected Circuit I2C - BMP80 ,Accelerometers,Current and Voltage Sensors (ii) Serial Peripheral Interface SPI (iii)Universal Asynchronous Reciever Transmitter UART (iv)as Analog Devices -Light Dependent Resistors/photocell.Pressure sensors,Flowrate sesnors,Chemical sesnsors(PH) (v) As Digital Devices -DHT 11/22-Temperature and Humidity,Button ,Color Sensors(Although this can also be uses /viewed as an analog sensor. but when used to detect exact colors then it is considered as a Digital sensor.)
I will demonstrate Input devices using a DHT sensor and an LDR to measure Temperature and Humidity and Light Intensity .I will use the Arduino IDE serial interface to Read the sensor values and display them . The circuit Used here consist of a MCU and two sesnsors named above and a UART or serial interface that prints back the sensor values to the Screen Below is the simple schematic and its design using Eagle software.
For the Firmware of code running this setup You need to Download the Libraries required for the DHT 11/22 and also call the native arduino analog read APIs for the analog sensor.In addition You need also to calibrate the analog sesnsor values .Calibration is the process of adjusting the values you have read from analog sensors so they may make sense or correspond to the values you have read. First start by downloading the Adafruit Sensor Library in the Link https://github.com/adafruit/DHT-sensor-library . Then After downloading this Library import it into your Arduino IDE and then its now ready to be used.Please note that all the upcoming Libraries are to be added in the sme manner.
You can Download the Eagle Files and the Arduino Files and Libraries Below
Result: