Blink external LED on NodeMCU is very easy with this NodeMCU ESP8266 board as its self sufficient with everything on it. Detailed initial setup steps can be found here.
Led in itself has two terminals, anode (+ve) and a cathode (-ve). Do pay attention to it while installing it on the breadboard. You can check polarity with multimeter also. For visual understanding, the longer leg is the anode.
Also, note that every LED has different specifications and voltage requirements. You can always check its datasheet to get those and then calculate the resistance requirement accordingly.
Resistance required
= (Power source voltage – LED voltage) / Current rating of LED (amp)
So in my case its, (5-1.8)*1000/25 = 128 Ω (approx). I am using a 100 Ω resistor. Higher the resistor value, lower the brightness. At around 128 Ω it will have max supported brightness. Lower resistance value may burn it in the long run.
REQUIREMENTS
- NodeMCU ESP8266 Board
- Micro USB Cable
- LED’s
- Resistance (as per LED, use formula described below) or 100 – 200 Ω in general.
- Arduino IDE with ESP8266 board definitions & drivers installed
GETTING READY TO BLINK EXTERNAL LED
1. Install the NodeMCU board on the breadboard’s one side.
2. Install two LEDs on the breadboard with the anode (+) on D1 & D5 pin of NodeMCU while cathode (-) on the power rail.
3. Ground the same rail with resistance in series using any of the ground pins of NodeMCU.
4. Connect micro USB cable’s one end to Laptop and other to board’s USB port.
5. Open Arduino IDE and choose board NodeMCU 1.0 from Tools → Boards.
6. Set baud rate to 115200 and choose the port to which it is connected.
7. Copy the code below to IDE.
8. Go to Sketch → Upload
9. Wait for the code to get uploaded. Other blue LED near WiFi chip blinks continuously while the board is being programmed. Don’t confuse it for LED you code will blink.
10. Upon successful completion of the task, IDE will display 100% on the bottom zone and LED will start blinking.
CODE TO BLINK EXTERNAL LED
#define LED1 D1 //Led in NodeMCU at pin D1
#define LED2 D5 //Led in NodeMCU at pin D2
void setup()
{
pinMode(LED1, OUTPUT); //LED1 D1 pin as output
pinMode(LED2, OUTPUT); //LED2 D5 pin as output
}
void loop() // runs/loops below code infinitely
{
digitalWrite(LED1, HIGH); //turn on LED
delay(300);
digitalWrite(LED1, LOW); //turn off LED
delay(300);
digitalWrite(LED2, HIGH); //turn on LED
delay(300);
digitalWrite(LED2, LOW); //turn off LED
delay(300);
//delay defines duration in ms for which LED is on/off or in actual way, its //the duration for which program waits here on this line of code
}
Some Basic Things with NodeMCU ESP8266
Setup Arduino for NodeMCU programming
Interface With Relay (for controlling AC/DC devices)
Home Automation using NodeMCU and Blynk- Control device from anywhere
You can draw max. 12mA from the GPIOs. But they are also 3.3V. So you actually need (3.3V-1.5V)/0,025A = 60 Ohms. But that would kill the ESP8266 Chip, because it can’t handle more than 12mA per PIN. So 100Ohms is probably 10-15mA, which is fine again. But the LEDs arent that bright
social signals service
dlmpfkdno iujnk kepwldq cbwv fndmtumvrqrreje
… [Trackback]
[…] Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] There you will find 92024 additional Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More Information here on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Info to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Here you can find 51657 more Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More on to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More on to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Information to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More here on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] There you will find 82594 additional Information on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More Information here on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More on on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More Information here to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Information to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Info to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Here you will find 33762 additional Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Info to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Information on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More here on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Here you will find 58654 additional Info on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
relaxing night jazz
Jazz
… [Trackback]
[…] Here you will find 8905 additional Information to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
… [Trackback]
[…] Here you will find 76026 more Information to that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
jazz music
soft music
… [Trackback]
[…] Find More Information here on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
bass type beat
bossa music
trap workout music
soothing piano
work jazz
… [Trackback]
[…] There you can find 73006 more Information on that Topic: abstractotech.com/blink-external-led-with-nodemcu-esp8266/ […]
sleeping music
stress relief
yoga music
relax music
coffee shop music
healing music
deep sleep
piano music