User Tools

Site Tools


introduction_to_the_internet_of_things

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
introduction_to_the_internet_of_things [2018/07/11 20:04]
sdh7
introduction_to_the_internet_of_things [2018/08/22 11:09] (current)
sdh7
Line 6: Line 6:
  
 Install Arduino IDE if you don't already have it, and upgrade to something recent if you're below version 1.7 - http://​arduino.cc Install Arduino IDE if you don't already have it, and upgrade to something recent if you're below version 1.7 - http://​arduino.cc
 +  *Go to Preferences in the Arduino app, and enter http://​arduino.esp8266.com/​stable/​package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
   * In Boards Manager, add ESP8266 Board support   * In Boards Manager, add ESP8266 Board support
  
 Set up a Cayenne account - https://​cayenne.mydevices.com Set up a Cayenne account - https://​cayenne.mydevices.com
 +  * Click on "Add new..."​
 +  * In the page that comes up, click "Bring Your Own Thing" The page that brings up will have your MQTT username/​password/​client ID information
  
 Install the following libraries: Install the following libraries:
   * Cayenne MQTT Library - https://​github.com/​myDevicesIoT/​Cayenne-MQTT-Arduino   * Cayenne MQTT Library - https://​github.com/​myDevicesIoT/​Cayenne-MQTT-Arduino
-  * Adafruit Sensor Library +  * Adafruit Sensor Library ​- https://​github.com/​adafruit/​Adafruit_Sensor 
-  * Adafruit BME280 library+  * Adafruit BME280 library ​- https://​github.com/​adafruit/​Adafruit_BME280_Library
   * Arduino SimpleTimer library https://​github.com/​marcelloromani/​Arduino-SimpleTimer   * Arduino SimpleTimer library https://​github.com/​marcelloromani/​Arduino-SimpleTimer
  
-Modify BME280 library+For each of these four libraries, click on the "Clone or download"​ button, and download the ZIP file (more complicated things can be done if you're Git savvy, but plain old zip download is fine here...) From there, you should be able to install the libraries using Sketch->​Include Library->​ Add .ZIP Library (you may need to strip the -master from the .zip files filename) 
 + 
 +Modify BME280 library:
   * on OS X, navigate using the finder or otherwise cd ~/​Documents/​Arduino/​libraries/​Adafruit_BME280_Library-master/​   * on OS X, navigate using the finder or otherwise cd ~/​Documents/​Arduino/​libraries/​Adafruit_BME280_Library-master/​
-    * On Windows & Linux the files will be somewhere similar. +    * On Windows & Linux the files will be somewhere similar ​- you can find your base directory via Preferences,​ and from there get to the libraries folder 
-  * edit Adafruit_BME280.h using your favorite editorchange #define BME280_ADDRESS from 0x77 to 0x76 +  * edit Adafruit_BME280.h using your favorite editor, and change #define BME280_ADDRESS from 0x77 to 0x76- it should be around line 34 or so. 
-  * more advanced C programmers may do something like: +  * I originally had some stuff about modifying the library further, but it didn't work. Just do this, and remember to change it back if you ever get an official Adafruit BME280 breakout board.
-<​code>​ +
-#define BME280_ADDRESS 0x77 +
-#ifdef CLASS_BME280  +
-#define BME280_ADDRESS 0x76 +
-#endif +
-</​code>​+
  
-and then add #define CLASS_BME280 at the beginning of your programso that way if you get an Adafruit BME280 board in the future, ​it will continue ​to work right...+===If Using Your Phone to Tether=== 
 +I have not tested phone tethering- ​the prototype worked directly with our in-space WiFi. However, if you wish to try it, there are some instructions ​to be found here: 
 +  * [[https://​www.androidcentral.com/​how-set-wi-fi-hotspot-android-phone|Android setup]] 
 +  * [[https://​support.apple.com/​en-il/​HT204023|iOS setup]]
  
 ====THINGS WE WILL DO AT THE CLASS==== ====THINGS WE WILL DO AT THE CLASS====
Line 38: Line 40:
  
 ==Hardware Construction== ==Hardware Construction==
 +  * First things first- TEST THE VOLTAGE REGULATOR BOARD. Unfortunately,​ these boards are capable of failing short (i.e. the input voltage can end up at the output, which will fry your ESP8266!!). Hook up your power source to the Vin of the regulator board. Using a voltmeter, check the voltage at Vout. It should be about 3.3V, give or take .1 V. If it is more than this, get another board and throw this one away!
   * On the programming board, wire an SPST or SPDT switch between GPIO and GND   * On the programming board, wire an SPST or SPDT switch between GPIO and GND
-  * If you plan on re-using the boards for something else in the future, solder in header pins on the other boards. If you're building this as a  +  * If you plan on re-using the boards for something else in the future, solder in header pins on the other boards. If you're building this as a fixed-in-place design, ​you'​ll ​want to just solder wires to the boards. Theoreticallythe person that designed this de-solders the pins from the ESP8266 board, but that seems foolhardy to me (makes it MUCH more difficult to reprogram...) 
-   +  * wiring: 
-If you want to re-use ​the component ​boards ​for other projectssolder ​pins into the BME280/​Voltage regulator boards+    * ESP8266->​BME280:​ GND->​GND,​ IO2->​SCL,​ IO0->​SDA,​3V3->​VCC 
 +    * AMS1117->​ESP8266:​ GND->​GND,​ VOUT->​3V3 
 +    * Note that the 3.3V & GND connections are going to multiple places.  ​
  
 ==Software Programming== ==Software Programming==
 +This is the stock program for the class, with some minor edits to account for our BME280 header hack above.
 +
 <​code>​ <​code>​
 #define CAYENNE_PRINT Serial ​ // Comment this out to disable prints and save space #define CAYENNE_PRINT Serial ​ // Comment this out to disable prints and save space
-#define CLASS_BME280 1 //enable BME280 board hack 
  
 #include <​Wire.h>​ #include <​Wire.h>​
introduction_to_the_internet_of_things.1531353840.txt.gz · Last modified: 2018/07/11 20:04 by sdh7