Mohammad MohamedtahaAhmed Helal
Published

MEGR 3171: Restaurant Order Notifier

Ever worked at a restaurant and wanted to know when the order was ready for you to serve to the customer. We've got the thing just for you.

BeginnerFull instructions provided106
MEGR 3171: Restaurant Order Notifier

Things used in this project

Hardware components

Argon
Particle Argon
×2
Breadboard (generic)
Breadboard (generic)
×2
LED (generic)
LED (generic)
×2
Jumper wires (generic)
Jumper wires (generic)
×1
Microphone Sound Detection Sensor
×1
Grove - Barometer (High-Accuracy)
Seeed Studio Grove - Barometer (High-Accuracy)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
ThingSpeak API
ThingSpeak API

Story

Read more

Schematics

Button notifier

The grove button has four different components. The GND was connected to the ground and the SIG was connected to A2 of the Argon. From there the VCC is connected to the 3V3 of the Argon. The LED Light has a short leg and long leg. The long leg of the LED is connected to D7 and the short leg is connected to ground

Sound Notifier

The Digital sound detector has three different components. The AUD was connected to A2 of the Argon and GND was connected to ground. From there the VCC was connected to ground which is linked with the connection of the 3V3 of the Argon which also leads to ground. The short leg of the LED was connected to ground and the long leg was connected to D7

Code

button Sensor

C/C++
 const int led = D7; // sets led as pin D7 and is not changed throughout the process sound pin are not changed throughout the process
 const int buttonpin = A2; // sets sound detector as pin Analog2 is changed throughout the process
 const int threshold = 250; // choose any value this number
 int Numberoforders=0; // creates a value for the number of orders
 


void setup() {
    Serial.begin(9600);
    pinMode(led, OUTPUT); // Configure pin for output
    digitalWrite(led, LOW); // creates the starting value for D7
    pinMode(buttonpin, INPUT); // Configure pin for input
    Particle.subscribe("Clap Notifier", anything ,"e00fce68b7279452b67c3045"); // communicates with other argon device
    
}
void anything(const char *event, const char *data)
{
    digitalWrite(led, HIGH); // Turns the led on when output is sent from the other device's sensor 
    delay(1000); // waits 1 second
    digitalWrite(led, LOW); // Turns the led off 
}
    
void loop() {
    int buttonsens=analogRead(buttonpin); // read analog data from sensor
    if (buttonsens>=threshold) {
        digitalWrite(led, HIGH); // turn led on
        Particle.publish("Clap Notifier", "Big order coming your way", PUBLIC);// creates an event called Clap Notifier and sends the message "order is taken"
        delay(1000); // waits 1 second
        
}
if (buttonsens>=threshold) {
    digitalWrite(led, LOW); // turn led off
    
    }
    
}

sound sensor

C/C++
const int led = D7; // sets led as pin D7 and is not changed throughout the process sound pin are not changed throughout the process
 const int soundpin = A2; // sets sound detector as pin Analog2 is changed throughout the process
 const int threshold = 250; // sets threshold for sound sensorvoid setup()
 int Numberoforders=0;

void setup() {
    Serial.begin(9600);
    pinMode(led, OUTPUT); // Configure pin for output
    digitalWrite(led, LOW); // creates the starting value for D7
    pinMode(soundpin, INPUT); // Configure pin for input
    Particle.subscribe("Clap Notifier", anything ,"e00fce68da963e833e516d1f"); // communicates with other argon device

}
void anything(const char *event, const char *data)
{
    digitalWrite(led, HIGH); // Turns the led on when output is sent from the other device's sensor 
    delay(1000); // waits 1 second
    digitalWrite(led, LOW);  // Turns the led off
}
void loop() {
    int soundsens=analogRead(soundpin); // read analog data from sensor
    if (soundsens>=threshold) {
        digitalWrite(led, HIGH); // turn led on
        Particle.publish("Clap Notifier", "Order is ready", PUBLIC); // creates an event called Clap Notifier and sends the message "order is not ready"
        delay(1000); // waits 1 second
        Numberoforders = Numberoforders + 1;
        String data = String(Numberoforders);
        Particle.publish("counter", data, PRIVATE); // gathers data for the graph
        delay(500); // waits 1 second

}

if (soundsens>=threshold) {
    digitalWrite(led, LOW); // turn led off
    Particle.publish("Clap Notifier", "Order is not ready", PUBLIC); // creates an event called Clap Notifier and sends the message "order is not ready"

}
}

Credits

Mohammad Mohamedtaha

Mohammad Mohamedtaha

1 project • 0 followers
Ahmed Helal

Ahmed Helal

1 project • 0 followers

Comments