Figure 1 - The Measurment of Temperature and Humidty Circuit and Android Phone
HC Bluetooth Module
HC Bluetooth module has 4 pins to be connected to arduino, they are:- RXD : RXD will receive data from arduino
- TXD : TXD will send data to arduino
- VCC : VCC is the power supply (3.3V 6.6V)
- GND : GND is the ground
Figure 2 - HC 07 Bluetooth Module
You have to pay attention about the RXD level, some modules work with 5V, but this one works with 3.3V, and arduino TX will send a 5V signal, then it needs a voltage divider.
The formula above we have R1 = 1,2 K R2 = 2,2 K Vin = 5v.
Solving for Vout we get: Vout = 5 x 2,2 K / (2,2 K + 1,2 K ) = 5v x 2,2 K / 3,4 K = 3.24 V
Essentially, you can use any combination of resistors, as long as R2 is twice the value of R1.
If you do not have resistors handy, you can use a positive 3.3v voltage regulator. Connect the Input pin of the voltage regulator to the Arduino TX line, the Ground pin to the Arduino Ground and the output pin of the voltage regulator to the JY-MCU RX line.
DHT11 Sensor
DHT11 (Figure 3) digital temperature and humidity sensor is a composite Sensor contains a calibrated digital signal output of the temperature and humidity. Application of a dedicated digital modules collection technology and the temperature and humidity sensing technology, to ensure that the product has high reliability and excellent long-term stability. The sensor includes a resistive sense of wet components and an NTC temperature measurement devices, and connected with a high-performance 8-bit microcontroller.
If you do not have resistors handy, you can use a positive 3.3v voltage regulator. Connect the Input pin of the voltage regulator to the Arduino TX line, the Ground pin to the Arduino Ground and the output pin of the voltage regulator to the JY-MCU RX line.
DHT11 Sensor
DHT11 (Figure 3) digital temperature and humidity sensor is a composite Sensor contains a calibrated digital signal output of the temperature and humidity. Application of a dedicated digital modules collection technology and the temperature and humidity sensing technology, to ensure that the product has high reliability and excellent long-term stability. The sensor includes a resistive sense of wet components and an NTC temperature measurement devices, and connected with a high-performance 8-bit microcontroller.
Figure 3 - DHT 11 Temperature and Humidty Module
1 - the VDD power supply 3.5~5.5V DC
2 - DATA serial data, a single bus
3 - NC, empty pin
4 - GND ground, the negative power
Figure 4 - The Measurment of Temperature and Humidty Circuit
ARDUINO UNO Program
#include <DHT11.h> //DHT11 library
//Digital Pin defitantion
int pin=2;
DHT11 dht11(pin);
void setup()
{
Serial.begin(9600);//Serial Communication
}
void loop()
{
float nem,sicaklik;
int oku = dht11.read(nem,sicaklik); //reading datas on sensor
//Read Humidty and send to serial port
Serial.print(nem, 2);
Serial.print(",");
//Read Temperature and send to serial port
Serial.print(sicaklik, 2);
Serial.println();
delay(2000); // Wait 2 Second
}
int pin=2;
DHT11 dht11(pin);
void setup()
{
Serial.begin(9600);//Serial Communication
}
void loop()
{
float nem,sicaklik;
int oku = dht11.read(nem,sicaklik); //reading datas on sensor
//Read Humidty and send to serial port
Serial.print(nem, 2);
Serial.print(",");
//Read Temperature and send to serial port
Serial.print(sicaklik, 2);
Serial.println();
delay(2000); // Wait 2 Second
}
Basic For Android (B4A)
Android phone program is programing with the compiler "Basic For Android" . The android program name is BlueSay. BluSay 2.0 use the Bluetooth port for reading sensor datas.
Figure 5 - BlueSay 2.0 Program
Program Files
- Arduino Programı- SicaklikNem.ino
- Android Phone Program - BlueSay2.0.apk
- DHT 11 Library - DHT11.zip
Video of Lesson
Hiç yorum yok:
Yorum Gönder