Project Description

 This article is an example of how to store and manage sensor data by using the Cloud service.

The Cloud service that I’d like to introduce is Dweet.io.

Dweet.io

The URL for Dweet.io is  https://dweet.io/

You can see the screen below when you click the above URL.

Introduction and direction of Dweet can be found at the bottom of the website.

dweet_1

For more information, take a quick tour.

To learn about Dweeting, click the [Play] button on the top menu.

Then click “/dweet/for/{thing}” on the next screen.

dweet_2

Then, fill out the value and content sections and click [Try it out!].

  • thing: unique ID (There will be a problem if the ID overlaps with other’s)
  • key: used for security (optional)
  • content: The content entered in thing ID section (sensor value in our case)

Since it is a test anyway, let me explain briefly. (Please don’t forget the ID)

dweet_3

 

Now we can get information about where to send the request and the response value.

The request should be used well.

So where should we find the response from the Cloud to this request?

Check out the link below and type your ID into the ID search box.

https://dweet.io/follow

 

dweet_4

It is more convenient if you add your ID to the URL instead of searching the URL the ordinary way.

For example, you can enter the following URL into your browser if your ID is YOURTHINGSNAME.

https://dweet.io/follow/YOURTHINGSNAME

 

The process so far was about how to find an unique ID and to understand how it works.

If you send a request using the http protocol, Dweet.io responds to the request.

이를 토대로 Dweet.io의 메인 화면으로 넘어가면 아래와 같은 설명을 볼 수 있는데, 우리는 이 부분을 아두이노 코드로 구현할 것입니다.

Based on this, you can find the following explanation from.

We will implement this part in the Arduino code.

 

dweet_5

 

 

Circuit Configuration

Board : WizArduino (or Arduino Board + Ethernet Shield2)

And I used the shield below; this part is optional, so you can configure the circuit separately without using this shield.

Since it is tutorial without dependence on the device, you can proceed without additional circuit configuration.

dweet_6

For using the shield above,

  • Ao : Variable Resistor
  • A1 : CDS SensorA2
  • A2 : Temperature Sensor(LM35)

The circuit configuration is as above.

 

Create a Request funtion to use in  Arduinon

We will proceed based on data of pins A0, A1, A2.

Source: https://create.arduino.cc/editor/OpusK/0b92d1a6-cae4-4c57-8aec-3cda547bcfc1/preview

 

POST /dweet/for/academytest?RESIS=Value&LIGHT=Value&TEMP=Value

Host: www.dweet.io

Connection: close

 

This is what you would request from the server using client.print(ln).

If you do this, you will be requesting dweet.io using the dweeting method described in the website.

In addition, I created a function void debugHTTPResponse(); to ensure that the response is correct.

If necessary, you can use it or delete it.


Code modification point

ID was created from Dweet homepage.

const char* server_dns = “www.dweet.io”;

const char* post_url = “POST /dweet/for/YOURTHINGSNAME?”;   // Change YOURTHINGSNAME

//const char* post_url = “POST /dweet/for/academytest?”; //example

 

If you look at the beginning of the full source, you’ll be able to find like above.

You can change YOURTHINGSNAME to the ID you created.

 

Just in case, I put an example where I commented out.

In my case, the ID used is “academytest”.

Other fixing points are explained in the comments and will not be discussed because they are dependent on the user’s configuration.

 

Run & Test

Once the upload to the board is complete, open the Serial monitor.

dweet_7

I also sent a request and got a response.

If you enter the URL in a web browser in the way you learned in the first section, you can view the data in graph form as shown below.

dweet_8

 

If you want to see the Dashboard, you can use the red box button above.

dweet_9