Translate

Monitor Suhu dan PH serta Turbidity Kolam Ikan dan juga Fitur Pakan Otomatis via BLYNK 2.0 ESP32

Monitor Suhu dan PH serta Turbidity Kolam Ikan dan juga Fitur Pakan Otomatis via BLYNK 2.0 ESP32 


       Pada kesempatan kali ini saya akan menjelaskan mengenai bagaimana cara membuat sebuah alat yang dapat memonitor PH dan suhu air serta turbidity air pada kolam ikan, alat ini juga terdapat fitur yaitu jika pada jam yang telah ditentukan maka motor atau relay akan membuka pakan sehingga akan memberikan pakan otomatis di jam tertentu. untuk lebih jelasnya berikut adalah komponen dan kodingnya.



a. Komponen




b. Program Arduino IDE

#define BLYNK_TEMPLATE_ID "TMPL6URGWCTpo"
#define BLYNK_TEMPLATE_NAME "monitor kolam ikan"
#define BLYNK_AUTH_TOKEN "gR-atiO8n1ckW8NInocGTRkbKJpG4Ufe"
#define BLYNK_PRINT Serial  

#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
#include "RTClib.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#define ONE_WIRE_BUS 32  

RTC_DS3231 rtc;
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

LiquidCrystal_I2C lcd(0x27,16,2);

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

int jampagi,jamsiang,jamsore;
float TempC;
float pHValue;
int tds;
int adctds;
int adcPH;
int TempCx;
int pHValuex;
int ntux;
float ntufix;
int tanda = 0;
int kolam;
int tinggipakan;
int relayout = 25;
int relayout2 = 26;
int Secs;
int Minutes;
int Hours;
int motor;

BlynkTimer timer;

char ssid[] = "hotspothpku";
char pass[] = "123456789";


void sendSensor()
{
 Blynk.virtualWrite(V0, pHValue);
 Blynk.virtualWrite(V1, tds);
 Blynk.virtualWrite(V2, TempC);
 Blynk.virtualWrite(V3, motor);
 delay(1000);
}

void setup(){  
  
pinMode(relayout,OUTPUT);
digitalWrite(relayout,HIGH);

Wire.begin();  
sensors.begin();
Serial.begin(9600);
lcd.begin();  
lcd.clear(); 

rtc.begin();
rtc.adjust(DateTime(0, 0, 0, 6, 59, 50));
//rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  timer.setInterval(1000L, sendSensor);
}


void loop(){
DateTime now = rtc.now();

  Secs = now.second(); 
  Hours = now.hour(); 
  Minutes = now.minute(); 
       
 adcPH = analogRead(34); 
 pHValue = (adcPH - 936.84) / 100.283;

 adctds = analogRead(35);             
 tds = map(adctds, 4095, 50, 0, 1000);
 
  sensors.requestTemperatures();
  TempC = sensors.getTempCByIndex(0); // Celcius

if((Hours == 7)&&(tanda == 0)){
  tanda = 1;
  Blynk.logEvent("jam_makan_ikan");
}

if ((Hours == 13)&&(tanda == 1)){
  tanda = 2;
  Blynk.logEvent("jam_makan_ikan");
}

if ((Hours == 19)&&(tanda == 2)){
  tanda = 0;
  Blynk.logEvent("jam_makan_ikan");
}

if((pHValue > 6.5)&&(pHValue < 8.5)){
  digitalWrite(relayout,HIGH);
  }


if(pHValue < 6.5){
  digitalWrite(relayout,LOW);
  motor++; 
  Blynk.logEvent("kondisi_ph");
}

if(pHValue > 8.5){
  digitalWrite(relayout,LOW);
  Blynk.logEvent("kondisi_ph");
  motor++; 
}

if(tds > 500){
  digitalWrite(relayout,LOW);
  Blynk.logEvent("kondisi_tds");
  motor++; 
}

if(tds < 500){
  digitalWrite(relayout,HIGH); 
}

if((TempC > 25)&&(TempC < 30)){
  digitalWrite(relayout,HIGH);
  }
  
if(TempC < 25){
  digitalWrite(relayout,LOW);
  Blynk.logEvent("SUHU KURANG");
  motor++; 
}

if(TempC > 30){
  digitalWrite(relayout,LOW);
  Blynk.logEvent("SUHU LEBIH");
  motor++; 
}
  
  lcd.setCursor(0,0);
  lcd.print("P/T:");
  lcd.print(pHValue);
  lcd.print("/");
  lcd.print(tds);
  lcd.print("  ");

  lcd.setCursor(0,1);
  lcd.print("T:");
  lcd.print(TempC,1);
  lcd.print(" ");
  lcd.print(Hours);
  lcd.print(":");
  lcd.print(Minutes);
  lcd.print(":");
  lcd.print(Secs);
  lcd.print("  ");

  Blynk.run();
  timer.run();
  delay(200);
}



