Editing
Wemos D1 Mini
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=pinout= Wemos reference: [https://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations#uart_pins Pin Functions]<br> <br> [[File:ESP8266 WeMos D1-Mini pins.jpg|450px]]<br clear=all> <br> [[File:D1-mini(back).jpg|250px|left|Back]]<br clear=all> <br> {{template:top}} ==A0== The analog input of the ESP chip is limited to 1 volt max.<br> There is an internal divider on the Wemos D1 Mini that makes the range of A0= 0-3.3V<br> To find the external resistor value, use the [https://ohmslawcalculator.com/voltage-divider-calculator online voltage divider calculator] to find the total for R2, then subtract 220K. [[File:Wemos A0.jpg|400px]]<br clear=all> {{template:top}} ==I2C== I2C can be used to connect up to 127 nodes via a bus that only requires two data wires, known as SDA and SCL. SDA => D2. SCL => D1 ==interrupts== The pins D5, D6, D7 work without restrictions<br> D3 and D4 work, but can not be low on boot, otherwise the WEMOS freezes<br> D1 and D2 are used for IΒ²C by default3<br> D0 (HPIO16) and D8 (GPIO15) have no support for interrupts<br> ==PWM== ;PWM may be used on pins 0 to 15.<br> analogWrite(pin, value) enables software PWM on the given pin. Call analogWrite(pin, 0) to disable PWM on the pin. Value may be in range from 0 to 1023. 0 to 255 is normal on an Arduino board, as it's an 8 bit register, but ESP8266 uses software PWM so 1023 is full duty cycle. ==SPI== SPI is much simpler than I2C. Master and slave are linked by three data wires, usually called MISO, (Master in, Slave out), MOSI (Master out, Slave in) and M-CLK. M-CLK => D5 MISO => D6 MOSI => D7 (SPI Bus SS (CS)is D8.) {{template:top}} ==pins_arduino.h== <nowiki>/* pins_arduino.h - Pin definition functions for Arduino Part of Arduino - http://www.arduino.cc/ */ #define PIN_WIRE_SDA (4) #define PIN_WIRE_SCL (5) //Wemos D1 Mini, pins D2(SDA) and D1(SCL).. Wire.begin(4, 5) static const uint8_t SDA = PIN_WIRE_SDA; static const uint8_t SCL = PIN_WIRE_SCL; #define LED_BUILTIN 2 // = GPIO static const uint8_t D0 = 16; static const uint8_t D1 = 5; static const uint8_t D2 = 4; static const uint8_t D3 = 0; static const uint8_t D4 = 2; static const uint8_t D5 = 14; static const uint8_t D6 = 12; static const uint8_t D7 = 13; static const uint8_t D8 = 15; static const uint8_t RX = 3; static const uint8_t TX = 1; /* Re: Wemos Board. Usable pins for general I/O? TX, GPIO1: Serial Port. Also usable as GPIO if not using serial. RX, GPIO3: Serial Port. Also usable as GPIO if not using serial. D0, GPIO16: Momentary high on boot. D1, GPIO5: nothing special. D2, GPIO4: nothing special. D3, GPIO0: pull low during boot for flash mode (connects to a push button). D4, GPIO2: is pulled up during boot & internal LED (active LOW). D5, GPIO14: nothing special. D6, GPIO12: nothing special. D7, GPIO13: nothing special. D8, GPIO15: fixed external pull-down (for boot). */</nowiki> <br> ==Output Current Limit== When using a GPIO as output (i.e. to drive something such as an LED) it is important to note that the <b>maximum output current is 12mA</b>. (IMAX=12mA per [https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf Espressif datasheet]) If you try and output more current than that, you run the risk of damaging the device. Since many LEDs are able to draw 20mA you should adjust your current limiting resistor to be 12mA or less. Using [https://en.wikipedia.org/wiki/LED_circuit https://en.wikipedia.org/wiki/LED_circuit] - R=(Vout-Vled)/I so (3.3V-1.8Vred) at 12mA = 125Ξ© min for a red LED. {{template:top}}
Summary:
Please note that all contributions to Notebook may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Notebook:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home Page
C++ Reference
ESP Hardware
ESPHome
Home Assistant
Network Stuff
Tools
What links here
Related changes
Special pages
Page information