Wednesday, 21 December 2016

2.1 Hardware Set up

2.1 Hardware set up


2.1.1 Schematic diagram 




Figure 4





2.1.2 Arduino microcontroller 


This  indicates  that  the  codes  written  for  the  microcontroller can  be  loaded  on  to  Arduino  Uno  using  USB  cables,  which are  easier  to  carry  and  deal  with.  As  seen  in  the  figure,  the Arduino Uno is powered using ATmega328P microcontroller. The circuit board has a convenient power management which allows  the  input  voltage  up  to  12V.  The  built-in  power regulatory  mechanism  then  permits  the  regulation  of  this voltage  into  5V  and  3.3V.  The  power  can  be  supplied  by connecting  an  adapter  to  the  external  power  supply  or  to computers  (or  other  devices)  using  a  USB  cable.  The  figure clearly represents the existence of 14 digital I/O pins as well as  6  analog  I/O  pins.  These  pins  are  the  circuit  board’s medium  of  communication  to  external  devices.  Apart  from these  features,  Arduino  Uno  accommodates  32KB  flash memory for the storage of programs.

Figure 5





The power pins are as follows:
· Vin. The input voltage to the Arduino/Genuino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
· 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
· 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
· GND. Ground pins.
· IOREF. This pin on the Arduino/Genuino board provides the voltage reference with which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the 5V or 3.3V.

Memory
The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output
See the mapping between Arduino pins and ATmega328P ports. The mapping for the Atmega8, 168, and 328 is identical.
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode()digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.


In addition, some pins have specialized functions:
· Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
· External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
· PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
· SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.
· LED: 13. There is a built-in LED driven by digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
· TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.

There are a couple of other pins on the board:
· AREF. Reference voltage for the analog inputs. Used with analogReference().
· Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.








2.1.3 External circuit

Figure 6
LCD was placed at the center of the box




 Figure 7
Dot board with complete circuit is placed after LCD 



Figure 8
LED's and BUTTONS is attached to the circuit 



Figure 9
Arduino Uno



Figure 10
Arduino Uno with signed source code is being attached to the dot board




Figure 11
MQ2 gas sensor




Figure 12
MQ2 gas sensor is placed inside small box 




Figure 13
Complete MQ2 gas sensor




Figure 14
Complete prototype