This project is presented on a breadboard as it best demonstrates the connections and how the digital pins might connect to other types of sensors. A final project may only have power, a regulator, the ESP-01, and a sensor, which could fit in a very small container.
- ESP8266 ESP-01 Wifi Module #2282
- USB TTL Serial Console Cable #954
- 3.3 V 800mA Voltage Regulator LS1117-3.3 #2165
- DHT22 #385 or DHT11 #386 Sensor (comes with 10K resistor)
- IDC Breakout Helper 2x5 (pins to breadboard) #2102 or
- Female / Male 6" Jumper Wires #826
- Tactile Button Breadboard Friendly #367 (or jumper wire)
The ESP8266 is a 3.3 volt device only. It can draw over 300 milliamps at some peak operations. To give it a safe margin, the LD1117-3.3 regulator is safe, able to supply 800 milliamps when it needs to, cool at 500 milliamps. So you can connect a 3.7 volt LiPo battery, 5 volt "Cell Phone Recharger" battery, or 9 volt battery. You may also use a 5 volt "wall wart" power supply. You might also consider a power switch. If you have noisy power, like a poor quality cell charger, etc. place a capacitor between power and ground on the input and output. 0.1 microfarad would be typical, 10 microfarad electrolytic capacitor (which have + and - leads) for a more noisy supply.
Many web tutorials show the ESP8266 being connected via generic FTDI USB to Serial device. 5 volt signal levels can harm the ESP8266. This may be mitigated via level shifting or a voltage divider on the ESP8266 receive (RXI) pin for such devices. The Adafruit FTDI Friend is safe as the default transmit and receive signal level is 3.3 volts if left on the default on the back.
The Adafruit Console Cable #954 runs at 3.3 volt signal levels so it's safe (safe for the sensitive Raspberry Pi also). The only thing is do not connect the red 5 volt wire, it is not needed.
If you do not have a 4x2 or 5x2 socket, you can use female to male rainbow connector wires like the one below.
Here is the complete project on the breadboard (using the breadboard socket for the ESP8266).