Help with App Inventor Problem with Max6675

This might not be your bug, but you should remove those 2 extra empty sockets from your text JOIN block in the lower right corner of your blocks image.

Oh yes, done

In your sketch, you use variable luefterstatus (0 or 1) to eventually control the turbo through a pin.

But that variable is affected by three separate processes:

  • incoming BT traffic (A/B)
  • BUTTON_ON_PIN and BUTTON_OFF_PIN
  • thermocouple bound checking.

So your data traffic effect has to run a gauntlet before it has a chance to affect anything.

I just started with this topic last week and had absolutely no idea until then. I have read a lot from morning until late at night and tried a lot of things on video. It is very difficult for a beginner to understand some things directly. The turbo buttons worked but the sketch was configured differently. I just can't get the buttons to work correctly. But more important is that the Max6675 can send data to the app, so as I described above.

may be unlikely to get one either with that attitude !

It is quite possible that no-one else who specialises in Appinventor, has sought to build an app that relies on bluetooth, an arduino e2sp32, a Mosfet520 and a Max6675. Perhaps you should also ask on the forums that specialise in those objects as well?

1 Like

danke für die schnelle Antwort

My last comment was really not okay, for that I would like to apologize to everyone here on the forum. I just started a few days ago and spent many hours learning about Arduino and the App Inventor. I read and tested late into the night to find a solution to my problem. Maybe it's my own disappointment with me that made me behave so stupidly. Once again, apologies to all, I hope you can forgive me.

2 Likes

No worries. Keep trying here, someone may be able to help.

1 Like

Your blocks, which are in German, are undecipherable by me. I'm looking at these blocks and I don't know what is what.

Hi, the blocks I first sent are no longer up to date. I can now control the date, time and a fan with an app I made with App Inventor and it all works without problems. I would like to send the temperature data from a Max6675 to this app. I would like to control the fan from the app via temperature. That is, one variable value to turn off and one to turn on, for example at 55 degrees on and at 70 degrees off. I need a working sketch and the right blocks for the app inventor. I have tried many variations with no success.

I forgot something important, all this should be sent via Bluetooth. The Max6675 is connected to an esp32 just like the fan. I have already managed that the Max sends the temperature to the Arduino monitor.

#include <BluetoothSerial.h>

#include <SPI.h>

#include <max6675.h>

#include <MAX6675.h>

// Pin für den Lüfter

const int fanPin = 13;

// Bluetooth-Objekt erstellen

BluetoothSerial SerialBT;

// MAX6675-Objekt erstellen

int thermoDO = 19;

int thermoCS = 23;

int thermoCLK = 18;

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

void setup() {

  // Serielle Kommunikation starten

  Serial.begin(115200);

  // Bluetooth initialisieren

  SerialBT.begin("Grillfan"); // Name des Bluetooth-Geräts

  // Pin für den Lüfter als Ausgang festlegen

  pinMode(fanPin, OUTPUT);

  // MAX6675 initialisieren

    

}

void loop() {

  if (SerialBT.available()) {

    char command = SerialBT.read();

    // Überprüfen, ob der Befehl zum Einschalten des Lüfters gesendet wurde

    if (command == '1') {

      digitalWrite(fanPin, HIGH); // Lüfter einschalten

      SerialBT.println("Lüfter eingeschaltet");

    }

    // Überprüfen, ob der Befehl zum Ausschalten des Lüfters gesendet wurde

    if (command == '0') {

      digitalWrite(fanPin, LOW); // Lüfter ausschalten

      SerialBT.println("Lüfter ausgeschaltet");

    }

  }

  // Temperatur vom MAX6675 auslesen

  double temperature = thermocouple.readCelsius();

  // Temperatur über Bluetooth senden

  SerialBT.print("Temperatur: ");

  SerialBT.print(temperature);

  SerialBT.println(" °C");

  delay(1000); // Eine Sekunde warten, bevor die Temperatur erneut ausgelesen wird

}

This is my new sketch for Bluetooth the Max and the fan on off.

Before taking a screenshot of your relevant blocks you should change the Language to English, so everyone is able to read them...

See also

Taifun

1 Like

After thinking over your fan control problem, I remembered an old phrase, "No man can serve two masters".

Your fan code needs a way to tell it who is in charge,

  • local controls
  • remote commands
  • thermocouple

For example, my high end wall thermostats (designed for both heat and air conditioning) have slide switches with choices

  • heat
  • off
  • cool

and menu choices

  • manual
  • automatic

for timed versus manual control.

Having those settings simplifies the logic inside the thermostat and in the mind of the user.

Your sketch might benefit from this concept.

It would help me if the Max6675 would send the temperature data to the APP Inventor or to the app, I have not been able to do that yet. I just can't find the right blocks to do this. Everything I have read so far has not worked. Maybe the sketch is written wrong for this, I just don't know. I'm not an expert in this area either, but I just want to do it, so I won't giv

Hello Klaus,
My name is Andreas also from Germany. How can we come in contact.
Ich kann dir vielleicht helfen

you should just send the temperature value over with SerialBT.print(temperature);
format the text that is displayed in the app with the appinventor code, when it receives the data.

also I had better luck using
String stringReceived = (SerialBT.readString());

This is how I structured a similar ESP32 project.
I send data from the ESP32 as a single string.

//prepares the data as text string with : separator to be sent over bluetooth.

String stringOne = ":";
String stringTwo = variable1 + stringOne + variable2 ;
SerialBT.print(stringTwo);

in appinventor split the received text in to a list with

I send a command using a 4 letter code and a variable e.g. this in for minimum temperature.

read it with the ESP32

 String  stringReceived = (SerialBT.readString());
if (stringReceived.startsWith("mint")) { //command "mint" minium temperature followed by the new value, e.g. mint20
    int received = (stringReceived.substring(4).toInt());// this reads whatever is after the 4th letter in the string, and converts to a Int
}