c. VIDEO HASILNYA




MONITOR ECG BPM DAN RESPIRASI SERTA SUHU TUBUH VIA IOT BLYNK 2.0

MONITOR ECG BPM DAN RESPIRASI SERTA SUHU TUBUH VIA IOT BLYNK 2.0


        Pada kesempatan kali ini saya akan mendemokan sebuah alat yang bisa memonitor ECG BPM dan respirasi serta suhu tubuh secara bergantian dalam satu alat. fitur dari alat ini yaitu mengguakan IOT Blynk 2.0 sehingga bisa dimonitor secara jarak jauh menggunakan internet. untuk lebih jelasnya berikut komponen dan kodingnya.



a. Komponen





b. Program Arduino IDE

#define BLYNK_TEMPLATE_ID "TMPL6p5131qBk"
#define BLYNK_TEMPLATE_NAME "baby inkubator"
#define BLYNK_AUTH_TOKEN "9lmYS6XNCggK7TwRS9rddlu7HNXUkWjo"
#define BLYNK_PRINT Serial  
  
#include <Wire.h>
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 0  

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
LiquidCrystal_I2C lcd(0x27,16,2);

int n = 0;
int bpm = 0;
int x = 0;
int buzzer = D6;
int respirasipin;
int bpmku;
int respirasiku;

int m = 0;
int resp = 0;
int w = 0;

int suhux = 0;
int bpmx = 0;
float TempC;
int gsrz;
int suhuz;
int bpmz;
int respirasiz;

BlynkTimer timer;
char ssid[] = "hotspothpku";
char pass[] = "123456789";

void sendSensor()
{
 Blynk.virtualWrite(V0, bpmku);
 Blynk.virtualWrite(V2, respirasiku);
 Blynk.virtualWrite(V1, TempC);
 delay(1000);
}

void setup() {
 
  Serial.begin(9600);
  pinMode(buzzer,OUTPUT);
  pinMode(D5,INPUT_PULLUP);
  digitalWrite(buzzer,LOW);
  lcd.begin();
  lcd.clear();
  lcd.noCursor();
  Wire.begin();  
  sensors.begin();
  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  timer.setInterval(1000L, sendSensor);
 
}

void loop() {
n = 0;
m = 0;
bpm = 0;
resp = 0;

tampilbpm();
tampilrespirasi();
tampilsuhu();

  lcd.setCursor(0, 0);
  lcd.print("BPM: ");
  lcd.print(bpmku);
  lcd.print(" / ");
  lcd.print(TempC);
  lcd.print("   ");
  
  lcd.setCursor(0, 1);
  lcd.print("RESP = ");
  lcd.print(respirasiku);

Blynk.run();
timer.run();

delay(3000);
lcd.clear();        
}

