Ahmad Radhy
Published

CeriTech (Coffee Beans Drying Process)

Ceri could provide reliable real-time data to the processor to monitor the drying stage of coffee beans.

AdvancedShowcase (no instructions)2,987
CeriTech (Coffee Beans Drying Process)

Things used in this project

Story

Read more

Schematics

Schematic System

Code

Untitled file

Arduino
#include <Arduino.h>
#include <CayenneMQTTMKR1010.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <Wire.h>
#include <BH1750.h>

#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial

char ssid[] = "";
char password[] = "";

char username[] = "";
char mqtt_password[] = "";
char client_id[] = "";

DHT dht(5, DHT22); //pin output digital sensordht22 ke pin D5 arduino
BH1750 lightMeter;
long lastData = 0;

void setup() {

  Cayenne.begin(username, mqtt_password, client_id, ssid, password);
  pinMode(5, OUTPUT);
  dht.begin();
  Wire.begin();
  lightMeter.begin();

}

void loop() {

  Cayenne.loop();
  
  float temp = dht.readTemperature();
  float hum = dht.readHumidity();
  float inten = lightMeter.readLightLevel();
  
  long now = millis();

  if (now - lastData > 15000) //kirim data setiap 15 detik
  {
    
    lastData = now;
    Cayenne.virtualWrite(1, temp, TYPE_TEMPERATURE, UNIT_CELSIUS);
    Cayenne.virtualWrite(2, hum, TYPE_RELATIVE_HUMIDITY, UNIT_PERCENT);
    Cayenne.virtualWrite(3, inten, TYPE_LUMINOSITY, UNIT_LUX);
  }
  
}

Credits

Ahmad Radhy

Ahmad Radhy

23 projects • 42 followers
Physicist and IoT Software and Hardware Engineer
Thanks to Aldi Ardian Raharja.

Comments