== !WeMos D1 == The [https://forum.wemos.cc/category/2/d1-boards WeMos D1] and its clones are single board computers based on the ESP8266. They combine a 32-bit RISC processor with a !WiFi transceiver and 4MB of serial flash. These are cheaper and much more powerful than the traditional 8-bit AVR processors used in Arduino Uno and compatible boards, but they can still be programmed using the hobby-friendly Arduino environment. The boards are widely available at very low prices on eBay, amazon, and [https://www.aliexpress.com/item/USB-CP2102-32M-FLASH-WeMos-D1-ESP8266-Internet-Wifi-Module-for-Nodemcu-Lua-V3-DC-Power/32814901470.html AliExpress for $3.19]. It's hard to get a faster embedded system that you can put online for less money. It can be programmed in C/C++ using the [https://www.arduino.cc/en/Main/Software Arduino] environment after installing support for the ESP8266 platform: 1. Install the URL for the optional ESP8266 board manager: File->Preferences->Additional Board Manager URLs '''http://arduino.esp8266.com/stable/package_esp8266com_index.json''' 2. Install the ESP8266 board manager: Tools->Board->Boards Manager->esp8266 (scroll to bottom of list and click on it) Test by creating a basic sketch (Arduino-lingo for a program). Sketches consist of two parts: a setup function that runs once when the program starts and a loop that runs forever after setup finishes: {{{ #define LED_BUILTIN 2 // 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); // initialize serial communications interface Serial.begin(115200); } // the loop function runs over and over again forever void loop() { static uint32_t count; Serial.println(count++); digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } }}} * Configure the Arduino environment's interface to your physical board: 1. Tools->Board->Generic ESP8266 Module 2. Tools->Flash Mode->DIO 3. Tools->Flash Size->4M (1M SPIFFS) 4. Tools->Reset Method->nodemcu 5. Tools->CPU Frequency->160MHz 6. Tools->Upload Speed->921600 7. Tools->Port-> * Compile your program (sketch) and upload it to the board by pressing the -> tool When the download finishes, the blue LED on your board should be blinking and if you launch the serial monitor (Magnifying glass tool in the far right of the toolbar), you should see your board sending out an increasing count every 2 seconds. The !WeMos D1 pin mappings are [https://github.com/esp8266/Arduino/blob/master/variants/d1_mini/pins_arduino.h#L49-L61 here] === Hardware Interfacing === * ESP8266 is a 3.3v device. The !WeMos board has a built-in voltage regulator that generates 3.3v from a higher voltage. You can power the board using the micro-USB connector (which supplies 5V) or you can supply 4.5 to 7.5vdc directly to the VIN pin (the pin nearest the RST button). * You can connect the ESP8266 to a wide variety of other 3.3v devices using * Digital I/O pins (D0..D8) * 3.3v serial I/O pins RX, TX * Analog I/O pin A0 * SPI interface (CLK, CMD, SD0..3) * I2C interface (D1=SCL, D2=SDA) * Most importantly, you can connect the !WeMos D1 to the internet using !WiFi with no additional hardware. See [http://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html here] for a basic !WiFi connection example and lots of information about !WiFi and how to use it. * There are '''many''' libraries available for interfacing your Arduino platform to other devices such as [https://www.losant.com/blog/how-to-connect-lcd-esp8266-nodemcu LCD displays], ultrasonic sensors, motor drivers, etc. === Modules === * [https://www.aliexpress.com/item/0-96-inch-IIC-Serial-Yellow-Blue-OLED-Display-Module-128X64-I2C-SSD1306-12864-LCD-Screen/32828449458.html OLED Display] using SSD1306 controller * [https://www.aliexpress.com/item/1602-16x2-HD44780-for-arduino-Character-LCD-w-IIC-I2C-Serial-Interface-Adapter-Module/1935576611.html 16x2 LCD Display] using HD44780 controller with I2C interface. [https://www.aliexpress.com/item/1PCS-LCD2004-I2C-2004-20x4-2004A-blue-screen-HD44780-Character-LCD-w-IIC-I2C-Serial-Interface/32831845529.html 20x4 version] * [https://www.aliexpress.com/item/10pcs-Ultrasonic-Module-HC-SR04-Distance-Measuring-Transducer-Sensor-HC-SR04-HCSR04/1298114689.html HC-SR04 Ultrasonic] distance sensor * [https://www.aliexpress.com/item/10PCS-MPU-6050-Module-3-Axis-Gyroscope-Accelerometer-Module-for-Ar-MPU-6050/2035926647.html MPU6050 6DOF position sensor] * [https://www.aliexpress.com/item/APDS-9930-Proximity-Sensor-Approaching-and-Non-Contact-Proximity-Module-CKIN/32746850298.html APDS-9930 proximity sensor] (opto-reflector) * [https://www.aliexpress.com/item/Free-shipping-1pcs-lot-MG995-55g-servos-Digital-Metal-Gear-rc-car-robot-Servo-MG945-MG946R/32270781027.html MG995 servo motor]