void tampilbpm(){
n = n + 1;

  int dataadc1 = analogRead(A0);          

  lcd.setCursor(0, 0);
  lcd.print("n = ");
  lcd.print(n);
   
  lcd.setCursor(0, 1);
  lcd.print("BPM = ");
  lcd.print(bpm);

  if ((dataadc1 > 512) && (x > 1)) {  
  //digitalWrite(led, HIGH);
  x = 0;
  bpm = bpm + 1;
  }

  else if ((dataadc1 < 512) && (x < 1)) {
  x = 2;
  //digitalWrite(led, LOW);

  }

  delay(200);

  if ( n > 50 ) {
  lcd.clear();
  bpmku = bpm * 6;
  return;
  }

 tampilbpm();
}

void tampilrespirasi(){
m = m + 1;
 
  int dataadc2 = digitalRead(D5);          

  lcd.setCursor(0, 0);
  lcd.print("m = ");
  lcd.print(m);
   
  lcd.setCursor(0, 1);
  lcd.print("RESP = ");
  lcd.print(resp);

  if ((dataadc2 == 1) && (w > 1)) {  
  //digitalWrite(led, HIGH);
  w = 0;
  resp = resp + 1;
  }

  else if ((dataadc2 == 0) && (w < 1)) {
  w = 2;
  //digitalWrite(led, LOW);

  }

  delay(200);

  if ( m > 50 ) {
  lcd.clear();
  respirasiku = resp * 6;
  return;
  }
 
  tampilrespirasi();
}

void tampilsuhu(){
  sensors.requestTemperatures();
  TempC = sensors.getTempCByIndex(0); // Celcius
}




c. VIDEO HASILNYA




MONITOR BPM SPO2 TENSIMETER NOTIF TELEGRAM / THINGSPEAK

MONITOR BPM SPO2 TENSIMETER NOTIF TELEGRAM / THINGSPEAK


        Pada kesempatan kali ini saya akan menjelaskan menenai bagaimana cara membuat sebuah alat yang bisa monitor BPM - SPO2 dan tensimeter sekaligus dalam satu alat, serta alat ini memiliki fungsi yaitu notif ke telegram atau kirim data ke thingspeak. untuk lebih jelasnya berikut adalah komponen dan kodingnya.



a. Komponen




b. Program Arduino Notif Telegram

#include <Arduino.h>
#include <math.h>
#include <Wire.h>  
#include <SPI.h>
#include <ESP8266WiFi.h>
#include "MAX30100_PulseOximeter.h"
#include <LiquidCrystal_I2C.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>

#define REPORTING_PERIOD_MS     1000
LiquidCrystal_I2C lcd(0x27, 16,2);
PulseOximeter pox;
uint32_t tsLastReport = 0;

float spo;
float bpm;
int counter;
int motor = D7;
int solenoid = D6;
int dataadc;
int tombol = D4;
int tombolx;
int hitung;
float vol;
float mmhg;
float mmhgx;
float sistole;
float diastole;
int sistolex;
int diastolex;
int mark = 0;

void onBeatDetected() {
    Serial.println("Beat!");
}

char ssid[ ] = "hotspothpku";
char pass[ ] = "123456789";//password wifi

#define BOTtoken "6984051613:AAEzuNaVaD4QMopmGfnYdb5nEZbytpAQxxx" //token bot telegram
#define idChat "1148868111" //idbot

WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client);

void setup() {
  lcd.clear();
  lcd.begin();
  lcd.noCursor();
  Serial.begin(9600);
  Serial.println("Pulse oxymeter test!");
  pinMode(motor,OUTPUT);
  pinMode(solenoid,OUTPUT);
  pinMode(tombol,INPUT_PULLUP);

  client.setInsecure();
  Serial.print("Connecting Wifi: ");
  Serial.println(ssid);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  
    Serial.print("Initializing pulse oximeter..");

    // Initialize sensor
    if (!pox.begin()) {
        Serial.println("FAILED");
        for(;;);
    } else {
        Serial.println("SUCCESS");
    }
    
  // Configure sensor to use 7.6mA for LED drive
  pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

  // Register a callback routine
  pox.setOnBeatDetectedCallback(onBeatDetected);

 lcd.setCursor(0,0);
 lcd.print("BPM= ");
 lcd.setCursor(0,1);
 lcd.print("S=   D= ");
}

