Input Devices

During this assignment, I am at Home dut to COVID-19, so I am tried online simulation tool. When I have get lab access then I will try it on actual hardware.

Week Task

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 analog levels and digital signals

Introduction

An input device responds to changes in the environment and produces a suitable electrical signal for processing in an electronic circuit. In all input devices, other forms of energy are transformed into electrical energy.The sensor is an element that produces signals relating to the quantity that is being measured. According to Instrument Society of America, “a sensor is a device that provides usable output in response to a specified quantity which is measured.” The word sensor is derived from the original meaning ‘to perceive.’
Sensors are devices that perform input function in a system as they ‘sense’ the changes in a quantity. The best example of a sensor is mercury thermometer. Here the quantity that is being measured is heat or temperature. The measured temperature is converted to a readable value on the calibrated glass tube, based on the expansion and contraction of liquid mercury.

Criteria to Choose a Sensor

The following are certain features that are considered when choosing a sensor.
Type of Sensing: The parameter that is being sensed like temperature or pressure.
Operating Principle: The principle of operation of the sensor.
Power Consumption: The power consumed by the sensor will play an important role in defining the total power of the system.
Accuracy: The accuracy of the sensor is a key factor in selecting a sensor.
Environmental Conditions: The conditions in which the sensor is being used will be a factor in choosing the quality of a sensor.
Cost: Depending on the cost of application, a low cost sensor or high cost sensor can be used.
Resolution and Range: The smallest value that can be sensed and the limit of measurement are important.
Calibration and Repeatability: Change of values with time and ability to repeat measurements under similar conditions.


A Brief Introduction to Smoke Sensor

There are two types of smoke detectors. Optical or Photoelectric smoke detectors and Ionization smoke detectors.
Optical smoke detectors consists of a light source like LED and a light detector like photocell. The photocell conducts as long as the light falls on it. When there is smoke, the light from the source is interrupted and the photocell doesn’t conduct.
Ionization smoke detectors consists of two electrodes and an ionization chamber filled with ions. When there is no smoke, the ions move freely and the electrodes conduct normally. In the presence of smoke, the chamber is filled with smoke and interrupts the movement of ions. The electrodes do not conduct anymore. Depending on the type of sensor and manufacturer, the conductivity conditions may change but the idea remains the same.

Individual Assignment

The task for the week is to measure something: add a sensor to a microcontroller board, that we have designed and read it. Here in India, the Govt. of India is announced the Lockdown of 21 days. As per the schedule of Fab Academy, the assignment number 8,9 & 10 is between this period. I am at home, so i dont have lab acessed for this assignment right now. So i am trying to connect the sensor on arduino board on TinkerCad software and read it using serial monitor.Here i am trying three different sensor in TinkerCad 1. Smoke sensor 2. PIR (motion) sensor 3. Light Sensor. In my final project i am using smoke sensor. so i have develop the board for the smoke sensor module using ATtiny 44 IC in Eagle software. When i went to lab, then i will develop the board on milling machine and assembling the all components and in an actual i will read the data.

Group Assignment

The task for the week is to probe an input device's analog levels and digital signals. For analog levels we use temperature sensor and for digital levels we use ultrasonic sensor.The sensor is connected with oscilioscope for signal levels. For more details about group task click here

Smoke Sensor with Arduino Board

The smoke sensor is connected to Arduino board. The sensor has 6 pin on two side. 3 pin from one side is connnected to power. From other side, one pin is connected GND and two are signal pin. One is analog signal and other is digital signal. Analog pin is connected to A0 analog port on Arduino board.


H -Pins: Out of the two H pins, one pin is connected to supply and the other to ground.
A-Pins: The A pins and B pins are interchangeable. These pins will be tied to the Supply voltage.
B-Pins: The A pins and B pins are interchangeable. One pin will act as output while the other will be pulled to ground.


The code is generated for the sensor using the command. The reading of the sensor is printed on the serial monitor.


Then start the simulation. The reading of the sensor without smoke is shown.


The reading of the sensor when high intensity smoke is in contact with the sensor.


The reading of the sensor when less intensity smoke is in contact with the sensor.


Here is the video of connection and simulation.



PIR Sensor with Arduino Board

A passive infrared sensor (PIR sensor) is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view. They are most often used in PIR-based motion detectors. PIR sensors are commonly used in security alarms and automatic lighting applications. PIR sensors detect general movement, but do not give information on who or what moved. For that purpose, an active IR sensor is required. PIR sensors are commonly called simply "PIR", or sometimes "PID", for "passive infrared detector". The term passive refers to the fact that PIR devices do not radiate energy for detection purposes. They work entirely by detecting infrared radiation (radiant heat) emitted by or reflected from objects.
There are the 3 pins are given to sensor. One is power, second is ground and third is signal. LED is also connected to the board. When the object is detected, the LED will blink.

8

The code for LED blinking when the object is detected is as follows.


Now start the simulation. The LED is blinking here wuth the motion of the object is detected by the sensor.


Here is the video of connection and simulation.



Light Sensor with Arduino Board

The light sensor is a passive devices that convert this “light energy” whether visible or in the infra-red parts of the spectrum into an electrical signal output. Light sensors are more commonly known as “Photoelectric Devices” or “Photo Sensors” because the convert light energy (photons) into electricity (electrons).
Here the photoresistor sensor is connected to the Arduino board.


The value for the resistor is as follows.



The code is generated using the command in software. The reading of the sensor is displayed on the serial monitor.


Now the simulation is start. The reading of the sensor is displayed on serial monitor when there is no light.


As the intensity of the light is change, the reading for the sensor will get change.



Here is the video of connection and simulation.



Design of Smoke Sensor Board

