ESP8266 code not working on ESP8266 Pro board

I have a simple test program for a DS18b20 temperature sensor which works fine with an ESP826 on a Wemos D1 mini board. If I substitute the ESP8266 for an ESP8266 Pro on a WEMOS D1 Mini Pro the code runs but the read of the sensor fails.

Pinouts etc of the two board are identical.

I am using the latest Arduino IDE and the DS18B20 library from Miles Burton and the OneWire library from Tim Studt et al ( i.e. standard libraries downloaded via the Arduino IDE ).

Here is the code :

/*
 * Simple test program for Dallas DS18B20 Temperture sensor
 * ********************************************************
 * 
 * Initialsises Sesnor, then reads sensor and displays temp every 5 seconds approx.
*/

#include <OneWire.h>
#include <DallasTemperature.h>

#define APP_NAME            "Dallas DS18b20 test program"

#define APP_VERSION         "v0.01"             // 19/06/2025  Initial version

#define WEMOS_MINI_PIN_D1   5
#define WEMOS_MINI_PIN_D2   4
#define WEMOS_MINI_PIN_D3   0
#define WEMOS_MINI_PIN_D4   2
#define WEMOS_MINI_PIN_D5   14
#define WEMOS_MINI_PIN_D6   12
#define WEMOS_MINI_PIN_D7   13
#define WEMOS_MINI_PIN_D8   15

OneWire           oneWire(WEMOS_MINI_PIN_D3);   // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
DallasTemperature sensors(&oneWire);            // Pass our oneWire reference to Dallas Temperature. 

char              Buffer[128];
float             fTempC;

void setup()
{ 
  Serial.begin( 115200 );

  delay( 1000 );

  oneWire.reset();            // Configure Temperature Sensor
  sensors.begin();

  sprintf( Buffer, "\n\n%s %s", APP_NAME, APP_VERSION );
  Serial.println( Buffer );
}

void loop()
{
  sensors.requestTemperatures();

  fTempC = sensors.getTempCByIndex(0);

  if( fTempC == DEVICE_DISCONNECTED_C )
    strcpy( Buffer, "Temp sensor error" );
  else
    sprintf( Buffer, "%2.1f", fTempC );

  Serial.println( Buffer );

  delay( 5000 );
}

When I look at the IDE Serial Monitor output for the ESP8266 I see this for example :

17:28:45.609 -> Dallas DS18b20 test program v0.01
17:28:46.302 -> 28.3
17:28:51.963 -> 28.3
17:28:57.625 -> 28.2
17:29:03.294 -> 28.2

and when I substitute the ESP8266 Pro board I see this :

17:30:37.949 -> Dallas DS18b20 test program v0.01
17:30:37.949 -> Temp sensor error
17:30:42.978 -> Temp sensor error
17:30:47.936 -> Temp sensor error
17:30:52.941 -> Temp sensor error

I get the same results if I compile the ESP8266 Pro version targeted ( by the IDE ) at an ESP8266 or ESP8266 Pro.

I'd be grateful for suggestions as to why this is happening. Thanks

I would say that the pro board may be faulty. The differences between the boards is marginal, for this application in particular.

It is mainly the bigger flash size, which is completely irrelevant right now.

So either is a connection that is not solder properly, or there is a real defect.

Did you solder the header pins on ? If so can you re-melt all of the soldering, making sure that the solder flows onto the PCB. This is most likely the cause.

Try using another port on both processors and see what happens.

1 Like

As you draw your annotated schematic and validate the pin numbers you may find your problem. If not post the schematics.

Where did you find the pinout and schematicsof that board (I couldn't find it).
Without that you don't know which pins are already used by the board.
Why invest in an obsolete ESP8266. The ESP32 is the current family.
Leo..

Both boards supposed to have 10k pullup on pin used on the sketch, which is quite high if no external pullup used.

What value pullup resistor are you using?
How is the DS18b20 powered?

Power the DS18B20 from a clean 3.3V source, not 5V (or use a level shifter).
If you're powering via battery or regulator, try USB instead.

With my ESP boards I power the DS18B20 from 5volt
and pull up the data pin to 3.3volt.

If there is no wiring between ESP and sensor,
then internal pull up (no resistor) is enough.
Leo..

Thank you for all your comments and suggestions. It appears that in my naivety I had assume that as the two device had the same pin names on the silk screen that the function would be the same too. I found that that's not the case and having shift from D3 to D5 on both device types that works as expected. I have learnt a lesson - thank you.

I'm using the ESP8266 as I started a project a number of years ago and had a small collection of them to use. Starting afresh I would use the ESP32 now.

And it should, no naivety here. Wemos d1-mini and mini pro don't have any differences on pins (that I can see).
Of course some clones might have labeling mistakes...