Finally in this step you'll configure the cloud thermometer sketch, run it, and learn how to visualize the temperature data with a web page. Before you begin make sure you have completed all the previous steps and have the following ready:
You can watch the video below to see the setup and usage of the cloud thermometer:
- CloudThermometer Arduino sketch, downloaded from the overview page.
- Assembled cloud thermometer hardware.
- Three Steinhart-Hart coefficient values from the calibration.
- Access key and secret access key of your AWS account.
- Access key and secret access key of the read only user created in the table setup.
- Computer with Python 2 or 3 installed. (note for Python 3, the actual command to run an HTTP server is different from what's mentioned in the video).
You can watch the video below to see the setup and usage of the cloud thermometer:
For a summary of the setup, you will need to load the CloudThermometer sketch in Arduino and change the define values at the top of the sketch as follows:
After connecting to your wireless network you should see output every minute as the sketch sends data to DynamoDB. In particular look for an 'HTTP/1.1 200 OK' response value to ensure the hardware is successfully writing to DynamoDB.
If you see an error like 'HTTP/1.1 403 Forbidden' or HTTP/1.1 400 Bad Request', double check your access keys, region, and host configuration is correct and try again.
Once the hardware is running you can setup a simple web page to visualize the data. Edit the index.html file in the webpage subdirectory of the CloudThermometer sketch folder. Add the read only user's access key and secret access key values in the appropriate spot noted in the comments. Also set the region value to the same region value as used in the cloud thermometer sketch.
Save the updated index.html and navigate to the folder in a terminal window. If you have Python 2 installed, enter the command:
python -m SimpleHTTPServer
Otherwise if you have Python 3 installed, enter:
python3 -m http.server
This will run a small HTTP server to serve the index.html page to your web browser. Open http://localhost:8000/ in a browser to see the cloud thermometer web page. Select your measurement ID value to view the temperature graph.
Continue on to see ideas for future enhancements to the project.
- ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, ADAFRUIT_CC3000_CS: Set these to the appropriate pins which are connected to the IRQ, VBEN, and CS pins respectively on the CC3000.
- WLAN_SSID, WLAN_PASS, WLAN_SECURITY: Set these to the appropriate values for your wireless network.
- THERMISTOR_PIN: The ADC pin which is connected to the thermistor.
- SERIES_RESISTOR: The value (in Ohms) of the resistor connected in series with the thermistor. This should be 10,000.
- ADC_SAMPLES: Keep the default value of 5.
- A_COEFFICIENT, B_COEFFICIENT, C_COEFFICIENT: Set these to the three values that were generated in the calibration step.
- TABLE_NAME: Set this to the name of the DynamoDB table, Temperatures.
- ID_VALUE: Set this to a unique string value that identifies this set of temperature measurements. For example the name of the food you're cooking is a good value to use for the ID value. Change this value each time you start a new temperature measurement. The ID value will be used to identify and select a temperature measurement in the web page.
- AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY: Set these to the values of your personal AWS account. Do not use the credentials for the read only user here as these are the credentials that are used to write data to the table!
- AWS_REGION: Set this to the region value from table in the link in the comment. You will want to select the region where your DynamoDB table was created.
- AWS_HOST: Set this to the endpoint URL from the table in the link in the comment.
After connecting to your wireless network you should see output every minute as the sketch sends data to DynamoDB. In particular look for an 'HTTP/1.1 200 OK' response value to ensure the hardware is successfully writing to DynamoDB.
If you see an error like 'HTTP/1.1 403 Forbidden' or HTTP/1.1 400 Bad Request', double check your access keys, region, and host configuration is correct and try again.
Once the hardware is running you can setup a simple web page to visualize the data. Edit the index.html file in the webpage subdirectory of the CloudThermometer sketch folder. Add the read only user's access key and secret access key values in the appropriate spot noted in the comments. Also set the region value to the same region value as used in the cloud thermometer sketch.
Save the updated index.html and navigate to the folder in a terminal window. If you have Python 2 installed, enter the command:
python -m SimpleHTTPServer
Otherwise if you have Python 3 installed, enter:
python3 -m http.server
This will run a small HTTP server to serve the index.html page to your web browser. Open http://localhost:8000/ in a browser to see the cloud thermometer web page. Select your measurement ID value to view the temperature graph.
Continue on to see ideas for future enhancements to the project.
Page last edited November 21, 2013
Text editor powered by tinymce.