John KleinAlex NorrisKody Schwartz
Published

Automated Toaster System

A smart toaster that automatically makes your toast in the morning and monitors it's progress using the aid of multiple sensors.

IntermediateFull instructions provided10 hours417

Things used in this project

Hardware components

Argon
Particle Argon
×3
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×3
Photo resistor
Photo resistor
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Adafruit Thermocouple Amplifier MAX31855 breakout board (MAX6675 upgrade)
×1
Gobot HiLetgo 5pcs 3.3V 5V Power Supply Module for MB102 102 Prototype Breadboard DC 6.5-12V or USB Power Supply Module
×1
Test Accessory, Thermocouple and Adapter
Test Accessory, Thermocouple and Adapter
×1
Resistor 1k ohm
Resistor 1k ohm
×7
Jumper wires (generic)
Jumper wires (generic)
×1
Elite Gourmet ECT-1027 Cool Touch Toaster, 7 Toast Settings Cancel Functions, Slide Out Crumb Tray, Extra Wide 1.5" Slots for Bagels Waffles Specialty Breads, Puff Pastry, Snacks, White
×1
Speaker: 0.25W, 8 ohms
Speaker: 0.25W, 8 ohms
×1
Continuous Rotation Servo - FeeTech FS5103R
×2
General Purpose Dual Op-Amp
Texas Instruments General Purpose Dual Op-Amp
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Multitool, Screwdriver
Multitool, Screwdriver
Tape, Duct
Tape, Duct
Plier, Diagonal
Plier, Diagonal
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter

Story

Read more

Custom parts and enclosures

Spool

The spool is connected to the servos and is used to wrap the string around as it turns on the toaster. Print 2 pieces.

Toaster Mount

The toaster mount allows for the servos to be connected to the toaster. Print 1.

Schematics

Argon 1

This argon goes in the bedroom.

Argon 2

This Argon goes at the bottom of the toaster

Argon 3

This argon goes at the top of the toaster

Communication flowchart

Flowchart showing communication between argons and the cloud

Code

Argon 1

Arduino
Code for Argon 1 in the bedroom
//KODY bedroom
#define PHOTOIN A5
#define BUZZER A0
bool published=false;
int VIn;
int toner=440;
int check=0;
bool noise=false;
bool detected=false;

void setup() {
    Serial.begin(9600);
    pinMode(PHOTOIN,INPUT);
    Particle.subscribe("toasting",toastingHandler);//from 2
    Particle.subscribe("motion",motionHandler);//from 3
}

void loop(){
    VIn=analogRead(PHOTOIN);
    Serial.println(VIn);
    if(detected==false){
        if(VIn<600){
            if(check>10){
                Particle.publish("light");//to bottom
                detected=true;
            }
            else check +=1;
        }
        else if(check>0)check-=1;
    }
    if(noise==true){
        tone(BUZZER,toner);
        Particle.publish("yelling");//to Top
    }
    else noTone(BUZZER);
}

void toastingHandler(const char *event, const char *data){
    pinMode(7,OUTPUT);
    tone(BUZZER,toner,50);
    delay(100);
    noTone(BUZZER);
    digitalWrite(7,HIGH);
}

void motionHandler(const char *event, const char *data){
    noise=true;
    pinMode(7,OUTPUT);
    digitalWrite(7,LOW);
    Particle.publish("toastCheck",String(0));
}

Argon 2

Arduino
Code for Argon 2 at the bottom of the toaster
//John bottom of the toaster
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_MAX31855.h>
//JOHN
#define servoLP A3
#define servoRP A4
#define DO D2
#define CS D3
#define CLK D4
int istoasting = 4000;//every 4 seconds
long nottoasting = 1800000;//every 30 minutes
Servo servoL;
Servo servoR;
Adafruit_MAX31855 thermocouple(CLK,CS,DO);
bool toasting=false;
bool light=false;
unsigned long int start;

void setup() {
    Serial.begin(9600);
    servoL.attach(servoLP);
    servoR.attach(servoRP);
    Particle.function("MotorMove",MotorMove);
    Particle.subscribe("light",lightHandler);//from 1
    Particle.subscribe("motion",motionHandler);//from 3
    start=millis();
}

void loop() {
    unsigned long int now=millis();
    double f = thermocouple.readFarenheit();
    Serial.println(now-start);
    if(light==true){
        MotorMove("back");
        delay(3500);
        MotorMove("foward");
        delay(2500);
        MotorMove("stop");
        light=false;
        Particle.publish("toasting");//to Top and Bedroom
        Particle.publish("toastCheck",String(1));//to Thingspeak
    }
    if(toasting==true){
        if((now-start)>istoasting){//if the toaster is toasting, send temperature events much more frequently
            Particle.publish("temp",String(f));//to Thingspeak
            Serial.println(f);
            start=millis();
        }
    }
    if(toasting==false){//if the toaster is not sleeping, send temperature events every few hours
        if((now-start)>nottoasting){
            Particle.publish("temp",String(f));
            Particle.publish("toastCheck",String(0));
            start=millis();
        }
    }
}
    

int MotorMove(String direction){//1=foward 0=still -1=back
    if(direction=="foward"){
        servoL.write(100);
        servoR.write(80);
        return 1;
    }
    if(direction=="stop"){
        servoL.write(90);
        servoR.write(90);
        return 0;
    }
    if(direction=="back"){
        servoL.write(80);
        servoR.write(100);
        return -1;
    }
    return 1000;
}

void lightHandler(const char *event, const char *data){
    toasting=true;
    light=true;
}

void motionHandler(const char *event, const char *data){
    toasting=false;
}

Argon 3

Arduino
Code for Argon 3 at the top of the toaster
//Alex Top of the toaster
// This #include statement was automatically added by the Particle IDE.
#include <HC_SR04.h>

#define TRIG A3
#define ECHO A2
int temperature=0;
double distance;
bool toasting=false;
int check=0;
HC_SR04 sensor(TRIG,ECHO);

void setup() {
    Serial.begin(9600);
    Particle.subscribe("toasting",toastingHandler);//from 2
    Particle.subscribe("yelling",yellingHandler);//from 1
}

void loop() {
    if(toasting==true){
        distance =sensor.getDistanceInch();//in inches
        Serial.println(distance);
        if(distance<5){//will need to be tweaked for each individual toaster
            check+=1;
            if(check>10){//only will fire the toasters finished event if 10 distances under the threshold happen back to back
                Particle.publish("motion"); //To Bedroom and bottom
                check=0;    //resets counter for next toast
                toasting=false;
            }
        }
        else{
            if(check>0) check-=1;
        }
    }
}

void toastingHandler(const char *event, const char *data){
    toasting=true;
    pinMode(D7,OUTPUT);
    digitalWrite(D7,HIGH);//turns on d7 led while the ultrasonic sensor is active
}

void yellingHandler(const char *event, const char *data){
    pinMode(D7,OUTPUT);
    digitalWrite(D7,LOW);//turns off d7 led 
}

Credits

John Klein

John Klein

1 project • 1 follower
Alex Norris

Alex Norris

1 project • 4 followers
Kody Schwartz

Kody Schwartz

1 project • 1 follower

Comments