Overview
The objective of this project was to create an automated shot dispenser displacing the correct amount of alcohol from any location. The creation is merely for pleasure and for showing off a cool new way to pour an automatic shot.
Requirements
For this project 2 particles had to be used to meet project guidelines set by the professor. It was decided that one particle would publish and one particle would subscribe. Since two particles were being used it was imperative that any communication delay between the two particles be avoided.
How?
This project was relatively easy to set up. The first photon was solely used to start the whole process. We used mobicle.io to create a remote that turns the first photon on or off. It is compatible with any android or apple device.
Once the button is triggered, the D7 pin on the first photon will illuminate. There is a jumper wire from the D7 pin to the D0 pin which allows the particle to read the digital write signal sent from the D7 pin. Once the signal is read and received an event is published to the cloud.
The second Photon controls the water pump and subscribes to the event that is published by the first photon. Once it receives the event, it runs a code that switches on the relay and turns on the pump for 1.7 seconds and then turns off. The code can easily be manipulated in order to turn on the pump for a longer or shorter period of time depending on what type of drink that the user wants to make. The way to do that is by adjusting the length of the delay which is currently set at 1700 milliseconds. The actual configuration of the setup is shown below.
The hardest part was figuring out how to properly connect the generic relay and supply 12 volts of power to the pump. As shown above, we used a 12 volt battery charger which supplied plenty of voltage to trigger the pump. There are probably much easier ways to supply to 12 volts but we were working with what we had. The pump is shown next to the circuit board for demonstration purposes. However, it sits in your drink of choice when a shot is ready to be poured.
Control
To achieve a time delay error of zero there was a 12v power source connected to a normally closed relay that could be switched on and off by a single photon. that single photon would subscribe from the isolated number 2 photon that published the time code. Below is a graph that shows when the pump was turned on and how long it ran each time it was triggered. The graph was powered through Google Docs.
IFTTT automatically sends updates to the users phone every time the particle is online or offline for an extended period of time. This function can serve as a security measure alerting the owner that there drinks dispenser has been activated. IFTTT will log activation time onto a personal google doc where it can be graphed. With this specific scenario a 100% denotes as being on while 0% denotes being off.
.
Comments