📜 ⬆️ ⬇️

DIY thermometer for Instagram on arduino nano

We continue to make useful and not very smart / smart / bluetooth devices on arduino. In previous articles, I told you how to make a bluetooth typewriter , a bluetooth voltmeter and a bluetooth remote for a TV , and today it will be about creating a more fashionable, but less useful device. This time allows you to post in instagram thermometer readings indicating the exact time and place of the temperature measurements made. At first I will show how it looks and works on video, and the detailed description will be already under the cut.


And this is how the measurement results in Instagram will look like:

Now I'll tell you about the design and wiring diagram. My bluetooth / instagram thermometer consists of:
Arduino Nano
Bluetooth module HC06
Temperature and humidity sensor DHT11
Arduino Nano
Bluetooth module HC06
Temperature and humidity sensor DHT11
In general, the temperature sensor can be used any of those that can be connected to the Arduino. For example, I tried to use DS18B20. The main thing is that under this sensor there was a library for arduino. And this is an ideal case if there is a ready sketch in the library, which sends the temperature values ​​to the serial port. Then you can use this sketch to transfer data via bluetooth module. It's all very simple, but just in case I will leave the wiring diagram and sketch for the DHT11 sensor, if someone wants to use it. Dht 11 library
sketch
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11 // DHT 11
DHT dht (DHTPIN, DHTTYPE);
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
dht.begin ();
}

void loop () {
delay (2000);
float h = dht.readHumidity ();
float t = dht.readTemperature ();
float f = dht.readTemperature (true);
if (isnan (h) || isnan (t) || isnan (f)) {
Serial.println (“Failed to read from DHT sensor!”);
return;
}
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 1) {
float hi = dht.computeHeatIndex (f, h);

Serial.print (“Humidity:„);
Serial.print (h);
Serial.print (“% \ t”);
Serial.print (“Temperature:„);
Serial.print (t);
Serial.print (“* C„);
}
}
}

')

With the “iron” part sorted out, now you can start writing android-application. The easiest way to do it is using the App Inventor 2 visual development environment for Android applications. It works from a browser, you do not need to install anything. Any Arduinsky will understand. The screenshot shows the list of elements used in the application, their location and some characteristics.

The application itself is also quite simple and looks like this:

The application consists of only 5 blocks, two of which (Listpicker) are responsible for connecting to one of the paired bluetooth devices. Screen1 runs only when the program is started, retrieving from the phone’s memory the MAC address of the last connected device, as well as starting to determine the location address of the smartphone. Clock1 is responsible for changing the readings of the stopwatch and checks whether new temperature information has been received. Button1 sends an Arduino request to update the information, if necessary.
Well, in conclusion about the appearance of the bluetooth / instagram thermometer. This device works on my balcony, so the impact of natural phenomena is not susceptible, and therefore the casing has nothing to do with it. Perhaps, if there is some simple solution for the casing, I will install it outside the window, but for now it looks like bluetooth / instagram Thermometer:

Well, the android application turned out like this:

PS For those who have never encountered the creation of applications in App Inventor 2, I made a video with a slightly more detailed description of the process of creating this application (you need to go to YouTube to view).

PPS Collection of more than 100 training materials on arduino for beginners and pros here
Online course on arduino to giktaimes here.

Source: https://habr.com/ru/post/253995/


All Articles