ESP32: can BluetoothSerial be used with ADC2 module?

Aurora
Posts: 8
Joined: Fri Aug 11, 2023 1:27 am

ESP32: can BluetoothSerial be used with ADC2 module?

Postby Aurora » Thu Jan 11, 2024 10:22 pm

I am programming ESP32-WROOM-32D with Arduino IDE. In this website (https://docs.espressif.com/projects/esp ... %2D%2027).), it says that the ADC2 module can only be used when WiFi driver is not activated.

In my case, I try to use the BluetoothSerial library (the commands start with SerialBT) together with the ADC2 module, and I found that ADC2 GPIOs seem to be not working. Therefore, I would like to ask if the BluetoothSerial library is also using the WiFi driver which leads to the problem.

I also read from this website (https://docs.espressif.com/projects/esp ... hannel_tPi) that the adc_oneshot_read() is thread safe and can be used with WiFi. Is my understanding correct? It would be great if anyone can provide some experiences.

Thank you very much for any information.

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP32: can BluetoothSerial be used with ADC2 module?

Postby liaifat85 » Fri Jan 12, 2024 8:20 am

I think you'll find your answer here: https://esp32.com/viewtopic.php?t=20057

lbernstone
Posts: 727
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32: can BluetoothSerial be used with ADC2 module?

Postby lbernstone » Fri Jan 12, 2024 2:12 pm

Short answer is no. The radio uses the ADC2 exclusively.

Aurora
Posts: 8
Joined: Fri Aug 11, 2023 1:27 am

Re: ESP32: can BluetoothSerial be used with ADC2 module?

Postby Aurora » Fri Jan 12, 2024 2:16 pm

liaifat85 wrote:
Fri Jan 12, 2024 8:20 am
I think you'll find your answer here: https://esp32.com/viewtopic.php?t=20057
Thank you very much for pointing me to the post.

Aurora
Posts: 8
Joined: Fri Aug 11, 2023 1:27 am

Re: ESP32: can BluetoothSerial be used with ADC2 module?

Postby Aurora » Fri Jan 12, 2024 2:19 pm

lbernstone wrote:
Fri Jan 12, 2024 2:12 pm
Short answer is no. The radio uses the ADC2 exclusively.
Thank you for your information. By using the word "radio," are you referring to both Bluetooth and WiFi?

And do you have any idea if adc_oneshot_read() will work for ADC2 when Bluetooth is on?

lbernstone
Posts: 727
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32: can BluetoothSerial be used with ADC2 module?

Postby lbernstone » Fri Jan 12, 2024 2:56 pm

yes
no
tl;dr Don't do this. Use ADC1 for analog reads.

Aurora
Posts: 8
Joined: Fri Aug 11, 2023 1:27 am

Re: ESP32: can BluetoothSerial be used with ADC2 module?

Postby Aurora » Fri Jan 12, 2024 3:07 pm

lbernstone wrote:
Fri Jan 12, 2024 2:56 pm
yes
no
tl;dr Don't do this. Use ADC1 for analog reads.
Thank you very much for your help.

Who is online

Users browsing this forum: No registered users and 26 guests