Welcome to the Tweeting thermostat! To get started, you will need to install a couple of libraries. First, you will use pip and get tweepy. Use: pip install tweepy
in your terminal or command prompt. Then you will need to go onto https://apps.twitter.com and sign into your twitter account. From there select "New Application" and fill in the title. You will then need your API keys, so click on your project and scroll to the app settings. From there you can copy and paste your consumer key and secret into the python code. Next, generate an access token and secret. Copy/paste those into the code as well. Head on over to the Arduino IDE and load in the Arduino code. Connect the circuit that is shown in the schematic. For this project I used the Arduino Mega 2560, but any 5v Arduino board will work. Then select your serial port from the "tools" menu. Go back to the python code and change the serial port to whatever port you selected in the Arduino IDE. Go to "Sketch" -> "Libraries" -> "Manage Libraries" -> and search for "dht11". Install it into your IDE and then upload to your board. Run the python code and you are set to tweet your current temperature! It will update every 20 minutes and will avoid duplicate readings. Enjoy your new tweeting thermostat! Here is a picture of mine:
You can follow my bot at: @BottHavingmc
Happy tweeting!
Comments