9

I'm having a but of trouble making sure my project really is feasible.

What I want to archive: Control my Senseo coffee machine via internet. It boils down to simply controlling 2 buttons.

First easy solution:

  1. Setup a NodeJS server on my Raspberry Pi.
  2. I plug my Raspberry GPIOs to 2 transistors, to control the coffee machine buttons
  3. I can control the Raspberry GPIO directly in Javascript. For example calling http://myraspberrypi.com/makemeacoffee activates the GPIO, activates the buttons, and the coffee flows

But: I don't want to plug my raspberry to my coffee machine (I need the Pi for other purposes), and I think that decoupling the web server and the controller itself is a good idea. If tomorrow I want to monitor the temperature of my bathroom, or control a second coffee machine (using another ESP8266) I want be able to do it without rethinking the whole thing.

What I need to archive that is an ESP8266 with NodeMCU to use it as a Wi-Fi headless controller (see this link). Raspberry GPIO are no longer used (that's the point). There is only a NodeJS web server on the Pi.

Here is a quick sketch of the architecture: is this architecture feasible ?

Let me clarify the role of the main components:

  • Raspberry Pi: Hosts the NodeJS web server
  • NodeJS web server: Serves the web pages to the end user. Basically a page with a button "Make me a coffee". Behind the scene, we need to "push" the heat up the water button, wait 30 sec, then "push" the coffee button. The web server does so by sending HTTP requests to the ESP8266 (over Wi-Fi). The NodeJS server also does logging and data analysis (how many coffee did you drink this year ?)
  • ESP8266: Uses NodeMCU. Its GPIOs are plugged to a transistor controlling the coffee machine buttons. I don't care about how to power the ESP8266. It runs a web server to listen to the Raspberry Pi requests and do actions on GPIOs accordingly.

Is this architecture feasible? Is this architecture flexible?


EDIT, to answer Sean Houlihane (spoiler to keep the post relatively short):

I'm not 100% sure about this, but a transistor is seems to be enough. The coffee machine switch is working on low voltage (3,3V) and the ESP8266 won't share the ground with the coffee machine.

About the temperature sensing, and the water level control, the Senseo coffee machine has this built-in. Typical use : Press the center button to launch the heat up process, choose your coffee size by pressing the "single" or "double" button. Once the heat up process ends, the coffee starts flowing. If there is not enough water, it ends and a LED blinks.

The progress I expect :

  • Version 1.0 will be "Just run the coffee machine, I am sure it's ready". I control the single cup button and the heat up button.
  • Version 2.0 will be "Run the machine and give me feedback" I had another ESP8266, plugged to the feedback LED (So that I can know when it's heating up and when it's out of water) and another one to a scale to make sure the cup is there before running the coffee machine. I might also add an alert when the coffee machine is ran to tell the user to change the pod.

  • Version 3.0 will be to find a way to tell if the pod has been changed, by tracking the opening of the mechanism with some kind of switch. But this is out of the scope of my project at the moment.

3
  • Hello and welcome to Internet of Things! While I am not trying to convince you to move this question over (it is all well here) I'd like to invite you to raspberrypi.stackexchange.com for any other questions (or answers you might want to provide) with respect to the Raspberry Pi :)
    – Ghanima
    Feb 15, 2017 at 12:39
  • @Ghanima I am aware of the existence of this site, I just "joined the community" right now, thanks Feb 15, 2017 at 13:50
  • 2
    HTTP? You should be using HTCPCP.
    – JAB
    Feb 15, 2017 at 15:19

1 Answer 1

5

The architecture which you propose seems OK. You can build more functionality on top of this, such as authentication and request sanitisation (for example time of day controls, rate limiting, etc) so it's a great example to investigate.

There are probably some important details in the implementation which you've not looked into yet. For example, the transistor switch - this might need to be a mosfet, maybe a relay (or solid-state relay) and might have voltage and isolation issues.

More things to consider, temperature sensing, water level (careful about contamination) and other features. RGB pod tracking (does this make it a single-use machine, or need a pod-not-replaced alarm?)

1
  • 1
    Edited my answer to give more info about the final aim and the steps to get there Feb 15, 2017 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.