Since the connection between ESP32 and Arduino was fine last time, connect the temperature sensor and read it serially. The sensor is a product called LM35DZ-N that I had at hand. Apart from the temperature conversion, I was able to monitor it safely with Arduino-IDE.
Next, use Buletooth to link the Raspberry Pi with the ESP32. This is a big challenge as I've never done it (although there are many instructions on Qiita and the Web).
#define LM35DZN 25
void setup(){
Serial.begin(115200);
while(!Serial);
pinMode(LM35DZN,INPUT);
}
void loop(){
int e=analogRead(LM35DZN);
float Vout = e/4095.0*3.3+0.1132;
float temp =(Vout -0.6)/0.01;
Serial.println(temp);
delay(1000);
}
Recommended Posts