element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experimenting with Thermistors
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Thermistors
  • More
  • Cancel
Experimenting with Thermistors
Challenge Blog Limited ADC on ESP8266, and possible options.
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ntewinkel
  • Date Created: 17 Aug 2022 4:18 AM Date Created
  • Views 8419 views
  • Likes 8 likes
  • Comments 9 comments
  • molex
  • thermistor
  • temperature sensor
  • Molex thermistors
  • experimenting with thermistors
  • sensor
Related
Recommended

Limited ADC on ESP8266, and possible options.

ntewinkel
ntewinkel
17 Aug 2022
Limited ADC on ESP8266, and possible options.

Boards with Analog Inputs

TL;DR

My favourite IoT board, the Wemos D1 Mini, only has ONE analog input - this limits me to using just one thermistor at a time. Read further as I look at my options.

Why Wemos?

The Wemos D1 Mini has WiFi built in, it’s easy to program with the Arduino IDE, it is well supported, and on top of all that it’s very affordable. For all of those reasons I have been using this little board for my IoT temperature sensors. It also has a nice compact form factor, but still gives access to more than enough pins than I need for my projects, which so far have had at most 2 separate sensors.

My previous setup has been using only digital sensors: the DS18B20 and the BME280, and the D1 mini has more than enough digital pins to support that. They’ve been fairly solid too, happily reporting values every minute every day for a few years now.

Thermistors are Analog Devices

Thermistors are much simpler devices than the digital sensors I’ve been using. This makes them more affordable, but they are analog, which requires analog to digital conversion. This is where the D1 Mini, and ESP-8266 in general, can’t quite keep up to the task - it only has one ADC (1 analog input pin). The D1 Mini has pin A0 for this.

For most of my IoT temperature sensors that’s not too big a deal, as I generally have been using one board per sensor anyway, to keep things simple but also to allow the extra flexibility of moving things around.

For the hummingbird feeder project, however, it makes sense to have one board report both the nectar temperature as well as the outdoor temperature.

If I were to do this project using only thermistors on the D1 Mini, I would need to add some extra magic.

Adding External ADC support

One way to get around the ESP's analog input limitation is to use an external ADC, like this 16-bit 4-channel break-out board in the element14 store, which would allow me to use up to 4 thermistors - far more than I need, which is nice. Plus the 16 bit resolution is a LOT more accurate than the built-in 10-bit ADC found on the ESP-8266 and the Arduino Uno. Also very nice. However, if we are using thermistors to cut costs, then this extra hardware kind of defeats that purpose. It also adds complexity. On the other hand, if you’re looking for accuracy, the extra resolution might be a critical deciding factor.

Multiplexing one ADC to multiple devices

A second way to get around the single-ADC limit might be to multiplex the signal to the ADC somehow. I haven’t seen too many examples out there that don’t involve some kind of chip, but I imagine using a couple of transistors to select the input line might do the trick. That also adds extra complexity I’d rather avoid. The fewer external components needed, the better. Thankfully, scottiebabe will be looking into multiplexing thermistors during this challenge, so I’m looking forward to see what she invents :)

Ditch and Switch?

At this point it might make sense to upgrade to using ESP-32 boards instead. This ESP-WROOM board I bought last winter, for instance, has something like 18 (did I count that right?) analog inputs available, and they have better 12-bit resolution as a bonus. It also has Bluetooth available, which could allow for a nicer more flexible WiFi provisioning experience. I haven’t had the chance to try out that board yet (other than blinking the LED to test that it works), so this could be a good excuse to get that figured out. The element14 store carries a similar board from DFRobot.

What about the New Pi Pico?

I did consider maybe using a Pi Pico W for this, but I don’t have one handy (and I’d rather not have unknown delays waiting for one), plus I hear the ADCs on it are a bit on the noisy side. I’m hoping that will be cleared up in the future, but right now I’d rather not add that extra unknown.

Me and My Wemos D1 Mini, to the end!

So in the spirit of keeping things simpler, and to allow me to just focus on the thermistors part of this challenge, I have decided to simply use one thermistor for the nectar temperature sensor, and to keep using the BME280 as the outdoor sensor. The added benefit is that the BME280 also provides humidity and pressure, as well as temperature. Plus it’s digital so the A0 analog input is available for the thermistor.

In terms of the final solution it also makes sense - the thermistor is tiny and can more easily fit snuggly up against the nectar bottle than the bigger DS18B20 I’m currently using can. The external sensor doesn’t need to be tiny, as it gets encased separately and should be mounted further away anyway. Unfortunately the BME280 sensors are much more expensive, but the ease of use and extra weather data make it worth it. It also saves us from having to switch to a more expensive microcontrolle or adding extra external hardware.

image

Bonus Question 

On an extra side-note, I’m still debating on the best place to locate the microcontroller board when it’s in use - the D1 Mini does give off a bit of heat, as most processors do. Having that inside the insulated sleeve, up against the hummingbird feeder bottle, can put that waste heat to good use in keeping the nectar warm almost without needing much of a heater. Maybe just calculate Pi when the temperature dips ;) I haven’t tested how that might affect WiFi performance. The insulated sleeve is just a neoprene bottle cover, and the nectar bottles are glass. If you have any thoughts on that, I’d love to hear it!

First Steps

For my first experiments, however, I will use my trusty ole Arduino Uno. Tried and true, known to be reliable. Then once I have the basics covered I should be able to transfer the code onto the Wemos D1 Mini.

To test a handful of thermistors at once, however, it looks like the Arduino Nano (or the ESP32 board) will be my best options, as they have more analog inputs available (the Nano has 8, the ESP32 has 18), to test multiple thermistors all at once.

This is looking like a fun challenge already Slight smile

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 3 years ago +1
    Hi Nico, An 8-bit ADC will provide better than 1 degree C resolution, if your desired temperature range is small enough. The curve from the thermistor is non-linear as you observed, so it would need…
  • michaelkellett
    michaelkellett over 3 years ago +1
    If you can set the outputs of the micro to high impedance input you could connect one to each thermistor and the other ends of both thermistors to a single resistor to ground. Measure the voltage across…
  • ntewinkel
    ntewinkel over 3 years ago in reply to michaelkellett +1
    Thanks michaelkellett ! I had to think about the reasoning for setting them to be inputs... is that to avoid having it be a GND without resistance when set low, which would bypass the voltage divider resistor…
Parents
  • michaelkellett
    michaelkellett over 3 years ago

    If you can set the outputs of the micro to high impedance input you could connect one to each thermistor and the other ends of both thermistors to a single resistor to ground.

    Measure the voltage across the fixed resistor as Shabaz describes below. with each thermistor held high in turn by one micro outoput and the other set to high impedance.

    image

    Not the most accurate scheme but needs no extra parts.

    A capacitor across R1 will probably reduce noise.

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 3 years ago in reply to michaelkellett

    michaelkellett Great way to increase analog input channels.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • dougw
    dougw over 3 years ago in reply to michaelkellett

    michaelkellett Great way to increase analog input channels.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube