D1 Mini pins do not power up

Hi there,

I'm pulling my hair out!! :confused: I have one D1 mini purchased a while ago and can control it just fine. It is packaged and I'm using it to automate my heater. But I baught another couple recently from a different seller and just can't get them both to work. I can control the LED_BUILTIN, but the rest of the pins do nothing. Is there any reason why these particular ESP8266 D1 Minis might not work the same way? Have I done something stupid in my code?

Here I'm trying to light an LED from Pin D1, but I get no voltage. I've tried every other pin and they're all the same.

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(D1, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(D1, HIGH);
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(D1, LOW);
  delay(1000);                       // wait for a second
}
  1. How is that LED connected?
  2. How do you determine “I get no voltage”?

Also, avoid using D0 and D1 as they are used for serial RX and TX.

Make sure you are wired correctly

septillion:

  1. How is that LED connected?
  2. How do you determine "I get no voltage"?

I used a volt meter across the pin and 3.3v, 5v and Ground. Got in the range of 0.05v at best.

larryd:
Also, avoid using D0 and D1 as they are used for serial RX and TX.

Thanks and noted. I'm currently failing at every pin and the fact that both of my ESPs are doing the same makes me think I must be the problem here.

Are you sure you are using the right pin numbers? There are several pin mappings used for ESP8266 boards...

DrAzzy:
Are you sure you are using the right pin numbers? There are several pin mappings used for ESP8266 boards...

This is the cause of constant confusion to me! :stuck_out_tongue: I wouldn't have a clue, but I tried a blink app that blinks pins referenced by D1, D2, D3..D7 also 1, 2, 3...13.

This is the actual item I have: https://www.ebay.com.au/itm/NodeMCU-Lua-ESP8266-ESP-12-WeMos-D1-Mini-WIFI-Dev-Kit-Development-Board-ESP12/262662288711

Any idea which of the boards and board settings I should be using in the IDE?

As far as I remember, if you do select the WeMos D1 Mini as board, the numbers do match. So digitalWrite(4, HIGH) should set D4 HIGH (if it's an output!)

Does the code you try to upload actually get uploaded?

Also, the ESP8266 does has some sidenotes about which pins you can (or should) use. I don't have a good link ready but you can find loads with Google. Although do note, a lot of pages talk about the ESP pin numbers (GPIOx), not the WeMos pin numbers. Pinout shows how they match:

Thanks again!

OK so I didn't change anything significant but restarted my machine at some point and eventually it works now!! hmm..

What I do see is that I'm referring to pin D3 in order to control D1 as marked on the ESP. I have to use that pin as it aligns to the relay shield I'll be controlling.

CheeseNWine:
but restarted my machine at some point and eventually it works now!! hmm..

If restarting your machine helped it sounds like the upload (or compile even) to the ESP was failing for some reason.

CheeseNWine:
What I do see is that I'm referring to pin D3 in order to control D1 as marked on the ESP. I have to use that pin as it aligns to the relay shield I'll be controlling.

Which board do you have selected?

septillion:
Which board do you have selected?

WeMos D1 R1

All default settings.

But you told me you have a D1 mini Hint :wink: