The sequence goes something like this:
- Push the green button and the little trapdoor opens.
- Put a container in the revealed space and push the button again.
- It is drawn inside the machine.
- The trapdoor closes behind it.
- An 'analysis' of the contents of the container begins.
I did a little video while I was testing the mechanism. The mechanism is printed in natural translucent PLA and there are some Neopixels glued on the outside so that it can indicate the 'status' of the process. If you put in a container that has already been analysed it spits it out again while glowing red.
Going back to the start though, the Raspberry Pi needs to know you've pushed the green button. We've already established in parts 1 & 2 that the Arduino is plugged in to the Raspberry Pi over USB and that a small Python script looks for serial output from the Arduino, pushing anything it gets into an MQTT topic 'arduino/out/'. Push the green button and it sends 'openLid'.