loading

Lets get right into this. I was logging temperature of a room to an Excel sheet via Serial.print commands, then importing CSV files and yada yada. I couldn't get to the data unless I was at home, and also I had to leave my computer running in order to log the data. I needed a better way to log temperature (or anything for that matter) and be able to access it from anywhere.

Google Docs is a great free service that fits the bill perfect. There are tons of tutorials showing how to do this HOWEVER they are all out of date due to Google changing things up on their forms. So I am here to re-write everything I learned to help you get started and logging real time to the internet.

You will need:

Arduino R3

Ethernet shield (probably can be done with a YUN or WiFi, but I used Ethernet.)

** I added a screen shot of my dashboard which displays all the data that I am collecting. This is all based on 3 temperature sensors.**

Step 1: Get Accounts (FREE)

Get the required accounts:

1. Google. Get a google account. its 2014, you should probably have one by now. FREE

2. Get a pushingbox account via pushingbox.com. FREE and it uses you google account for user info.

Step 2: Create a Google Form and Get FORM KEY

Inside of google Drive you can create a 'Form' . For the sake of making this simple. I will create a single question TEXT response form as shown. When that is complete, click send form.

A screen will pop up which will have the option to show URL. Click that then Copy the URL that it spits out. Paste that into your web browser and you will find yourself at the form you created.

From here you will need to right click and select 'Inspect Elements'. This will load the HTML code for the form. You are looking for the line of code that is defining the Text input box. You will find a section of the code that is "entry.12734623852784" (numbers are dependent on your form, I typed nonsense) Take note of this. I will be referring to this as "FORM KEY"

Step 3: Pushingbox, Service and Scenarios

Head over to pushingbox.com and log in with the same google information that you created the form with.

Go to My Services and create a new custom service. You will need to go to your google form and submit a response. This will load the response page of your form. Copy this URL and paste it into the pushingbox Service URL field. Name it whatever you want and set method to GET.

Done.

Now go to my scenarios. This is where the FORM KEY will be used. Following my template, past this into the scenarios field to add:

?entry.1917223082=$status$&submit=Submit Change the bold text with your FORM KEY that you gathered in step 2. Leave the ? and the other stuff, just replace the bold with your stuff. Now copy that whole string and past into the add scenario field. Now click ADD. Then it will say nice job! or something positive like that. Click ADD AN ACTION. Then select the Service you created only moments ago.

This will give you a DEVICE ID remember this, in fact. write it down or copy and paste it into a notepad doc. This will be used in the Arduino code.

Congrats, you are done with that and now its time to code the Arduino.

Step 4: CODE THE ARDUINO

I have attached my very simple code to run this example. You will find a section of things to be edited. This code will send responses to the form you created in the form of data. You will see google then creates a spreadsheet and logs all the responses WITH time stamps! Use this to create data logs of temperature, light levels, humidity, motion whatever you want! The example attached uses a DHT11 thermo/humidity sensor. Can easily be modified for something else.

I hope this lets you walk through the steps and get some data posted to the web.

Thanks

