BMP180 (Barometric Pressure Sensor) : Specifications
BMP180 (Barometric Pressure Sensor) : Specifications
Specifications
Once you have a temperature reading, you can take a pressure reading.
This is done with startPressure() and getPressure().
The result is in millibar (mb) aka hectopascals (hPa).
EXTAR:
If you want to measure altitude, you will need to know the pressure
at a baseline altitude. This can be average sealevel pressure, or
a previous pressure reading at your altitude, in which case
subsequent altitude readings will be + or - the initial baseline.
This is done with the altitude() function.
Hardware connections:
- (GND) to GND
+ (VDD) to 3.3V
(WARNING: do not connect + to 5V or the sensor will be damaged!)
You will also need to connect the I2C pins (SCL and SDA) to your
Arduino. The pins are different on different Arduinos:
Any Arduino pins labelled: SDA SCL
Uno, Red board, Pro: A4 A5
Mega2560, Due: 20 21
Leonardo: 2 3
In order to generate the ultrasound, you need to set the Trig on a High State for 10 µs. That
will send out an 8 cycle sonic burst which will travel at the speed sound and IN order to
generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send
out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the
Echo pin. The Echo pin will output the time in microseconds the sound waves travelled. it
will be received in the Echo pin. The Echo pin will output the time in microseconds the
sound waves travelled.
TEMPERATURE AND HUMIDITY SENSOR(DHT11)
Raindrop sensor is basically a board on which nickel is coated in the form of lines. It works on the principal
of resistance.
Rain Sensor module allows to measure moisture via analog output pins and it provides a digital output
when a threshold of moisture exceeds.
The module is based on the LM393 op amp. It includes the electronics module and a printed circuit board
that “collects” the rain drops. As rain drops are collected on the circuit board, they create paths of parallel
resistance that are measured via the op amp.
The sensor is a resistive dipole that shows less resistance when wet and more resistance when dry. When
there is no rain drop on board it increases the Resistance so we get high voltage according to V=IR.
When rain drop present it reduces the resistance because water is a conductor of electricity and presence
of water connects nickel lines in parallel so reduces resistance and reduces voltage drop across it.
SOIL MOISTURE SENSOR
The connections which are done for LCD are given below:
PIN1 or VSS to ground.
PIN2 or VDD or VCC to +5v power.
PIN3 or VEE to ground (gives maximum contrast best for a beginner).
PIN4 or RS (Register Selection) to PIN12 of ARDUINO UNO.
PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for
user).
PIN6 or E (Enable) to PIN10 of ARDUINO UNO.
PIN11 or D4 to PIN5 of ARDUINO UNO.
PIN12 or D5 to PIN4 of ARDUINO UNO.
PIN13 or D6 to PIN3 of ARDUINO UNO.
PIN14 or D7 to PIN2 of ARDUINO UNO.
PIN15 to +5V with 221-ohm resistor in series.
And the last PIN16 to ground.
The ARDUINO IDE allows the user to use LCD in 4-bit mode. This type of communication enables the user
to decrease the pin usage on ARDUINO, unlike other the ARDUINO need not to be programmed separately
for using it in 4 it mode because by default the ARDUINO is set up to communicate in 4-bit mode. In the
circuit you can see we have used 4bit communication (D4-D7).
First we need to enable the header file (‘#include <LiquidCrystal.h>’), this header file has
instructions written in it, which enables the user to interface an LCD to UNO in 4-bit mode
without any fuzz. With this header file we need not have to send data to LCD bit by bit, this
will all be taken care of and we don’t have to write a program for sending data or a
command to LCD bit by bit.
Second we need to tell the board which type of LCD we are using here. Since we have so
many different types of LCD (like 20x4, 16x2, 16x1 etc.). Here we are going to interface a
16x2 LCD to the UNO so we get ‘lcd.begin(16, 2);’. For 16x1 we get ‘ lcd.begin(16, 1);’.
In this instruction we are going to tell the board where we connected the pins. The pins
which are connected need to be represented in order as “RS, En, D4, D5, D6, D7”. These
pins are to be represented correctly. Since we have connected RS to PIN0 and so on as show
in the circuit diagram, we represent the pin number to board as “LiquidCrystal lcd (13, 12,
5, 4, 3, 2);”. The data which needs to be displayed in LCD should be written as “lcd. print
("hello, world!");”. With this command the LCD displays ‘hello, world!’.
MQ2 Gas/Smoke Sensor
MQ2 is one of the commonly used gas sensors in MQ sensor series. It is a Metal
Oxide Semiconductor (MOS) type Gas Sensor also known as Chemiresistors as
the detection is based upon change of resistance of the sensing material when
the Gas comes in contact with the material. Using a simple voltage divider
network, concentrations of gas can be detected.
First we need to set frequency of PWM signal and for that we should call “#include <Servo.h>” header
file, on including this header file in the program, the frequency gets set automatically and we get to use
some special conditions, which enables the user to enter needed position of servo directly without any
fuzz.
Now we need to define a name for the servo “Servo sg90sevo”, here ‘sg90servo’ is the name chosen,
so while writing for potion we are going to use this name, this feature comes in handy when we have
many servos to control, we can control as many as eight servo by this.
Now we tell the UNO where the signal pin of servo is connected or where it needs to generate the
PWM signal. To do this we have “Sg90.attach(3);”, here we are telling the UNO we connected the
signal pin of servo at PIN3.
All left is to set the position, we are going set the position of servo by using “Sg90.write(30);”, by this
command the servo hand moves 30 degrees, so that’s it. After that whenever we need to change the
position of servo we need to call the command ”Sg90.write(needed_position_ angle);”. In this circuit we
will have two buttons one button increases the position of servo and the other is for decreasing the
position of servo.
Ultrasonic Radar
ARDUINO
RADAR.docx
attachInterrupt():
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode) (recommended)
Parameters
Returns
Nothing
More details
Note
Inside the attached function, delay() won’t work and the value returned
by millis() will not increment. Serial data received while in the function
may be lost. You should declare as volatile any variables that you modify
within the attached function. See the section on ISRs below for more
information.