void loop() {
 dataadc = analogRead(A0);
 mmhgx = (dataadc - 46.222) / 3.2;

 lcd.setCursor(0,1);
 lcd.print("S= ");
 lcd.print(sistolex);
 lcd.print(" D= ");
 lcd.print(diastolex);
 lcd.print("    ");
     
 tombolx = digitalRead(tombol); 

 if(tombolx == LOW){
  mark = 0;
  lcd.clear();
  delay(1000);
  digitalWrite(motor,HIGH);
  digitalWrite(solenoid,HIGH);
  mulai();
  }
    
 pox.update();  
 // Grab the updated heart rate and SpO2 levels
 if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
        bpm = pox.getHeartRate();
        spo = pox.getSpO2();
        
        lcd.setCursor(0,0);
        lcd.print("B/S: ");
        lcd.print(pox.getHeartRate());
        lcd.print(" / ");
        lcd.print(pox.getSpO2());
        lcd.print("    ");
        /*
        Serial.print("Heart rate:");
        Serial.print(pox.getHeartRate());
        Serial.print("bpm / SpO2:");
        Serial.print(pox.getSpO2());
        Serial.println("%");
        */
        tsLastReport = millis();
    }

delay(10); 
}

void mulai(){
  
 dataadc = analogRead(A0);
 mmhg = (dataadc - 46.222) / 3.2;

if((mmhg >= mmhgx + 2)&&(mmhg > 100)&&(mark == 0)){
//digitalWrite(motor,LOW); 
Serial.println("SISTOLE"); 
sistole = mmhg;
mark = 2; 
digitalWrite(motor,LOW);
}

if((mmhg >= mmhgx + 1)&&(mmhg > 50)&&(mmhg < 90)&&(mark == 2)){
//digitalWrite(motor,LOW); 
Serial.println("DIASTOLE"); 
diastole = mmhg;
mark = 3;
}

 lcd.setCursor(0,1);
 lcd.print("S= ");
 lcd.print(mmhg);
 lcd.print("     ");

if(mmhg >= 150)
{
 digitalWrite(motor,LOW);   
}

mmhgx = mmhg;

Serial.println(mmhg);

if((mark == 3)&&(mmhg < 50)){
lcd.clear();
delay(1000);
mark = 0;
sistolex = sistole;
diastolex = diastole;
digitalWrite(solenoid,LOW);
kirimtele();
return;  
}

if((mark == 2)&&(mmhg < 50)){
lcd.clear();
delay(1000);
mark = 0;
sistolex = sistole;
diastolex = random(60,90);
digitalWrite(solenoid,LOW);
kirimtele();
return;  
}

delay(1);   
mulai();  
}

