STEP 1 / 6ESP + IOT

Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone

Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone Despite how simple it is to set up, Thingspeak has a few obstacles that I encountered and, based on responses, other users appe…

Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone
PROJECT#408
TRACKIoT
PARTS09
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

Project details

Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone is a iot project. Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone Despite how simple it is to set up, Thingspeak has a few obstacles that I encountered and, based on responses, other users appe…

Source pages
936-943
Named parts
9
Build goal
Working, tested prototype
02

Tools you need

  • Digital multimeter
  • Wire stripper and side cutters
  • Soldering iron with a fine tip
  • Current-limited bench supply
  • Computer with a data-capable USB cable

Use eye protection, good lighting, and a clean insulated surface throughout the build.

03

Safety precautions

  • Disconnect every power source before changing a connection.
  • Check component polarity, pinout, and supply voltage twice.
  • Use a current limit for the first power-up.
  • Keep liquids, loose metal, and uninsulated wires away from the bench.
Ready to continue?
STEP 2 / 6 · Parts library

Gather, identify, and understand every part.

Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.

NAMED PROJECT INVENTORY9 PART LINES
PARTTYPEQTYREADY
MArduinoMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AloneMODULE LEARNING VIEW

Arduino

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for Arduino; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
PWS5100 EthernetShieldPART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AlonePART LEARNING VIEW

WS5100 EthernetShield

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for WS5100 EthernetShield; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
PThingspeak AccountPART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AlonePART LEARNING VIEW

Thingspeak Account

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for Thingspeak Account; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MSensors (such as DHT11 and BMP180)MODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AloneMODULE LEARNING VIEW

Sensors (such as DHT11 and BMP180)

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for Sensors (such as DHT11 and BMP180); similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
PInternet connectionPART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AlonePART LEARNING VIEW

Internet connection

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for Internet connection; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MESP8266 - controller board / ICMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AloneMODULE LEARNING VIEW

ESP8266 - controller board / IC

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP8266 - controller board / IC; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
MESP8266-01 - controller board / ICMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AloneMODULE LEARNING VIEW

ESP8266-01 - controller board / IC

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP8266-01 - controller board / IC; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
MBMP085 - barometric sensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AloneMODULE LEARNING VIEW

BMP085 - barometric sensor

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for BMP085 - barometric sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
MBMP108 - barometric sensorMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 AloneMODULE LEARNING VIEW

BMP108 - barometric sensor

A sensor converts a physical condition into an electrical signal the circuit can measure.

What it does here

It provides project input as an analogue, digital, resistive, frequency, or calibrated signal.

Buy / compare this part

Advantages

  • Adds real-world awareness
  • Can usually be tested independently
  • Often supports calibration

Limitations

  • Readings can drift
  • Placement affects results
  • Some sensors need warm-up or calibration

Handling

  • Protect the sensing surface
  • Observe supply voltage and polarity
  • Keep signal leads away from noisy power wiring

Specifications to verify

  • Use the exact model, value, package, and rating listed for BMP108 - barometric sensor; similar-looking parts are not always interchangeable.
  • Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. Keep motors, relays, pumps, and other loads on a suitable driver and external supply.

Common mistakes

Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.

Troubleshoot

Disconnect loads, continuity-test one path at a time, then test with a current limit.

02

Software preparation

No IDE, board package, library, or firmware upload is required for this project.

If you add a programmable controller as an extension, document its pin map separately.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

Power up safely

  • Inspect unpowered continuity first
  • Apply the lowest safe current limit
  • Measure supply rails before signals
  • Add one load at a time
  • Record expected and actual results
TROUBLESHOOT

Work from simple to complex

  • Confirm power, ground, polarity, and orientation
  • Compare each pin with the source
  • Test inputs separately from outputs
  • Replace only one variable at a time
  • Power off before every correction
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone Despite how simple it is to set up, Thingspeak has a few obstacles that I encountered and, based on responses, other users appear to be having trouble with as well. This project works well, but I probably wouldn't use an

Arduino and an ESP8266 together again because it is too much. The Arduino can do a lot of things that the ESP8266 can also do, especially if all it needs to do is gather data from sensors. Check out the "ESP8266 only" step of this project or one of my more recent ones, like this one.

02

Component Required

Project build note

Arduino WS5100 EthernetShield Thingspeak Account Sensors (such as DHT11 and BMP180) Internet connection

03

For the WiFi

Project build note

