• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 BME280 sensor and voltage monitor

Q&A Forum › Category: ESP32 › ESP32 BME280 sensor and voltage monitor
0 Vote Up Vote Down
cdis14 asked 5 years ago

I’m relative newbie to Arduino programming, but have a programing background.  I’m trying to combine 2 sketches. One to gather Temp, Humidity and pressure from a BME280 sensor.  The second is to read DC voltage through one of the ADC2 pins.  The 2 individual sketches work fine on their own.  When the 2 sketches are combined, the analogRead command always reads 4096 regardless whether connected to a power or not.  Is what I’m trying to do possible?  if so, what am I doing wrong?

Question Tags: ESP32 BME280 Voltage Meter
4 Answers
0 Vote Up Vote Down
Steph answered 5 years ago

Howdy,

Does your project use WIFi? Because there is a known pbm on the ADC2 pins when used in conjunction with WiFi:

  • https://github.com/espressif/arduino-esp32/issues/440
  • https://github.com/espressif/arduino-esp32/issues/102#issuecomment-295272351

As a reminder, here is a list of pins to consider:

https://desire.giesecke.tk/index.php/2018/01/30/adc2-channel-cannot-be-used-when-wifi-is-in-use/

Rui and Sara also reference a pin map of the WROOM-32 module:

As well as a declination on the DoIt ESP32 DevKit v1:

Hopefully that’s where your problem lies.

Regards,
Steph

0 Vote Up Vote Down
cdis14 answered 5 years ago

Yes, my sketch does have a wifi component.  And yes, using one of ADC1 pins worked.  Thanks for your help. 

0 Vote Up Vote Down
Steph answered 5 years ago

Great! Glad I could unlock you  🙂

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Thanks Stéphane, for providing the answer.
I’ll mark this question as resolved.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.