Daniel DiPilatoNicholas PfeifferJoshua Greene

Brewtiful Bean Machine

If you can't go without your morning coffee, but your routine leaves you crunched for time, then the Brewtiful Bean Machine is for you.

IntermediateShowcase (no instructions)6 hours1,487
Brewtiful Bean Machine

Things used in this project

Hardware components

5V 2 channel relay module
A one channel relay will work just fine because a single channel is used in the project.
Particle Photon
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
Resistor 10k ohm
Resistor 10k ohm
Resistor 221 ohm
Resistor 221 ohm
Extension Cord
Any extension can be used here
Coffee Pot
Any one button coffee maker will work

Software apps and online services

Maker service
IFTTT Maker service
ThingSpeak API
ThingSpeak API


Read more


Relay Switch Circuit

This is an actual image of the circuit build that controls the relay to turn the coffee pot on or off.

Temperature Sensor Circuit

This is the circuit that controls the DHT11 sensor that logs the temperature data

Temperature Schematic

A schematic of how the temperature circuit is wired

Relay Schematic

A schematic of how the relay switch is wired

Thingspeak DHT11 Sensor Data

These four graphs show the data gathered when a trial run of the project was completed. This includes the process from start to finish


Relay Switch Code

This code is linked to the particle that controls when the relay switch turns off or on
// -----------------------------------------
// Function and Variable with Photoresistors
// -----------------------------------------
// In this example, we're going to register a Particle.variable() with the cloud so that we can read brightness levels from the photoresistor.
// We'll also register a Particle.function so that we can turn the LED on and off remotely.

// We're going to start by declaring which pins everything is plugged into.

int relay = D0; // This is where your LED is plugged in. The other side goes to a resistor connected to GND.
int led = D7;

// Next we go into the setup function.

    void setup() {

    pinMode(relay,OUTPUT);//  our to_relay pin is output (sending voltage to relay)

    // We are also going to declare a Particle.function so that we can turn the LED on and off from the cloud.
    // This is saying that when we ask the cloud for the function "on", it will employ the function ledToggle() from this app.

// Finally, we will write out our ledToggle function, which is referenced by the Particle.function() called "led"
void led_ON(const char *eventName, const char *data)
    digitalWrite(led, HIGH);
int relayToggle(String command) {

        if (command == "ON" || command == "on" || command == "On") {
            digitalWrite(relay, HIGH);
                return 1;
        else if (command == "OFF" || command == "off" || command == "Off") {
            digitalWrite(relay, LOW);
                return 0;
        else {
            return -1; 

Temperature Sensor Code

This code controls the DHT11 sensor and tells the sensor when to log data to Thingspeak
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_DHT/Adafruit_DHT.h"

// -----------------------------------------
// solarmonitor
// Monitor light, temperature and Humidy at solar panel
// Particle Photon + Particle.io Webhook + ThingSpeak Integration
// April, 2016 - Pete Hoffswell - pete@hoffswell.com
// -----------------------------------------
#define DHTPIN 2
#define DHTTYPE DHT11 // DHT11 Module
#define publish_cycle 10000 // Only publish every 60 seconds
const String key = "YEB3V2FLNZH3Y8QW"; // Change this to your Thingspeak api write key
int led = D7;
int photoCell = A0;
int power = A5; // Photocell power.  An analog pin to gives a more steady voltage.
int light; // Light
double tempF; // Temperature F
double tempC; // Temperature C
double humidity; // Humidity
unsigned int lastPublish = 0;
void setup() {
    // Set Pin Modes
    digitalWrite(power,HIGH); // Turn on power source for photoCell
    // Connect variables to particle cloud
    // This allows you to save data to particle.io, and run commands against it such as "particle variable Photon get light"
    Particle.variable("light", &light, INT);
    Particle.variable("tempF", &tempF, DOUBLE);
    Particle.variable("tempC", &tempC, DOUBLE);
    Particle.variable("humidity", &humidity, DOUBLE);
} //setup
void loop() {
  unsigned long now = millis();
  digitalWrite(led,HIGH); // Signal read sequence led
  // read sensors
  light = analogRead(photoCell);
  delay(100);  // is this needed?
  humidity = dht.getHumidity();
  tempC = dht.getTempCelcius();
  tempF = dht.getTempFarenheit();
  // DHT Read ok?
  if (isnan(humidity) || isnan(tempF) || isnan(tempC)) {
    Serial.println("Failed to read from DHT sensor!");
    Serial.println("humidity=" + String(humidity) + " tempF=" + String(tempF) + " tempC=" + String(tempC));
    return; // exit loop and try again
  // Display to serial
  Serial.print("humidity=" + String(humidity) + " tempF=" + String(tempF) + " tempC=" + String(tempC) + " light=" + String(light));
  // Publish to thinkspeak
  if ((now - lastPublish) > publish_cycle) {
    Particle.publish("thingSpeakWrite_All", "{\"1\": \"" + String(humidity) + "\"," +
       "\"2\": \"" + String(tempC) + "\"," +
       "\"3\": \"" + String(tempF) + "\"," +
       "\"4\": \"" + String(light) + "\"," +
       "\"k\": \"" + key + "\"}", 60, PRIVATE);
    lastPublish = now;
    Serial.println(" - Published!");
  } else {
  delay(2000); // Wait 2 seconds before next loop
}// loop


This was the generic webhook that was used to link Mcbuckets to ThingSpeak
  "event": "thingSpeakWrite_",
    "url": "https://api.thingspeak.com/update",
    "requestType": "POST",
    "form": {
        "api_key": "{{k}}",
        "field1": "{{1}}",
        "field2": "{{2}}",
        "field3": "{{3}}",
        "field4": "{{4}}",
        "field5": "{{5}}",
        "field6": "{{6}}",
        "field7": "{{7}}",
        "field8": "{{8}}",
        "lat": "{{a}}",
        "long": "{{o}}",
        "elevation": "{{e}}",
        "status": "{{s}}"
    "mydevices": true,
    "noDefaults": true


Daniel DiPilato

Daniel DiPilato

1 project • 0 followers
Junior Mechanical Engineering student at UNC Charlotte
Nicholas Pfeiffer

Nicholas Pfeiffer

1 project • 0 followers
Joshua Greene

Joshua Greene

1 project • 0 followers


Add projectSign up / Login