Code Monkey home page Code Monkey logo

arduino_smartcoffeemachine's Introduction

Arduino_SmartCoffeeMachine

An embedded system implementing a smart coffee machine is to be realised.

HW components

alt text

3 green LEDs (L1, L2, L3) 1 T1 touch button and 1 Pot potentiometer 1 PIR motion sensor and 1 SDist sonar Serial connection with PC

Detailed system behaviour

The machine starts in a STAND BY mode, in which it is assumed to have low power consumption. When the presence of someone nearby is detected then it exits the saving mode and enters an ON mode.

If someone is detected at a distance of less than DIST1 cm for a certain number DT1 seconds, a "Welcome!" message is displayed on the PC side GUI and the machine enters a READY mode, where it can accept commands. If the machine no longer detects anyone within that distance for DT2a seconds, the machine returns to the ON mode. From ON mode, the machine returns to STAND BY mode if no one is detected for DT2b seconds.

In READY mode, the user can adjust the sugar with the POT knob. Whenever the sugar level changes, the PC side will display the updated sugar level appropriately (by means of graphic component or text message).

The user can make coffee by pressing the T1 button. When he presses the button, the process represented by the progressive switching on of the 3 LEDs, lasting DT3 seconds, starts. On the PC side, the message "Making a coffee" is displayed and then "The coffee is ready" when the coffee is ready.

The user has time DT4 seconds to take the coffee - in this case we simulate with distance below DIST2 cm, i.e.: I detect distance below DIST2 cm, it means the user has taken the coffee. If you do not take your coffee within DT4 seconds, in any case the machine returns to READY mode (and the PC-side message is removed).

Finally, the coffee machine may run out of coffee material. It is supposed to be loaded to make NMAX coffee. After making NMAX coffee, the message "No more coffee. Waiting for recharge" and enters the MAINTENANCE mode. In this mode, the system waits for recharging, which can be done by a PC-side action (e.g. recharge button) corresponding to a certain amount of NC doses. After refilling, the message "Coffee refilled: "+NC is displayed on the PC side and the machine returns to STAND BY mode.

Implement the system on Arduino + PC connected via serial line, implementing the program on Arduino in C++ and the program on PC in Java. Use a task-based approach, with a behaviour model based on synchronous finite state machines.

Assume as values to simulate the system:

DIST1 (Engagement distance) = 0.3 m

DIST2 (Take coffee) = 0.1 m

DT1 (Min engagement time) = 1 s

DT2a (Max time with no engagement) = 5 s

DT2b (Max time with no presence) = 5 s

DT3 (Coffee making process duration) = 3 s

DT4 (Max time to remove coffee) = 5 s

alt text

arduino_smartcoffeemachine's People

Contributors

andreaross96 avatar forazi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.