Project tutorial
How To Use TheAmplituhedron.com To Improve IoT Projects

How To Use TheAmplituhedron.com To Improve IoT Projects © GPL3+

Bring your ideas to life without considering that how to program a server to create a host for web communication using TheAmplituhedron.

  • 1,782 views
  • 0 comments
  • 9 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
M6hlqueeutbzfkhid4ph
Arduino Ethernet Shield 2
×1
20120702130508859
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Adafruit industries ada161 image 75px
Photo resistor
×1
MQ4 Gas Sensor
×1
Flame Sensor
×1
Hygrometer Sensor
×1
2-Way Relay
×3
13711 01
SparkFun ESP8266 Thing - Dev Board
Compatible with TheAmplituhedron.com so you can use it instead of Arduino Ethernet Shield.
×1
Nodemcu
NodeMCU ESP8266 Breakout Board
Compatible with TheAmplituhedron.com so you can use it instead of Arduino Ethernet Shield.
×1
Pi 3 02
Raspberry Pi 3 Model B
Compatible with TheAmplituhedron.com so you can use it instead of Arduino Ethernet Shield.
×1
Esp01
Espressif ESP8266 ESP-01
Compatible with TheAmplituhedron.com so you can use it instead of Arduino Ethernet Shield.
×1

Apps and online services

About this project

Description

TheAmplituhedron.com is my personal website I post some of my ideas on under three main section, which are Projects, Tools, Articles and I had been working on a free cloud system for approximately two months for sending and getting data over the Internet by communicating the devices such as Arduino Ethernet Shield 2, Raspberry Pi, ESP8266, NodeMCU or any device that is capable of making an HTTP request. Now, the cloud system of TheAmplituhedron.com is ready to run and this page guides you to create IoT projects with it.

To support my projects and articles, you can visit my website here :)

What is the cloud system of TheAmplituhedron.com?

The cloud system of TheAmplituhedron.com is a free service that handles server-side programming for web communication and its main purpose is to improve IoT projects. Furthermore, to manage your data packets is uncomplicated by using TheAmplituhedron.com as a host because of the unique path created by the cloud system of TheAmplituhedron.com for you.

Start using the cloud system of TheAmplituhedron.com by taking the following steps.

Sign Up

Please sign up for TheAmplituhedron.com to create your cloud page.

Go to your Dashboard

Please sign in and go to your dashboard.

Cloud Information Page

Cloud Information Page gives you more details to use the cloud system, please read it before going to your cloud page.

Program your device

If you need to get help to program your device, please go to Cloud Code Generator.

Open your cloud page to manage your data packets

Enter your personal cloud information

Now, TheAmplituhedron.com is ready to send and get data over the Internet

If you have issues to recall the last data packet you send to give a command to your devices, you can try the recovery system which is ready to save your commands permanently in the database.

Test Project

The code of the test project is created by Cloud Code Generator and modified using Arduino IDE.

  • Board --> Arduino Uno
  • Device --> Arduino Ethernet Shield 2
  • Communication Type --> Multi-Channel
  • Request Method --> Post

Code

Test Project CodeArduino
//  TESTING THE CLOUD SYSTEM OF THEAMPLITUHEDRON.COM 
//
//-TheAmplituhedron.com
//-Cloud System
//-Sending data to TheAmplituhedron.com
//-Getting data from TheAmplituhedron.com
//
//-By Kutluhan Aktar