ESP8266-01 (or other ESP8266 I wanted to use my Arduino to gather weather data and put it on a website in the form of nice graphs so I could keep an eye on it from far away. I could just use an Arduino as a web server, but if I want to do more than send numbers to a webpage, the Arduino will soon run out of memory. There are

services that can take your data and make it public: Pachube, which changed its name to Xively, is well-known, but there is a waiting list for their free accounts right now. I really do have a Pachube account that became a Xively account, but I never got any results from it.

04

There aren't many other sites like Xively

Project build note

http://2lemetry.com http://exosite.com https://www.carriots.com https://www.grovestreams.com https://thingspeak.com http://openenergymonitor.org I chose "Thingspeak." I won't go into too much detail about the signup process or creating a channel or anything else because it's pretty straightforward and easy to understand. After you sign up, you basically make a channel and add fields to it where sensors will send their data later. Under the API tab, you'll find an API that you'll need to add to your programme later. I talk about a simple connection with an ethernet cable and a wireless connection. Step 1: Hurdles and Solutions Hurdle 1 Where do I look for a programme? Wouldn't it be nice to have an example that works? In the upper right corner, there is a "Support" button that takes you to "Tutorials."

05

You'll find these things under "Tutorials"

Project build note

"Updating a ThingSpeak Channel with an Arduino and an Ethernet Shield"

Sounds great, so you download that programme to your IDE, add the API key, and then compile it. Darn, it doesn't compile, and you try to fix it (which is certainly possible) until you don't know what's needed. The programme still seems to think that everyone will use the 022 or 023 IDE. There is a link to a Github page, but that will give you a programme to tweet, which is not what you want, at least not right now. Solution

06

You won't find a better place to start than this

Project build note

https://github.com/iobridge/ThingSpeak-Arduino-Exa... That programme reads the A0 port and sends that information to "Field1" in your datastream. Ok, so you try that. You put a variable resistor like an LDR or NTC on port A0, add your API to the programme, and run it. That works fine, but I didn't just want to read a value from an analogue port. I also had a DHT11 Moisture Temperature sensor and a BMP180 Pressure & Temperature sensor. I didn't think it would be too hard. Hurdle 2 I made sure the Thingspeak programme had the right libraries, added the objects, and read the sensors into a variable. Thingspeak, on the other hand, wants you to send strings, but the sensors return floats.

Most variables can be turned into strings with the simple "string" function, but floats are a bit trickier. You have to use the "dtostrf" command, which I think stands for "double-to-string-function," to work with floats. When I tried to find information about that function on the Internet, I quickly found endless discussions about how "stupid" it was, and people who asked questions were often told, "Why would you need that? Serial.print will do that for you." Yeah, that's true, but I don't want to print. I need it because Thingspeak wants it. Solution To use the dtostrf command, you must set up a buffer space where the string

07

will be stored. It works like this

Project build note

It's important to have bufferspace. I got it to work with "7" or even "5", but when I added a second sensor that needs this function, my datastream would crash or I would get the strangest results. I also thought I could switch between using the same bufferspace for each sensor, but that didn't work either, so now I have a bufferspace for each sensor. Now, I'm no expert in C, so if there's a better way to do this, I'd love to hear it, but this is what I did and it worked. Hurdle3 Once I knew how to convert strings, I was able to add the data to the datastream. The Thingspeak example programme only shows this for one field, but it's easy to see that you need to add the strings and use the right number of plus signs and ampersands. Solution

08

So, let's say there are 4 different fields

Project build note

updateThingSpeak("field1="+temp+"&field2="+humid+"&field3="+pres+" &field4="+temp2 Step 2: Connecting with Ethernetshield The BMP180 is like the BMP085, but it has been updated. The BMP180 can use the libraries from the BMP085. There are two versions of the library for AdaFruit. I chose version 1 because it was easier to use. Version 2 also needs the "Sensor" library to be installed.

In the code, I also include an extra float:'m,' which gives the pressure in "mmHg." Since I haven't used it yet, there is no string conversion and it isn't added to the datastream, but adding it should now be as easy as adding 1 and 1. Step 3: Connect to Thingspeak Using an ESP8266 WiFi Module The internet connection shown before was made with a cable. But the Arduino can be connected to a cheap WiFi module called the ESP 8266. A cheap WiFi module is the ESP8266. Remember that it requires 3.3 Volt. Some models, on the other hand, say they can work with 5 Volts. I added two circuits that can be used to change the voltage. The ESP8266 needs its own source of 3.3 V because the current from the Arduino just isn't enough. There is a lot of information about how to connect the module, but I want to talk about the software needed to connect to Thingspeak. For debugging, the SoftSerial library is added. Once the programme is running, it is not really necessary. All of the print statements to the Software serial port are the same. I use 3 analogue values instead of an example with the BMP108 and DHT11 because that would require libraries. This makes it easier to understand how to use the ESP8266. Once you know that, adding other sensors is easy. Just make sure that everything is turned into a string. NOTE AT+CIOBAUD is no longer supported in the latest version of the ESP8266 firmware, which is why it returns ERROR.

AT+IPR is the command to use instead. See www.esp8266.com/viewtopic.php?f=13&t=718 for more information. More note It seems that some people have been having trouble lately because they connected the ESP8266 to the software serial instead of the hardware serial. This programme needs an ESP connected to a serial port. Step 4: Using Just the ESP8266 If you see gibberish on this page, it's because there was a full step here, but our thought it would be better to replace it with gibberish, even though I had already saved it. I will try it again. In the last step, I used an ESP8266 to send to Thingspeak the sensor values that an Arduino read. But you can also do it without using an Arduino at all. I connected a DHT11 to pin 2 of my ESP8266-01 and ran the following programme. I can't take all the credit for the programme. I think Jeroen Beemster came up with it first. This idea is not about how to programme the ESP8266. There are plenty of other places to learn that. If you already have a USB-TTL module at 3.3 Volt, you don't have to worry about voltages. If all you have is a 5V USB- TTL module, you can still use it, but you have to put a voltage divider between the module's Tx and the ESP8266's Rx. Never ever give the ESP8266 5 volts. Note: The Adafruit DHT library has a mistake that usually doesn't show up when using an Arduino, but can when using an ESP8266, especially if the programme is a bit larger. Changes you need to make to the cpp file are shown in the picture. It's mostly just comments on two lines.

Ready to continue?
PROJECT ACHIEVED

You built Send Sensor Data (DHT11 & BMP180) to ThingSpeak with an Arduino, Using Cable or WiFi (ESP8266) or Use ESP8266 Alone.

You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.

An Inexpensive IoT Enabler Using ESP8266 project thumbnail featuring ESP8266 ESP-01 module, DHT11 or DHT22 sensor, v relay
NEXT IOT ADVENTURE

An Inexpensive IoT Enabler Using ESP8266

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects