Help arduino + Bluetooth + temp control

Hello everyone
This is my first time using app inventor im trying to make apo that change values in my arduino code
I have a code that trigger a relay depends on the temperature it work fine when the temp becomes 25 the relay triggered to on
What i need is very simple i want to change the value of the temperature that triggers the relay using app inventor
Here is my code
Im using arduino nano and ds18b20 and hc06

I don't see any Bluetooh in your arduino code?

Hello Tarek

Actually, the relay is triggered on if the temperature is 26 or more, triggered off if the temperature is 25 or less. Are you measuring human temperature?

If you are going to use an App, the values sent to the Serial Monitor, via a mini usb cable, are temporary, for testing purposes? If not, then you need to add SoftwareSerial.h for receiving the new temperature value from the App.

How have you set-up the HC-06 on the Nano?

1 Like

Hello again Tarek

For the App, see the attached Basic BT Setup Project. I have added a +/- input for the temperature value to be sent.

BT_Basic_Setup_SendVal.aia (8.5 KB)

1 Like

yes i dont know how to pass from app inventor to Bluetooth but im going to use something similar to this one
Received =;


if (light_state == 0 && Received == '1')
if (light_state ==1 && Received == '1')

First of all, ty very much for helping me, I appreciate that!
I am measuring the aquarium temperature and the relay triggers the water heater. Iā€™m in a country where we don't have access to any good quality heaters, so the cheap heater could literally cook my fish! So, I want to control that from my Arduino.
I did connect my heater when the relay in low stat so when the temp is over 26 the heater should shut down. The thing that I want to accomplish with the app is to modify the temp that triggers the relay without changing the code through my pc, I want to change that using my mobile app.

Hi Tarek

The basic AI2 project I have uploaded should set you on your way App-wise.

The Nano is probably not the first choice board for this task. Have you got it working with the HC-06?

The current Sketch code will not deliver accurate temperature values because the sensors need a bit of time to settle but they are disrupted by the use of Delay() . There is an easy fix for that however.

You might consider having a Dot Matrix Led Display and Buzzer, since you would not have your phone by the fish tank 24/7 and a power cut or power surge will affect the water temperature.

ty again chris
the hc-06 work will with nano i tested it using this code

i found on youtube tutorial
and it work fine
and this is the app for it Controller1_copy.aia (2.3 KB)

So are you good to go?

will to be honest no i dont know how to use the app you send to me with my code but im trying to figure it out