//
// * For more information, please go to https://www.theamplituhedron.com/dashboard/cloud/
// * This is an example code file for Arduino Ethernet Shield 2 or ENC28J60.
//  * Do not forget to use percent-encoding reserved characters for the header. 
//  * Circuit:
//  * Ethernet shield attached to pins 10, 11, 12, 13
//
// CONNECTIONS:
//
// DHT11 Module
// Pin 2   -------------------------
//
// 2 Way Relay (1)
// Pin 3   -------------------------
// Pin 4   -------------------------
//
// 2 Way Relay (2)
// Pin 5   -------------------------
// Pin 6   -------------------------
//
// 2 Way Relay (3)
// Pin 7   -------------------------
// Pin 8   -------------------------
//
// Arduno Ethernet Shield
// Pin 10  --------------------------
// Pin 11  --------------------------
// Pin 12  --------------------------
// Pin 13  --------------------------
//
// LDR
// AO      -------------------------- 
//                             
// Flame Sensor 
// A1      --------------------------
//
// MQ4   Sensor
// A2      --------------------------
//
// Hygrometer Module
// A3      -------------------------- 
 
#include <SPI.h>
#include <Ethernet.h>
//Initial DHT11 library and create an object named dht to communicate with the sensor.
#include "DHT.h"
DHT dht;

byte mac[] = {
    0xDE,0xAD,0xBE,0xEF,0xFE,0xED  // Your MAC address has to be here.
};
IPAddress ip(192,168,1,21); // A valid IP address to make an HTTP request.

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

// Define the sensors variables and types.
float Sensor_1;
float Sensor_2;
int   Sensor_3;
int   Sensor_4;
int   Sensor_5;
int   Sensor_6;

/////////////////////////////////////////////////////////////
// Define the relays variables.
int Device_1 = 3;
int Device_2 = 4;
int Device_3 = 5;
int Device_4 = 6;
int Device_5 = 7;
int Device_6 = 8;
////////////////////////////////////////////////////////////

// Determine a string to collect the commands came from TheAmplituhedron.com.
String readString ;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  // Start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());

/////////////////////////////////////////////////////////////
// Determine the relay module's pins.
pinMode(Device_1,OUTPUT);
pinMode(Device_2,OUTPUT);
pinMode(Device_3,OUTPUT);
pinMode(Device_4,OUTPUT);
pinMode(Device_5,OUTPUT);
pinMode(Device_6,OUTPUT);
// Give HIGH value for the default.
digitalWrite(Device_1,HIGH);
digitalWrite(Device_2,HIGH);
digitalWrite(Device_3,HIGH);
digitalWrite(Device_4,HIGH);
digitalWrite(Device_5,HIGH);
digitalWrite(Device_6,HIGH);
//Connect Dht11 to data pin 2.
   dht.setup(2); 
////////////////////////////////////////////////////////////
}

