Arduino/Android - Bluetooth HC-06 Module - DHT11

Arduino/Android - Bluetooth HC-06 Module - DHT11 © CC BY-SA

Hello world! Today I made an app to read any text or value from the serial monitor to your Android phone, You can use any sensor.

  • 11,582 views
  • 1 comment
  • 7 respects

Components and supplies

About this project

Hello world! Today I made a app to read any text or value from the serial monitor to your Android phone, you can use any sensor that displays values or text.

YOU CAN ADD ANY CODE! NO NEED TO CHANGE THE CODE OF APP!

The app simple reads the text written to the Arduino serial monitor and displays it using the HC-06 Bluetooth module. You don't need to setup anything in the Arduino code to connect to the APP, you simply connect the Bluetooth module to the TX & RX pins on Arduino, upload any code and the app should display the value/text that is written to the serial monitor.

I simply used a example code from The DHT library. YOU NEED THE DHT Library!

Step 1: Parts List & APP

Connect everything like the schematic and it should work. Make sure to connect the HC-06 Bluetooth module to 3v. Also make sure not to have the Bluetooth connected when uploading the code!

And make sure you add RXD from the HC-06 to TX on Arduino, and TXD from the HC-06 to RX on the Arduino.

Parts List.

  • Arduino Uno. Any copy will do! I use the RobotDyn Uno.
  • HC-06 Bluetooth Module
  • DHT11 Temp & Humidity Sensor.
  • Jumper wires Set MM/FF/MF
  • Android Phone, and of course the app!

Good luck!

Get the app on GOOGLE PLAY. Follow the next step on how to rename your HC-06. This is optional!

Step 2: How to change the name of your HC-06

What is needed?

How to connect the Programmer?

  • VCC to VCC
  • GND to GND
  • RXD to TX
  • TXD to RX

Lets get started...

  • Connect the USB TTL programmer to the HC-06
  • Plug in the USB and open up the Arduino IDE
  • Open the serial monitor.
  • Type "AT" without quotes. You should see a respond in the Serial monitor saying "OK"
  • Type "AT+NAMExyz" Sets the module name to “xyz” (Replace xyz with the name you want.) Response should be OKsetname.
  • Type "AT+PIN1234" Set the pin to 1234 (replace 1234 with your desired pin) respond should be OKsetPIN For more info on changing baudrate etc. I included a PDF file. Good luck!

Code

Android_Arduino_DHT11_Temp_sensor_and_Android_APP.inoArduino
#include "DHT.h"

#define DHTPIN 2     // what digital pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11   // DHT 11
//#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  Serial.println("BlueCore Tech Temperature and Humidity");

  dht.begin();
}

void loop() {
  // Give it time to calibrate
  delay(20000);

  
  float h = dht.readHumidity();
  // Read Celsius
  float t = dht.readTemperature();
  // Read Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);

  // Check errors
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Compute heat index in Fahrenheit (the default)
  float hif = dht.computeHeatIndex(f, h);
  // Compute heat index in Celsius (isFahreheit = false)
  float hic = dht.computeHeatIndex(t, h, false);

  Serial.println("Humidity: ");
  Serial.print(h);
  Serial.println(" %.");
  Serial.println("  ");
  Serial.println("Temperature: ");
  Serial.print(t);
  Serial.println(" Degrees ");
}

Schematics

Schematic
Dht11%20temp%20meter%20%26%20android%20app bb

Comments

Similar projects you might like

Arduino/Android - BLUETOOTH Multi Servo Motor Control

Project tutorial by Danny van den Brande

  • 34,047 views
  • 13 comments
  • 51 respects

DHT11 Humidity + Temperature Sensor with 16x2 LCD display

Project showcase by onatto22

  • 55,829 views
  • 14 comments
  • 59 respects

Bluetooth Controlled Light Switch

Project showcase by The Instrumentation Crustaceans

  • 33,561 views
  • 5 comments
  • 29 respects

Security System Using Arduino Bluetooth Camera

Project tutorial by amrmostaafaa

  • 30,326 views
  • 16 comments
  • 43 respects
Add projectSign up / Login