For final project, i have required smoke sensor, to sense the smoke get exhausted from the burning of fuel in kitchen for cooking. When the sensor sense the smoke, it will gives signal to the microcontroller and fan of the chimeny will get start. The smoke from the kitchen will get exhausted to the outside. So here i am trying to develope the board of smoke sensor. I am using smoke sensor module, so the 4 pins are provided on the board to connecte the module. ATtiny 44 IC is used for the board. The Eagle software is used to design the board.The connection of the in Eagle software is as belows. The schematic of the PCB is as follows:


The final board design with its components used are shown below.



Now I am went to the lab from 22 June and start working on the project work. Firstly I am milling this input board on SRM-20 milling machine. The design of the board from the eagle software firstly exported as a png file. The this png file is converted into rml file using fab mods (details about this procedure is given in my assignment 5 and 7). Then the rml is loaded to the machine for trace and cut the PCB.

Snow
Snow
Snow


Component Selection and soldering

Following are components used on the board with its specification:
1. ATtiny 44 IC which VCC and GND pin and 12 input/output pin -01 Nos.
2. 7805 Regulator IC for to convert 9V supply of battery to 5V supply to board- 01 Nos.
3. Smoke sensor module of MQ-2 Series- 01 Nos.
4. Resonator 20M - 01 Nos.
3. 06 Pin Connector for bluetooth model - 01 Nos.
4. 6 pin header - 01 Nos.
5. Capacitor 1uF- 01 Nos.
6. Resistor (For capacitor)10 KOhm - 01 Nos.
8. Resistor (For LED) 5V/0.025A=200 Ohm But in 499 Ohm resisitor is available - 01 Nos.
9. 4 Pin connector for output- 01 Nos.
10. 4 Pin connetor for smoke sensor connection- 01 Nos.
11. 3 pin connector for input connection- 01 Nos.
12.3 pin connector for LED connection - 01 Nos.
The above component is soldered on the PCB. The smoke sensor is connected by wire to the board and the final board is here. One jumper wire is connected for VCC, because during milling, when I am giving the cut file for outer border cutting, it has cut the one path of the board.So need to used wire.


Datasheet and Connection of MQ-2 Series Smoke Sensor

The MQ-2 smoke sensor can detect or measure gasses like LPG, Alcohol, Propane, Hydrogen, CO and even methane. It have analog and digital pin which makes this sensor to operate even without a microcontroller. When it comes to measuring the gas in ppm the analog pin has to be used, the analog pin also TTL driven and works on 5V and hence can be used with most common microcontrollers. Here we use analog pin for connection with ATTINY 44 MCU board. The MCU board read the analog values (0-5V), this value will be directly proportional to the concentration of the gas to which the sensor detects.
For more details about the MQ-2 Series Smoke Sensor clicke here for Datasheet
The following wiring diagram shows the connection between smoke sensor and MCU board


Pin Configuration for smoke sensor module
Vcc: This pin powers the module, typically the operating voltage is +5V
GND: Used to connect the module to system ground
Digital Out: You can also use this sensor to get digital output from this pin, by setting a threshold value using the potentiometer.
Analog Out: This pin outputs 0-5V analog voltage based on the intensity of the gas.

Programming and Testing of board

Now this is some what hard task to me, to solve all the error, while programming in board, I have decided to go firstly for simple blinking code for the board and then we will read the sensor and print it on serial monitor. What will the error I came while programming, lets discusss it.
Firstly I open the Arduino IDE, the open the File>Example>Basic>Blink. The basic blink code will get open, changed the pin number of LED. The open the Tool menu and following parameter will selected.Now I am sharing what problem error I am facing during programming


1. USBtiny Not Found: Now I am clicked on Compile the code(the compling is done), then click on uploading. the following error will shown. When I connected USBtiny with input board and connected to Laptop and following above process but this error is showing. Then I have remove it and put in another USB, again the same error is will showing.



2. rc-1: By using the USBtiny, I have tried the programming, again goes for compling and uploading. But now the another error is showing i.e. rc-1. I know that, this is a hardware error, I ahve already checked the conductivity of the board now again I have checked it. conductivity is ok so I decided to check the soldering and also fill the some material at soldering point.


Again the same error is showing, so when I was discussed with my instructor, he is tell me to check the conductivity from USBtiny IC to Input board IC. I have done it, the conductivity is ok. again I have checked for soldering, whether there is any short circuit. Again properly doing the soldering and checked it. (this process will taken completely one day). Now the success will come and done the uploading.


3. include expects "FILENAME" or < FILENAME > : Now I have to read the smoke sensor so I have taken one of the code sensor reading from internet, edit it as per required. I have to print the reading on serial monitor so added the required command into the programm. Now checked for compling the code but again the next error is showing i.e. include expects "FILENAME" or


Now I am added the file name i.e. Softwareserial.h file but again the error showing i.e. No such file or directory.


So firstly I have to add this liabrary. I have searched it on the internet for software serial liabrary> it will get to me on github. Then copied the given link from the liabrary page


Click on File>Preference>paste the link here (for to add liabrary)>click OK



Checked for liabrary whether it is successfully added or not?


Now again trying for compling and uploading the code. Ohh code get successfully upload



Now connected TX pin of the board with RX pin of arduino and RX pin of the board with TX pin of arduino for printing the sensor value on serial monitor. Click on tools> serial monitor. The printing will get start successfully


The final video of testing is here



<

What i learn?

I am learn about
1. Simulation of circuit in TinkerCAD software.
2. Electronics Board design.
3. Circuit making using Eagle Software.
4. Programming to the board.
5. Troubleshooting in Microcontroller Board.
6. Reading sensor value on serial monitor.

Download my original file here

Go to the top