ESP32 Analog pin not reading when bluetooth is connected
Posts: 5
Joined: Sun Mar 31, 2019 1:31 am

ESP32 Analog pin not reading when bluetooth is connected

Postby » Wed Jul 10, 2019 6:37 am


I have been using ESP32 and writing code in Arduino. However, when I enable Bluetooth, GPIO4 and GPIO15 does not work to read analog inputs. I have connected an IR LED's on both pins and reading analog signals. If Bluetooth code is not used, ESP32 is reading the analog signals and displaying it on serial monitor. If the below Bluetooth code is used, the reading is shown as 255 on both pins (reading 5v. Yes, they are 5v for now and will be level shifted to 3.3v).
  1. void init_bluetooth() {
  2.   ESP_BT.begin("EKA Robot"); //Name of your Bluetooth Signal
  3.   Serial.println("Bluetooth Device is Ready to Pair");
  4. }
IR LED code :
  1. // Read Infrared LED on GPIO4. Similar function exists to read GPIO15
  2. int readIR() {
  3.   int sensorValue = analogRead(oaPinL);
  4.   delay(5);
  5.   sensorValue = map(sensorValue, 0, 4095, 0, 255);
  6.   return (sensorValue);
  7. }

Who is online

Users browsing this forum: No registered users and 8 guests