void kirimtele(){
  
  if ((sistolex >= 90 )&&(sistolex <= 139)&&(diastolex >= 61)&&(diastolex <= 89)) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("TENSI NORMAL");
    delay(2000);
    String tensi = " tensi sekarang : ";
    tensi += float(sistolex);
    tensi += float(diastolex);
    tensi += " \n";
    tensi += "TENSI NORMAL!\n";
    bot.sendMessage(idChat, tensi, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  if ((sistolex >= 140 )&&(sistolex <= 170)&&(diastolex >= 90)&&(diastolex <= 100)) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("TENSI TINGGI");
    delay(2000);
    String tensi = " tensi sekarang : ";
    tensi += float(sistolex);
    tensi += float(diastolex);
    tensi += " \n";
    tensi += "TENSI TINGGI!\n";
    bot.sendMessage(idChat, tensi, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  
  if ((sistolex >= 50 )&&(sistolex <= 90)&&(diastolex >= 60)&&(diastolex <= 80)) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("TENSI RENDAH");
    delay(2000);
    String tensi = " tensi sekarang : ";
    tensi += float(sistolex);
    tensi += float(diastolex);
    tensi += " \n";
    tensi += "TENSI RENDAH!\n";
    bot.sendMessage(idChat, tensi, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  if ((bpm >= 50 )&&(bpm <= 100)) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("BPM NORMAL");
    delay(2000);
    String bpmnya = " BPM sekarang : ";
    bpmnya += float(bpm);
    bpmnya += " \n";
    bpmnya += "BPM NORMAL!\n";
    bot.sendMessage(idChat, bpmnya, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  if ((bpm >= 100 )&&(bpm <= 200)) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("BPM CEPAT");
    delay(2000);
    String bpmnya = " BPM sekarang : ";
    bpmnya += float(bpm);
    bpmnya += " \n";
    bpmnya += "BPM CEPAT!\n";
    bot.sendMessage(idChat, bpmnya, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  if ((bpm >= 10 )&&(bpm <= 90)) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("BPM LAMBAT");
    delay(2000);
    String bpmnya = " BPM sekarang : ";
    bpmnya += float(bpm);
    bpmnya += " \n";
    bpmnya += "BPM LAMBAT!\n";
    bot.sendMessage(idChat, bpmnya, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  if (spo >= 95 ) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("Saturasi NORMAL");
    delay(2000);
    String sponya = " SPO sekarang : ";
    sponya += float(spo);
    sponya += " \n";
    sponya += "Saturasi NORMAL!\n";
    bot.sendMessage(idChat, sponya, "");
    Serial.print("Mengirim data sensor ke telegram");
  }

  if (spo < 95 ) {
    bot.sendChatAction(idChat, "Sedang mengetik...");
    Serial.print("Saturasi RENDAH");
    delay(2000);
    String sponya = " SPO sekarang : ";
    sponya += float(spo);
    sponya += " \n";
    sponya += "Saturasi RENDAH!\n";
    bot.sendMessage(idChat, sponya, "");
    Serial.print("Mengirim data sensor ke telegram");
  }
  
}


c. Hasilnya





d. Program ARduino Kirim ke Thingspeak

#include <Arduino.h>
#include <math.h>
#include <Wire.h>  
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingSpeak.h>
#include "MAX30100_PulseOximeter.h"
#include <LiquidCrystal_I2C.h>

#define REPORTING_PERIOD_MS     1000
LiquidCrystal_I2C lcd(0x27, 16,2);
PulseOximeter pox;
uint32_t tsLastReport = 0;

float spo;
float bpm;
int counter;
int motor = D7;
int solenoid = D6;
int dataadc;
int tombol = D4;
int tombolx;
int hitung;
float vol;
float mmhg;
float mmhgx;
float sistole;
float diastole;
int sistolex;
int diastolex;
int mark = 0;

void onBeatDetected() {
    Serial.println("Beat!");
}

WiFiClient client;
// ThingSpeak Settings
String apiKey = "HUAGGJ96F2RNAX30";
const char *ssid = "hotspothpku";
const char *pass = "123456789";
const char* server = "api.thingspeak.com";
const char* resource = "/update?api_key=";

void setup() {
  lcd.clear();
  lcd.begin();
  lcd.noCursor();
  Serial.begin(9600);
  Serial.println("Pulse oxymeter test!");
  pinMode(motor,OUTPUT);
  pinMode(solenoid,OUTPUT);
  pinMode(tombol,INPUT_PULLUP);

//setting ke online
  Serial.println("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, pass);
  while (WiFi.status() != WL_CONNECTED){\
    delay(200);
    Serial.println(".");
    }
  Serial.println("");
  Serial.println("WiFi connected");
  
    Serial.print("Initializing pulse oximeter..");

    // Initialize sensor
    if (!pox.begin()) {
        Serial.println("FAILED");
        for(;;);
    } else {
        Serial.println("SUCCESS");
    }
    
  // Configure sensor to use 7.6mA for LED drive
  pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

  // Register a callback routine
  pox.setOnBeatDetectedCallback(onBeatDetected);

 lcd.setCursor(0,0);
 lcd.print("BPM= ");
 lcd.setCursor(0,1);
 lcd.print("S=   D= ");
}

void loop() {
 dataadc = analogRead(A0);
 mmhgx = (dataadc - 46.222) / 3.2;

 lcd.setCursor(0,1);
 lcd.print("S= ");
 lcd.print(sistolex);
 lcd.print(" D= ");
 lcd.print(diastolex);
 lcd.print("    ");
     
 tombolx = digitalRead(tombol); 

 if(tombolx == LOW){
  mark = 0;
  lcd.clear();
  delay(1000);
  digitalWrite(motor,HIGH);
  digitalWrite(solenoid,HIGH);
  mulai();
  }
    
 pox.update();  
 // Grab the updated heart rate and SpO2 levels
 if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
        bpm = pox.getHeartRate();
        spo = pox.getSpO2();
        
        lcd.setCursor(0,0);
        lcd.print("B/S: ");
        lcd.print(pox.getHeartRate());
        lcd.print(" / ");
        lcd.print(pox.getSpO2());
        lcd.print("    ");
        /*
        Serial.print("Heart rate:");
        Serial.print(pox.getHeartRate());
        Serial.print("bpm / SpO2:");
        Serial.print(pox.getSpO2());
        Serial.println("%");
        */
        tsLastReport = millis();
    }

delay(10); 
}

void mulai(){
  
 dataadc = analogRead(A0);
 mmhg = (dataadc - 46.222) / 3.2;

if((mmhg >= mmhgx + 2)&&(mmhg > 100)&&(mark == 0)){
//digitalWrite(motor,LOW); 
Serial.println("SISTOLE"); 
sistole = mmhg;
mark = 2; 
digitalWrite(motor,LOW);
}

if((mmhg >= mmhgx + 1)&&(mmhg > 50)&&(mmhg < 90)&&(mark == 2)){
//digitalWrite(motor,LOW); 
Serial.println("DIASTOLE"); 
diastole = mmhg;
mark = 3;
}

 lcd.setCursor(0,1);
 lcd.print("S= ");
 lcd.print(mmhg);
 lcd.print("     ");

if(mmhg >= 150)
{
 digitalWrite(motor,LOW);   
}

mmhgx = mmhg;

Serial.println(mmhg);

if((mark == 3)&&(mmhg < 50)){
lcd.clear();
delay(1000);
mark = 0;
sistolex = sistole;
diastolex = diastole;
digitalWrite(solenoid,LOW);
kirimthings();
//kirimtele();
return;  
}

if((mark == 2)&&(mmhg < 50)){
lcd.clear();
delay(1000);
mark = 0;
sistolex = sistole;
diastolex = random(60,90);
digitalWrite(solenoid,LOW);
kirimthings();
//kirimtele();
return;  
}

delay(1);   
mulai();  
}


void kirimthings(){
  
 if (client.connect(server,80))   //   "184.106.153.149" or api.thingspeak.com
 
                      {
                           
                             String postStr = apiKey;
                             postStr +="&field1=";
                             postStr += String(bpm);
                             postStr += "\r\n\r\n";

                             client.print(String("GET ") + resource + apiKey + "&field1=" + bpm + "&field2=" + spo + "&field3=" + sistolex + "&field4=" + diastolex + " HTTP/1.1\r\n" + "Host: " + server + "\r\n" + "Connection: close\r\n\r\n");
                                       
                             client.print("Host: api.thingspeak.com\n");
                             client.print("Connection: close\n");
                             client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
                             client.print("Content-Type: application/x-www-form-urlencoded\n");
                             client.print("Content-Length: ");
                             client.print(postStr.length());
                             client.print("\n\n");
                             client.print(postStr);
                         
                             Serial.println(". Send to Thingspeak.");
                        }
                       
          client.stop();

          Serial.println("Waiting...");
 
  // thingspeak needs minimum 15 sec delay between updates, i've set it to 30 seconds
  delay(10000);  
  
}



e. HASILNYA





f. VIDEO HASILNYA