Introduction: Tweeting Sensor Data With Arduino / RedBoard and SparkFun BME280 and SparkFun ESP8266 Shield

Materials:

Make sure to test your ESP8266 and BME280 using the example codes after the first two steps and before following through with this Instructable so that you know your components work.

Step 1: Set Up Your SparkFun ESP8266 and Download It's Library

Hookup Guide with Library Download

You're going to have to solder the stackable headers to the board. This shouldn't take long depending on your skill with a soldering iron. When you're done soldering, connect the shield to your Arduino/RedBoard. Refer to the picture on this step to see how it is connected to the RedBoard/Arduino.

After doing that, download the library from the link above and add it to your Arduino Library. You can do this by going into the Arduino program, selecting "Sketch" in the top navigation bar, then "Include Library", and finally "Add .ZIP Library". From here, you will navigate to the .ZIP file you downloaded from the link above and select it.

Step 2: Set Up Your SparkFun BME280 and Download It's Library

Hookup Guide with Library Download

You're going to have to solder the headers to the board. This shouldn't take long depending on your skill with a soldering iron. When you're done soldering, connect the breakout board to your breadboard. Refer to the picture on this step to see how it is connected to the ESP8266 WiFi Shield.

After doing that, download the library from the link above and add it to your Arduino Library. You can do this by going into the Arduino program, selecting "Sketch" in the top navigation bar, then "Include Library", and finally "Add .ZIP Library". From here, you will navigate to the .ZIP file you downloaded from the link above and select it.

Step 3: Add Modified Twitter Library

The library is attached to this step. After you download it, add it to the Arduino software by going into the Arduino program, selecting "Sketch" in the top navigation bar, then "Include Library", and finally "Add .ZIP Library". From here, you will navigate to the .ZIP file you downloaded from the step and select it.

If this doesn't work, you may have to add the library manually. If this is the case, take the "Twitter" folder out of the .ZIP file and navigate to the "Arduino" folder on your computer. On Windows, the folder is located in Documents. Then, in that folder, there should be another folder called "libraries". Open that folder and move the "Twitter" folder from before into the "libraries" folder. Everything should be added now.

This has been modified from the original library to accept a string as a message rather than a char. It also has been modified to include support for the SparkFun ESP8266 WiFi shield. The WiFi shield support was taken from this Instructable.

Step 4: Get Your Unique Twitter Token

Navigate here and do ONLY step 1 of their list. Copy the token they give you and don't lose it.

Step 5: Program Your Arduino/RedBoard

Attached is a very simple program that tweets data from the BME280 using the ESP8266. You'll only need to change 3 things, your SSID, the password for that SSID, and the Twitter token you got in the previous step.

Step 6: Upload the File to Your Arduino/RedBoard

Now do as the title says. The delay in the program is set to make it tweet every 15 seconds so you'll probably want to change that.

Step 7: And That's It!

If everything went to plan, you should be tweeting data like a pro.

Tech Contest

Participated in the
Tech Contest