void loop() {
 // It makes Arduino wait until the temperature and the humidity values are accurate.
 delay(dht.getMinimumSamplingPeriod());
 
  // Attach whatever data you want to send TheAmplituhedron.com
  Sensor_1 =  dht.getHumidity();
  Sensor_2 =  dht.getTemperature();
  Sensor_3 =  analogRead(A0); 
  Sensor_4 =  analogRead(A1);
  Sensor_5 =  analogRead(A2);
  Sensor_6 =  analogRead(A3);
   
  // Listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // An http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        
        // Add each data came from TheAmplituhedron.com to a string named readString.
        if (readString.length() < 110) {
          readString += c;
          //Serial.print(c);
         }
        Serial.println(readString);
            // If the line ends, initial a HTTP Request.
        if (c ==  '\n') {
      
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");;
          client.println("Content-Type:text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html style=""background-color:#002699;"">");
          client.println("<head>");
          client.println("<title>DeviceSide</title>"); // Header for the web page.
          client.println("<link rel=""icon"" href=""https://www.theamplituhedron.com/images/favicon.ico""></link>"); // Describe the name and icon of DeviceSide.
          client.println("</head>");
          client.println("<body>");
          // The hedron must be send with the get method.
                    client.println("<form action=""  https://www.theamplituhedron.com/dashboard/cloud/test.php?hedron=The hedron is here"" method=""post"" target=""_parent"">"); // Enter your cloud page address. *Hedron here when the post method is active.
           
                  client.println("<button type=""submit"" style=""position:absolute;top:5px;width:100%;height:200px;background-color:#eb2e00;color:white;"">DeviceSide</button>"); // When the DeviceSide button is clicked, the information is sent to TheAmplituhedron.com by the valid IP address. 
                    client.println("<input type=""hidden""  name=""Sensor-1"" value="" ");
                    client.println(Sensor_1);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-2"" value="" ");
                    client.println(Sensor_2);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-3"" value="" ");
                    client.println(Sensor_3);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-4"" value="" ");
                    client.println(Sensor_4);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-5"" value="" ");
                    client.println(Sensor_5);
                    client.println(" ""><br> ");
                    client.println("<input type=""hidden""  name=""Sensor-6"" value="" ");
                    client.println(Sensor_6);
                    client.println(" ""><br> ");
          client.println("</form>");
          client.println("</body>");
          client.println("</html>");
          
          break;
        }

      }
    }
    delay(1);
    // Close the connection:
    client.stop();

    // Define conditions for your system.
      //  Device-1, Device-2, Device-3, Device-4, Device-5 are the constant on or off type.
        if (readString.indexOf("?Device-1=ON") >0){ 
          // Condition here;
          digitalWrite(Device_1,LOW);
          }
        else if (readString.indexOf("?Device-1=OFF") >0){ 
          // Condition here;
          digitalWrite(Device_1,HIGH);
          }
        if (readString.indexOf("&Device-2=ON") >0){ 
          //  Condition here;
          digitalWrite(Device_2,LOW);
          }
        else if (readString.indexOf("&Device-2=OFF") >0){
          // Condition here;
          digitalWrite(Device_2,HIGH);
          }
        
        if (readString.indexOf("&Device-3=ON") >0){ 
          // Condition here;
          digitalWrite(Device_3,LOW);
          }
        else if (readString.indexOf("&Device-3=OFF") >0){  
          // Condition here;
          digitalWrite(Device_3,HIGH);
          }  
        if (readString.indexOf("&Device-4=ON") >0){
         // Condition here;
         digitalWrite(Device_4,LOW);
          }
        else if (readString.indexOf("&Device-4=OFF") >0){ 
          // Condition here;
          digitalWrite(Device_4,HIGH);
          }
        if (readString.indexOf("&Device-5=ON") >0){ 
          // Condition here;
          digitalWrite(Device_5,LOW);
          }
        else if (readString.indexOf("&Device-5=OFF") >0){
          // Condition here;
          digitalWrite(Device_5,HIGH);
          }
        
      //  Device-6 is the limitless text type.
        if (readString.indexOf("&Device-6=Hello") >0){ 
          // Condition here;
          digitalWrite(Device_6,LOW);
          }
        else if (readString.indexOf("&Device-6=By") >0){ 
          // Condition here;
          digitalWrite(Device_6,HIGH);
          }

        readString=""; // Start a new string.
  }
}

Schematics

Test Project
Cloud arduinoethernetshield prtvlelbj0

Comments

Similar projects you might like

IoT Blink - Getting started with IoT

Project showcase by AppShed Support

  • 3,995 views
  • 1 comment
  • 19 respects

Mozilla IoT WoT Gateway and ESP8266

Project tutorial by Giovanni Gentile

  • 2,729 views
  • 0 comments
  • 6 respects

Octopod: Smart IoT Home/Industry Automation Project

Project tutorial by Saksham Bhutani

  • 11,746 views
  • 9 comments
  • 39 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 43,118 views
  • 21 comments
  • 121 respects

IOT - Smart Jar Using ESP8266, Arduino and Ultrasonic Sensor

Project tutorial by Team Smazee

  • 9,650 views
  • 5 comments
  • 15 respects

KatLight - The Coolest IoT Wonderlamp

Project tutorial by remnis

  • 3,171 views
  • 4 comments
  • 11 respects
Add projectSign up / Login