Here we are! Let’s build it!
An important thing to say. You will see two images of how connect the various things, this is because we have a configuration we’ll use to program everything and a simpler one when the sensor will just do its work. Don’t be afraid, that’s easy 🙂
Here some easy steps (image below, don’t panic).
- With some jumper wires you will connect the 3V3 and the GND pins of the ESP8266-01 to the breadboard.
- Put the DS18B20 on the board with the flat side facing you. With another wire connect the left-side pin to where you connected GND pin.
- Put the 4.7k resistor so that it connects the central and the right-side pins. With a wire connect the right-side pin to where you connecte the 3V3 pin.
- Connect the central pin to the IO2 pin on the ESP8266-01.
It should look like this.
No we need to connect the USB-TTL serial converter (keep in mind that the names can change slightly depending on which one you have, but they should be easily recognizable).
- Connect the 3V on the converter to where you connected the 3V3.
NOTE If you also have a 5V connector be careful. Only use the 3V! Or you may end with a fried ESP8266-01. - Connect the GND on the converter to where you connected the GND.
- Connect the TX on the converter to the RX on the ESP.
- Connect the RX on the converter to the TX on the ESP.
It should look like this.
Now, with this setting we can, when plugged, the USB-serial converter supplies the ESP8266-01 with the energy it needs and you will be able to communicate with it.
However, for the initial setup we need to put the ESP8266-01 in what is called flash mode, in which we can flash (i.e. copy) a different firmware on it. To do this we just need two more connections.
- Connect the EN pin of the ESP8266-01 to the 3V on the breadboard.
- Connect the IO0 pin of the ESP8266-01 to the GND on the breadboard.
Now the only pin of the ESP8266-01 not connected is RST.
Everything should look like this.
Great stuff!!
We are ready to program our ESP8266-01 😀
By the way, this is how you may want to connect the batteries when everything is done.
Go back to: A simple temperature sensor || Go to: The firmware