<p>Thank you so much for the easy-to-follow instructable!</p><p>I only have one single tiny question: Instead of pushing data into a spreadsheet, I need to read it. What should I change in the code to allow the arduino to read the spreadsheet?</p><p>Thanks for your time! :)</p>
<p>I asked a question earlier but deleted it because I found the answer below. However, I have a new question! LOL How do I go about submitting multiple entries? I want humidity, heat index, temperature, and lux to be sent. More will be added later. I don't fully understand the comment below asking about 3 entries. It would be fantastic if you spelled it out for me how you are using multiple commands as you mentioned, or how to go abou using one command? Either or is fine (if I can make it work on my end). If you could just show me how to go about sending my current variable, f, along with the variable h, I think I can take it further and apply it to all the variables I will ultimately be using. Thanks! <br><br><br> Here is my code, by the way, as adapted for the WiFly library. I'm using an Uno and the Seeeduino WiFi Shield V2.0. This code works (for me) and is only sending one variable for one form question. As detailed in comments below, I am multiplying my float values by 100 and converting to int (for some reason it really didn't like using %f for float). I also made the necessary adjustments to devid and changing %c to %s for string. What you see below is an integration of four different modules, so far. I'm ultimately going to be adding 2 or 3 more sensors, as well as integrating the code with operation of a Relay Shield:<br><br>#include &lt;Adafruit_Sensor.h&gt;</p><p>#include &quot;DHT.h&quot;</p><p>#include &lt;SoftwareSerial.h&gt;</p><p>#include &quot;WiFly.h&quot;</p><p>#include &quot;WiFlyClient.h&quot;</p><p>#include &lt;SPI.h&gt;</p><p>#undef int</p><p>#undef abs</p><p>#undef double</p><p>#undef float</p><p>#undef round</p><p>#define DHTPIN 8 // Digital pin 8 does not conflict with wifi shield or relay shield</p><p>#define DHTTYPE DHT22 // Digital Temp/Humidity Sensor</p><p>#define SENSORPIN A0 // Analog Light Sensor Pin</p><p>#define SSID &quot;myssid&quot;</p><p>#define KEY &quot;mypassword&quot;</p><p>#define AUTH WIFLY_AUTH_WPA2_PSK</p><p>char devid[] = &quot;XXXXXXXX&quot;; // THIS IS THE DEVICE ID FROM PUSHINGBOX</p><p>float rawRange = 1024; // 3.3v</p><p>float logRange = 5.0; // 3.3v = 10^5 lux</p><p>int k=0;</p><p>char postmsg[100];</p><p>char server[] = &quot;api.pushingbox.com&quot;;</p><p>SoftwareSerial wiflyUart(2, 3); // create a WiFi shield serial object</p><p>WiFly wifly(&amp;wiflyUart); // pass the wifi siheld serial object to the WiFly class</p><p>DHT dht(DHTPIN, DHTTYPE);</p><p>void setup()</p><p>{</p><p> analogReference(EXTERNAL);</p><p> wiflyUart.begin(9600); // start wifi shield uart port</p><p> Serial.begin(9600);</p><p> Serial.println(&quot;Testing Integrations&quot;);</p><p> // wait for initilization of wifly</p><p> delay(1000);</p><p> wifly.reset(); // reset the shield</p><p> delay(1000);</p><p> //set WiFly params</p><p> wifly.sendCommand(&quot;set ip local 80\r&quot;); // set the local comm port to 80</p><p> delay(1000);</p><p> wifly.sendCommand(&quot;set comm remote 0\r&quot;); // do not send a default string when a connection opens</p><p> delay(1000);</p><p> wifly.sendCommand(&quot;set comm open *OPEN*\r&quot;); // set the string that the wifi shield will output when a connection is opened</p><p> delay(1000);</p><p> Serial.println(&quot;Join &quot; SSID );</p><p> if (wifly.join(SSID, KEY, AUTH)) {</p><p> Serial.println(&quot;OK&quot;);</p><p> } else {</p><p> Serial.println(&quot;Failed&quot;);</p><p> }</p><p> /*</p><p>wifly.sendCommand(&quot;get ip\r&quot;);</p><p> char c;</p><p> while (wifly.receive((uint8_t *)&amp;c, 1, 300) &gt; 0) { // print the response from the get ip command</p><p> delay(50);</p><p> }</p><p> wifly.sendCommand(&quot;get ip\r&quot;);</p><p> while (wifly.receive((uint8_t *)&amp;c, 1, 300) &gt; 0) { // print the response from the get ip command</p><p> Serial.print((char)c);</p><p> delay(50);</p><p> }</p><p> */</p><p> Serial.println(&quot;Web server ready&quot;);</p><p> dht.begin();</p><p>}</p><p>void loop(){</p><p> // read the raw value from the sensor twice to get 2000ms delay:</p><p> int rawValue = analogRead(SENSORPIN); </p><p> Serial.print(&quot;Raw = &quot;);</p><p> Serial.print(rawValue);</p><p> Serial.print(&quot; - Lux = &quot;);</p><p> Serial.println(RawToLux(rawValue)); </p><p> delay(1000);</p><p> // Reading temperature or humidity takes about 250 milliseconds!</p><p> // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)</p><p> float h = dht.readHumidity();</p><p> // Read temperature as Fahrenheit (isFahrenheit = true)</p><p> float f = dht.readTemperature(true);</p><p> // Check if any reads failed and exit early (to try again).</p><p> if (isnan(h) || isnan(f)) {</p><p> Serial.println(&quot;Failed to read from DHT sensor!&quot;);</p><p> return;</p><p> }</p><p> // Compute heat index in Fahrenheit (the default)</p><p> float hif = dht.computeHeatIndex(f, h);</p><p> Serial.print(&quot;Humidity: &quot;);</p><p> Serial.print(h);</p><p> Serial.print(&quot; %\t&quot;);</p><p> Serial.print(&quot;Temperature: &quot;);</p><p> Serial.print(f);</p><p> Serial.print(&quot; *F\t&quot;);</p><p> Serial.print(&quot;Heat index: &quot;);</p><p> Serial.print(hif);</p><p> Serial.println(&quot; *F&quot;);</p><p> // Post to Google Form.............................................</p><p> Serial.println(&quot;Attempting to post data to form&quot;);</p><p> if (wifly.connect(server, 80)) </p><p> {</p><p> k=0;</p><p> Serial.println(&quot;connected&quot;);</p><p> sprintf(postmsg,&quot;GET /pushingbox?devid=%s&amp;status=%d HTTP/1.1&quot;,devid,int(f*100)); // NOTE** In this line of code you can see where the temperature value is inserted into the wed address. It follows 'status=' Change that value to whatever you want to post.</p><p> wifly.println(postmsg);</p><p> wifly.println(&quot;Host: api.pushingbox.com&quot;);</p><p> wifly.println(&quot;Connection: close&quot;);</p><p> wifly.println();</p><p> Serial.println(postmsg);</p><p> Serial.println(&quot;Host: api.pushingbox.com&quot;);</p><p> Serial.println(&quot;Connection: close&quot;);</p><p> Serial.println();</p><p> delay(1000);</p><p> } else {</p><p> Serial.println(&quot;failed.&quot;);</p><p> k=1;</p><p> }</p><p> delay(1000); </p><p>}</p><p>//function declarations</p><p>float RawToLux(int raw)</p><p>{</p><p> float logLux = raw * logRange / rawRange;</p><p> return pow(10, logLux);</p><p>}</p>
<p>Currently, I found a workaround where I use if else statements. I have it set up to check if number of iterations is 0. if yes, send humidity data. else, if number of iterations is 1, send temperature data. I end with an else statement that sets iterations back to 0 so that the iteration count resets once I've systematicaly sent all the data i wanted to send. It's a bit of a bear to look at code-wise, but it works. I'm sending data for 4 different questions. Still, I'd really like to know a concise way to go about this. Thanks!</p>
<p>I have mine sending 3 commands currently at home. I will send you the code I used for that and show how I just copied the section of code 3 times and changed some variables. </p>
<p>I actually figured it out. Thanks for posting this! My senior design project was quite successful, and I owe it to this Instructable and other open-source modules such as this. Thank you so much!</p>
<p>If you set up enough variables to accept more sensors you can then set up a google form to ask for multiple questions. One question for each sensor input. So you would just repeak the same steps for each form question. Generate a new scenario in pushing box for each as if they were separate. Then in the Arduino code you just copy this section however many times you need:</p><p>if (wifly.connect(server, 80))</p><p>{</p><p>k=0;</p><p>Serial.println(&quot;connected&quot;);</p><p>sprintf(postmsg,&quot;GET /pushingbox?devid=%s&amp;status=%d HTTP/1.1&quot;,devid,int(f*100)); // NOTE** In this line of code you can see where the temperature value is inserted into the wed address. It follows 'status=' Change that value to whatever you want to post.</p><p>wifly.println(postmsg);</p><p>wifly.println(&quot;Host: api.pushingbox.com&quot;);</p><p>wifly.println(&quot;Connection: close&quot;);</p><p>wifly.println();</p><p>Serial.println(postmsg);</p><p>Serial.println(&quot;Host: api.pushingbox.com&quot;);</p><p>Serial.println(&quot;Connection: close&quot;);</p><p>Serial.println();</p><p>delay(1000);</p><p>} else {</p><p>Serial.println(&quot;failed.&quot;);</p><p>k=1;</p><p>}</p><p>Might take some clean up but thats essentially how I have mine set up to run multiple. I saw some people below got it done with a single command but I didn't try that. </p>
<p>How would you change the code so that a moisture sensor can be used? Or which part of the code must be changed?</p>
<p>You would change the temperature read section. Switch over to reading the moisture sensor and pass along the correct variables. </p>
<p>This is what I changed it to. Is it correct?</p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;Ethernet.h&gt;</p><p>#include &lt;EthernetUdp.h&gt;</p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;dht11.h&gt;</p><p>#undef int</p><p>#undef abs</p><p>#undef double</p><p>#undef float</p><p>#undef round</p><p>dht11 DHT11;</p><p>#define DHT11PIN 3</p><p>///////////////////////////////</p><p>/// EDIT THIS STUFF //</p><p>///////////////////////////////</p><p>byte mac[] = {b8:27:eb:4a:9e:87 }; //Replace with your Ethernet shield MAC</p><p>byte ip[] = {123,456,7,890}; // Your Arduino device IP address</p><p>char devid = v1A7BB8AE7429BCA // THIS IS THE DEVICE ID FROM PUSHINGBOX</p><p>int del=300; // Amount of seconds delay between posting to google docs.</p><p>///////////////////////////////</p><p>// DONE EDITING //</p><p>///////////////////////////////</p><p>char postmsg[100];</p><p>int k=0;</p><p>int temp_av = 0;</p><p>char server[] = &quot;api.pushingbox.com&quot;;</p><p>EthernetClient client;</p><p>void setup()</p><p>{</p><p> Serial.begin(9600);</p><p> Ethernet.begin(mac, ip);</p><p> delay(1000);</p><p> Serial.println(&quot;connecting...&quot;);</p><p>}</p><p>void loop(){</p><p> // average temp reading for 'del' time.........................................</p><p> for(int j=0; j&lt;del;j++)</p><p> {</p><p>// Read local temp........................................</p><p>int sensorPin = 0; // select the input pin for the potentiometerint sensorValue = 0; // variable to store the value coming from the sensorvoid setup() { // declare the ledPin as an OUTPUT: Serial.begin(9600); }void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); delay(1000); Serial.print(&quot;sensor = &quot; ); Serial.println(sensorValue); }</p><p> // Post to Google Form.............................................</p><p> if (client.connect(server, 80))</p><p> {</p><p>k=0;</p><p> Serial.println(&quot;connected&quot;);</p><p>sprintf(postmsg,&quot;GET /pushingbox?devid=%c&amp;status=%d HTTP/1.1&quot;,devid,sensorValue); // NOTE** In this line of code you can see where the temperature value is inserted into the wed address. It follows 'status=' Change that value to whatever you want to post.</p><p>client.println(postmsg);</p><p>client.println(&quot;Host: api.pushingbox.com&quot;);</p><p>client.println(&quot;Connection: close&quot;);</p><p>client.println();</p><p>Serial.println(postmsg);</p><p>Serial.println(&quot;Host: api.pushingbox.com&quot;);</p><p>Serial.println(&quot;Connection: close&quot;);</p><p>Serial.println();</p><p>delay(1000);</p><p>client.stop();</p><p> }</p><p> delay(1000);</p><p> if (!client.connected())</p><p> {</p><p>Serial.println();</p><p> Serial.println(&quot;disconnecting.&quot;);</p><p>client.stop();</p><p>k==1;</p><p>return;</p><p> }</p><p>}</p>
<p>You need to do some clean up, you have two setup() and loop() functions shown. The idea looks right if your moisture sensor is on pin 0. Just collect data from the moisture sensor and assign it to a variable. Then send that variable accross to pushing box. Looks like you replaced the avtemp variable with sensor variable so that's good. I say do a little clean up and give it a go. </p>
<p>I'm sorry for all the questions! </p><p>char postmsg[100];</p><p>int k=0;</p><p>int temp_av = 0;</p><p>char server[] = &quot;api.pushingbox.com&quot;;</p><p>EthernetClient client;</p><p>void setup()</p><p>{</p><p> Serial.begin(9600);</p><p> Ethernet.begin(mac, ip);</p><p> delay(1000);</p><p> Serial.println(&quot;connecting...&quot;);</p><p>for(int j=0; j&lt;del;j++)</p><p>int sensorPin = 0; // select the input pin for the potentiometerint sensorValue = 0; // variable to store the value coming from the sensor }</p><p>void loop(){</p><p>// Read local temp........................................</p><p> // read the value from the sensor: </p><p> sensorValue = analogRead(sensorPin); </p><p> delay(1000); </p><p> Serial.print(&quot;sensor = &quot; ); </p><p> Serial.println(sensorValue); }</p><p>Is the setup okay?</p>
<p>You need ethernet for the code to work. </p>
<p>What exactly is a arduino device IP?</p>
<p>Additionally, is an ethernet shield board required for the code to work? </p>
<p>Thanks. Really well explained and has allowed me to add data logging to my home automation system.</p>
<p>Glad it helped! thanks! </p>
<p>Hi,</p><p>I modified your code to work with my digital read sensor and the wifi client but when the sketch runs nothing gets entered into the spreadsheet (Pushingbox test inserts &quot;$status$&quot;) </p><p>Serial prints out:</p><p>connected</p><p>GET /pushingbox?devid=�&amp;status=1 HTTP/1.1</p><p>Host: api.pushingbox.com</p><p>Connection: close</p><p>My code:</p><p><a href="https://create.arduino.cc/editor/Bernstern/f785f945-2c9c-4cab-91f9-0b7e65b938ef/preview" rel="nofollow">https://create.arduino.cc/editor/Bernstern/f785f94...</a></p><p>Any help would be greatly appreciated!</p>
<p>Your sendtopushingbox() function is messed up. Go back to the code I supplied and look how I have it set up during the push command. Try re-writting that section of code. </p>
<p>Hi, </p><p>i could not find Device ID as you suggested, what i got is in the following picture </p>
<p>Past this string in the Data field:</p><p>?<u><em>entry.1917223082</em></u>=$status$&amp;submit=Submit</p><p>Make sure you update it to match your data. This is the same string you used a few steps earlier. Let me know if this helps. </p>
<p>It didn't worked for me. </p><p>Even when I tried test scenario, it pinged on pushingbox but didn't send any data to spreadsheet.</p><p>Kindly help.</p><p>Thanks in advance :) </p>
<p>Look at the Arduino code: </p><p>change:</p><p>char devid = fskjfnfnvkjsdnf to char devid[] = &quot;fskjfnfnvkjsdnf&quot;</p><p>Note: this is not a real devid, just use the format. Give that a try and let me know if that works for you.</p>
<p>It didn't worked for me. </p><p>Even when I tried test scenario, it pinged on pushingbox but didn't send any data to spreadsheet.</p><p>Kindly help.</p><p>Thanks in advance :) </p>
<p>Please go back and verify all the data you have entered is correct. One typo will prevent the system from working. This is often the cause of errors from what I have seen below. I am assuming this because you are not dealing with the Arduino yet, this is just pushing box to google which should work no problem. </p>
<p>Reading through other comments, I figured out the problem.</p><p>Thanks a lot for this simple yet powerful intractable.</p>
<p>What was the issue you found? </p>
<p>I am using this url in my browser to test it : <a href="http://api.pushingbox.com/pushingbox?devid=v7550351D3217B73&status=21" rel="nofollow"> http://api.pushingbox.com/pushingbox?devid=v75503...</a> </p><p>Still, on pushingbox dashboard it shows in history, but doesn't upload anything in spreadsheet.</p>
<p>Thanks for your prompt reply.</p><p>Ok, I'll try it out again, double checking my spells. And yes, till now I have not started with arduino and am only stuck at pushingbox.</p>
<p>Hi.</p><p>I used this to take in data from my sensor (TMP37) but it did not print out to my google docs. I need help!</p>
<p>Are you getting anything sent to google docs? Do you know if pushingbox is making its connection?</p>
<p>Hi</p><p>How submit form with 3 fields</p><p>thks</p>
<p>I am currently doing this using three separate commands. I am sure there is a way to do it in one string but I didnt have the time to figure it out so I just copied code and had it run three times answering three different questions on the form. </p>
<p>Hi, thanks your instruction, without it, I have no ideas how to done my project, very apriciate. About my question, I figure out. In String command, $status$ is a name of variable and you can insert as many variables as you want, you can add more like ?entry.1111=$status1$&amp;entry2222=$status2$&amp;entry3333=$status3$&amp;.....&amp;submit=Submit</p><p>? = GET request. I done with this, maybe update your instruction if you need</p>
<p>Great! Thank you. I will give it a try on my end and update the page for others. </p>
Some people here use ThingSpeak for this. May anyone here help me? I am struggling to fill the Google form using the ThingSpeak data
Use thingspeak.com<br><br>It's easy
how to use ThingSpeak for this? I'm struggling to do this using ThingSpeak
<p>Hi,</p><p>First of all, thank you for your much useful instructable. I am trying to send the data to the pushingbox through a sim900a gprs modem. I am using Arduino Mega 2560. I have followed your instructions step by step. But when i send the GET command, I am neither receiving it on the Pushingbox Dashboard, nor it is going to the google forms. </p><p>This is my instruction set.</p><p>AT+SAPBR=3,1,&quot;CONTYPE&quot;,&quot;GPRS&quot;</p><p>AT+SAPBR=3,1,&quot;APN&quot;,&quot;airtelgprs.com&quot;</p><p>AT+SAPBR=1,1</p><p>AT+SAPBR=1,2</p><p>AT+HTTPINIT</p><p>AT+HTTPPARA=&quot;CID&quot;,1&quot;</p><p>AT+HTTPPARA=&quot;CONTENT&quot;,&quot;application/x-www-form-urlencoded&quot;</p><p>AT+HTTPPARA=&quot;URL&quot;,&quot;www.api.pushingbox.com&quot;</p><p>strcpy(postmsg,&quot;GET /pushingbox?devid=&quot;); <br> strcat(postmsg,devid);<br> strcat(postmsg,&quot;&amp;PANEL1=&quot;);<br> strcat(postmsg,&quot;1234&quot;);<br> strcat(postmsg,&quot; HTTP/1.1&quot;);<br> Serial1.println(postmsg);<br> Serial.println(postmsg);<br> Serial1.println(&quot;Host:api.pushingbox.com&quot;);<br> Serial1.println(&quot;Connection:closed&quot;);<br> Serial1.println();</p><p>I am not sure if this is right. I have seen tutorials only with ethernet client and not with gprs. Can you please guide me?</p>
<p>I am not familiar with GPRS, sorry. Perhaps another user can help out. I would suspect that if you are getting an internet connection you should be able to follow the remainder of the steps. I would go through and double/triple check your inputs to the fields. That has always been a speed bump it seems. One error will cause the links to not work at all, so give that a try and just go through it all again. </p>
<p>Hi,</p><p>I am able to ping pushingbox to send a ping to google spreadsheet but its not sending information i'm telling it to.</p><p>If I'm understanding correctly this line of code below is suppose to be communicating directly with pushingbox which would be sending the information corresponding with the %d after the status=....in my case that would be k.</p><p>sprintf(postmsg,&quot;GET /pushingbox?devid=v47263B63634C37E&amp;status=%d HTTP/1.1&quot;,k);</p><p>I suppose my question would be what do we type into data under My Scenarios to obtain the data from that string of text above?</p>
<p>See the below question from ShakirS. He had the same question.</p>
<p>Well done on the instructable! I have copied/stolen/re-used this in a recent project I've done and you saved me a good deal of time in being able to upload stuff to google docs (<a href="https://www.hackster.io/khalidaabdulla/wi-fi-power-toggler-0ed04a" rel="nofollow">https://www.hackster.io/khalidaabdulla/wi-fi-power-toggler-0ed04a</a>).</p><p><br>I couple of minor changes I had to make to the code to get it to work for me:</p><p>char devid[] = &quot;myOwnDeviceID&quot;</p><p>As well as obviously replacing the device ID with my own, I needed to put it in double quote marks (&quot;&quot;). I also needed to declare devid as a character array (char devid[]), rather than just a character (char devid) as given in the sketch.</p><p>Linked to this, I needed to change the sprintf command to:</p><p>sprintf(postmsg,&quot;GET /pushingbox?devid=%s&amp;status=%d HTTP/1.1&quot;,devid,avtemp);</p><p>With a (%s) field to include the character array devid[] (rather than the %c field in the original sketch).</p><p>Other than that worked a charm. P.S. I'm not claiming the above are mistakes/bugs; just saying I needed to make those changes for it to work for me ;)</p>
<p>Glad to hear it helped you get your project going! Great feedback!</p>
<p>Is there any way to read data from spreadsheet using arduino?</p>
<p>Not that I have been able to find with this method. For my example above, I would like to adjust a thermostat setpoint from the spreadsheet but cannot find away. I see below another user recommended thingspeak. I am not familiar enough with using it to say it can handle doing calculations and data extraction like a spreadsheet can, but that would allow communication back and forth I believe. </p>
<p>Hi, would appreciate any help you can offer to get me logging my data to the Google form... </p><p>I am getting entries on my PushingBox dashboard....but nothing ever makes it over to the Google form. My thoughts/questions below:</p><p><strong>1.Does the data showing up on PushingBox look right? (i am surprised it doesn't show my temperature value)</strong></p>Dashboard<div>History 7403 February 2016 at 23:14:00<p><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow">?entry.1469692867=$status$&amp;submit=Submit</a></p>3 February 2016 at 23:13:42<p><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow"><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow">?entry.1469692867=$status$&amp;submit=Submit</a></a></p>3 February 2016 at 23:13:24<p><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow"><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow">?entry.1469692867=$status$&amp;submit=Submit</a></a></p>3 February 2016 at 23:13:06<p><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow"><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow">?entry.1469692867=$status$&amp;submit=Submit</a></a></p>3 February 2016 at 23:12:49<p><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow"><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow">?entry.1469692867=$status$&amp;submit=Submit</a></a></p>3 February 2016 at 23:12:31<p><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow"><a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529" rel="nofollow">?entry.1469692867=$status$&amp;submit=Submit</a></a></p></div><p><strong>2.My Scenario in PushingBox might no be right.....in particular, what should I have listed in the &quot;Data&quot; field?</strong> (I see this question in an earlier post...but not 100% clear that this is what I should have listed)</p>Scenarios<p><br></p><div><div><div>?Entry.1469692867=$Status{replace0}amp;Submit=Submit <a href="https://www.pushingbox.com/scenarios_edit.php?scenario_ID=55529&action=rename" rel="nofollow">Rename</a>DeviceID: v8D8BBC825D87B0DDeactivate <a href="https://www.pushingbox.com/scenarios_test.php?scenario_ID=55529" rel="nofollow">Test Scenario</a> Temperature Computer DeskData: entry.1469692867=$status$&amp;submit=Submit</div></div></div><p><strong><br></strong></p><p><strong><br></strong></p><p><strong>3.My Arduino Uno program is:</strong></p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;Ethernet.h&gt;</p><p>#include &lt;EthernetUdp.h&gt;</p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;dht11.h&gt; </p><p>#undef int</p><p>#undef abs</p><p>#undef double</p><p>#undef float</p><p>#undef round</p><p>dht11 DHT11;</p><p>#define DHT11PIN 3</p><p>///////////////////////////////</p><p>/// EDIT THIS STUFF //</p><p>///////////////////////////////</p><p>byte mac[] = {0x90, 0xA2, 0xDA, 0x1D, 0xE2, 0xB3 }; //Replace with your Ethernet shield MAC</p><p>byte ip[] = {192,168,1,49}; // Your Arduino device IP address</p><p>char devid = 'v8D8BBC825D87B0D'; // THIS IS THE DEVICE ID FROM PUSHINGBOX</p><p>int del=15; // Amount of seconds delay between posting to google docs.</p><p>///////////////////////////////</p><p>// DONE EDITING //</p><p>///////////////////////////////</p><p>char postmsg[100];</p><p>int k=0;</p><p>int temp_av = 0;</p><p>char server[] = &quot;api.pushingbox.com&quot;;</p><p>EthernetClient client;</p><p>void setup()</p><p>{</p><p> Serial.begin(9600);</p><p> Ethernet.begin(mac, ip);</p><p> delay(1000);</p><p> Serial.println(&quot;connecting...&quot;);</p><p>}</p><p>void loop(){</p><p> // average temp reading for 'del' time.........................................</p><p> for(int j=0; j&lt;del;j++)</p><p> {</p><p> // Read local temp........................................</p><p> int temp = 55;</p><p> temp_av=temp_av+temp;</p><p> delay(1000);</p><p> }</p><p> int avtemp=temp_av/(del);</p><p> temp_av=0;</p><p> // Post to Google Form.............................................</p><p> if (client.connect(server, 80)) </p><p> {</p><p> k=0;</p><p> Serial.println(&quot;connected&quot;);</p><p> sprintf(postmsg,&quot;GET /pushingbox?devid=v8D8BBC825D87B0D&amp;status=%d HTTP/1.1&quot;,avtemp); // NOTE** In this line of code you can see where the temperature value is inserted into the wed address. It follows 'status=' Change that value to whatever you want to post.</p><p> client.println(postmsg);</p><p> client.println(&quot;Host: api.pushingbox.com&quot;);</p><p> client.println(&quot;Connection: close&quot;);</p><p> client.println();</p><p> Serial.println(postmsg);</p><p> Serial.println(&quot;Host: api.pushingbox.com&quot;);</p><p> Serial.println(&quot;Connection: close&quot;);</p><p> Serial.println();</p><p> delay(1000);</p><p> client.stop();</p><p> }</p><p> delay(1000);</p><p> if (!client.connected()) </p><p> {</p><p> Serial.println();</p><p> Serial.println(&quot;disconnecting.&quot;);</p><p> client.stop();</p><p> k==1;</p><p> return;</p><p> }</p><p>}</p><p><strong>4. When I run the program, my serial monitor looks like:</strong></p><p>disconnecting.</p><p>connected</p><p>GET /pushingbox?devid='v8D8BBC825D87B0D'&amp;status=55 HTTP/1.1</p><p>Host: api.pushingbox.com</p><p>Connection: close</p><p>disconnecting.</p><p>connected</p><p>GET /pushingbox?devid='v8D8BBC825D87B0D'&amp;status=55 HTTP/1.1</p><p>Host: api.pushingbox.com</p><p>Connection: close</p><p>disconnecting.</p><p>connected</p><p>GET /pushingbox?devid='v8D8BBC825D87B0D'&amp;status=55 HTTP/1.1</p><p>Host: api.pushingbox.com</p><p>Connection: close</p><p>Thanks for any help you can offer!</p>
<p>You will need to add the following line to your scenario in pushingbox under the 'Data' tab. Follow the instructions in Step 3 when you see this line. </p><p>?<u><em>entry.1917223082</em></u>=$status$&amp;submit=Submit </p><p>Looks like you did not perform this step correctly if you see data going to pushing box but not google. A test can be performed if you run the scenario after you create it, this is run it as if the arduino is telling it to. If this does not work you need to redo the step. </p><p>Double/triple check all inputs from that step on. </p><p>Keep me posted</p>
<p>Thanks ezoom....your good advice helped me to find my error! It is now working great!</p><p>Turns out I had used the wrong URL to paste into the PushingBox service....I was [erroneously] using the URL from the page to enter the data into the form, however you must use the URL from the page you get <strong>AFTER</strong> you make an entry into the form (e.g. the acknowledgement page).</p><p>Thanks again!</p>
<p>Glad it is working for you! </p>
<p>Hi there. This is a great instructable. thank you. </p><p>When i read yr intro. about needing to leave the computer on to log temps etc. and wanting arduino to do it on it's own, i thought that is me EXACTLY! :)</p><p>OK/ I have ALMOST got it working. The arduino is populating the GoogleSheet BUT even though avtemp is for example 24.2 degrees (and pretty stable + or - 0.1 degree), the google spreadsheet is being populated with -17476 then -26215, then 26215 then 26215 again, and so on. </p><p>Weird, right? The one thing that stumped me was that the URL has to have /formResponse ending so i jumped in to the URL with the /edit ending, and manually changed it. I have double checked the formKeys and devIDs URLs. </p><p>Any ideas what i could try / what could it be?</p><p>thanks much!</p><p>dB</p>

About This Instructable

43,202views

88favorites

License:

More by ezoom404:Post to Google Docs with Arduino 
Add instructable to: