Skip to content
Menu
GeoSaffer.com
  • Shop
  • Support
GeoSaffer.com

Bluetooth Low Energy Thermometer

Posted on December 26, 2019June 26, 2020

You can create your own Bluetooth Low Energy Thermometer by just using a few components.

Some things you will need: 1. Arduino (Uno, Nano or Micro) We will be using the Uno for this demo.  

2. AT-09/HM-10 module  

3. DS18B20 thermal sensor

4. Some wires for connecting them (male to male, male to female and female to female)

5. a 4.7k resistor  6. an Android or iPhone

7. and finally the Arduino IDE  from Here  

Connecting all components

Connect everything up as shown in the diagram below, the connections are the same for HC-05 and AT-09

Required Libraries

Make sure to import the OneWire or 18b20 Library from Dallas Instruments

 

The Code to Run the project

Copy and paste the following code into your Arduino IDE or into the IDE of your choice  

// Include the libraries
#include <OneWire.h> 
#include <DallasTemperature.h>

// Data wire goes to pin 2 on the Arduino 
#define ONE_WIRE_BUS 2 

// Setup a oneWire instance
OneWire oneWire(ONE_WIRE_BUS); 

// Pass the oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

void setup(void) 
{ 
 // start serial port with a baudrate of 9600 
 Serial.begin(9600); 
 Serial.println("Temperature Demo started"); 
 // Start up the sensor library 
 sensors.begin(); 
} 

void loop(void) 
{ 
  //request temprature
 sensors.requestTemperatures(); 
 // get the first sensors data 
 Serial.print(sensors.getTempCByIndex(0));  
 // finalize the string
 Serial.println("\r\n");
 //wait for 1 second before it reads again
 delay(1000); 
} 

Click the Verify button  to make sure there are no code errors and if it’s successful Click the Upload.

When the upload is successful, the program will start running on the Arduino.

 

Testing

When the upload is successful, open your serial monitor by pressing “Ctrl+Shft+M” If everything is working as expected you should see an output on the serial monitor every second.

 

Connecting to your Bluetooth Device

Once you have verified that the Arduino is getting data from your ds18b20, you are ready to connect your phone to your Bluetooth Module.

Download our app from the Google Play Store.   Once the app is installed, connect it to the (AT-09) with your app by selecting the device from the list.

Once you have selected the device tap the connect button top right and it will connect to it and you should shortly start seeing the data updating on the app.

Categories

  • 3D Printing
  • Apps
  • Drone Footage
  • Electronics
  • Uncategorized
©2024 GeoSaffer.com | WordPress Theme by Superbthemes.com
Menu
GeoSaffer.com
  • Shop
  • Support