ITender communication with the real world
As announced in the old tickets, I set up two systems with node-red.
1. iTender writes!
This is an opportunity to use Sense Hat! my goal is:
- display the temperature of the cold liquid
- to mark the name of the cocktail during its preparation
For that on node-red there is node which makes it possible to communicate with Sense Hat: node-red-node-pi-sense-hat.
Here is the procedure I followed to make it work :
1.1 Sense Hat wiring
I'm starting to have many GPIOs to use, not to use the same GPIO for 2 different functions I have in place a plan for using raspberry pine. For this I looked for a plan that shows the use of GPIO for the "Sense H at". Here it is
http://mshaughs.blogspot.fr/2017/02/sense-hat-pinout-for-raspberry-pi.html
Sense HAT | 1 | 2 | Sense HAT |
3 | 4 | 5V | |
Sense HAT | 5 | 6 | Sense HAT |
DS18B20 | 7 | 8 | Cold circuit circulator |
GND | 9 | 10 | Peltier 4 |
Pump 1 Pineapple juice | 11 | 12 | Pump 2 Orange juice |
13 | 14 | GND | |
Pump 3 Coca | 15 | 16 | Sense HAT |
3,3V | 17 | 18 | Sense HAT |
Peltier 1 | 19 | 20 | GND |
Pump starts cold circuit | 21 | 22 | Sense HAT |
Peltier 2 | 23 | 24 | Sense HAT |
GND | 25 | 26 | Peltier 3 |
Sense HAT | 27 | 28 | Sense HAT |
29 | 30 | ||
Pump 4 Cane syrup | 31 | 32 | Pump 5 Whisky |
33 | 34 | GND | |
Hot circuit circulator | 35 | 36 | Pompe 6 Wodka |
Pompe 7 Rhum | 37 | 38 | Pump starts hot circuit |
GND | 39 | 40 | Pompe 8 Perrier |
1.2 Installing node-red-node-pi-sense-hat
https://flows.nodered.org/node/node-red-node-pi-sense-hat
1.2. Display the temperature on the LED matrix
For that I realized the following program :
[
{
"id": "8b83ff25.96996",
"type": "rpi-sensehat out",
"z": "756ed309.7d647c",
"name": "",
"x": 1130,
"y": 920,
"wires": []
},
{
"id": "f05fddd1.88f6f",
"type": "function",
"z": "756ed309.7d647c",
"name": "Rotate 180 Text Red Background No Speed 1",
"func": "msg.color = \"red\";\nmsg.background =\"0\" ;\nmsg.speed = \"1\";\nmsg.payload = \"R180\\n\"+msg.payload;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 840,
"y": 920,
"wires": [
[
"8b83ff25.96996"
]
]
},
{
"id": "13713ce2.a9cfc3",
"type": "delay",
"z": "756ed309.7d647c",
"name": "",
"pauseType": "delay",
"timeout": "8",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 720,
"y": 980,
"wires": [
[
"7ad546f5.031758"
]
]
},
{
"id": "7ad546f5.031758",
"type": "function",
"z": "756ed309.7d647c",
"name": "OFF",
"func": "msg.background = \"off\";\nmsg.colour = \"off\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 950,
"y": 980,
"wires": [
[
"8b83ff25.96996"
]
]
},
{
"id": "7606b20e.1900cc",
"type": "rpi-ds18b20",
"z": "756ed309.7d647c",
"topic": "FF4D0B851605",
"array": false,
"name": "",
"x": 550,
"y": 920,
"wires": [
[
"f05fddd1.88f6f",
"13713ce2.a9cfc3"
]
]
},
{
"id": "7e4fa775.acd498",
"type": "inject",
"z": "756ed309.7d647c",
"name": "",
"topic": "FF4D0B851605",
"payload": "",
"payloadType": "date",
"repeat": "25",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 300,
"y": 920,
"wires": [
[
"7606b20e.1900cc"
]
]
},
{
"id": "273ab74b.419948",
"type": "comment",
"z": "756ed309.7d647c",
"name": "Launching the program every 25 seconds",
"info": "",
"x": 280,
"y": 880,
"wires": []
},
{
"id": "2cf48ba3.2ccee4",
"type": "comment",
"z": "756ed309.7d647c",
"name": "Reading the probe",
"info": "",
"x": 550,
"y": 880,
"wires": []
},
{
"id": "a2e3f705.45e9c8",
"type": "comment",
"z": "756ed309.7d647c",
"name": "Setting the display on Sense-Hat",
"info": "",
"x": 830,
"y": 880,
"wires": []
},
{
"id": "9253c3c6.c494e",
"type": "comment",
"z": "756ed309.7d647c",
"name": "View on Sense-Hat",
"info": "",
"x": 1130,
"y": 880,
"wires": []
}
]I also did a program that marks the name of the drink when I throw a cocktail.
[
{
"id": "367f95e4.4b636a",
"type": "inject",
"z": "88fe036.c4c23",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 340,
"y": 1560,
"wires": [
[
"118e46b5.d9c299"
]
]
},
{
"id": "118e46b5.d9c299",
"type": "ui_button",
"z": "88fe036.c4c23",
"name": "",
"group": "82b4dd32.05812",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"label": "Whisky - coca",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "0",
"payloadType": "num",
"topic": "",
"x": 500,
"y": 1560,
"wires": [
[
"9de3ec76.a7563"
]
]
},
{
"id": "9de3ec76.a7563",
"type": "change",
"z": "88fe036.c4c23",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Whisky - Coca",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 1620,
"wires": [
[
"fff8b14.3db765",
"28a8ecdf.cd3fa4"
]
]
},
{
"id": "fff8b14.3db765",
"type": "function",
"z": "88fe036.c4c23",
"name": "Rotate 180 Text Red Background Blue Speed 5",
"func": "msg.color = \"red\";\nmsg.background =\"0\" ;\nmsg.speed = \"1\";\nmsg.payload = \"R180\\n\"+msg.payload;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 880,
"y": 1620,
"wires": [
[
"71f8d9cf.684ee8"
]
]
},
{
"id": "28a8ecdf.cd3fa4",
"type": "delay",
"z": "88fe036.c4c23",
"name": "",
"pauseType": "delay",
"timeout": "20",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 760,
"y": 1660,
"wires": [
[
"9880dafa.7480c8"
]
]
},
{
"id": "9880dafa.7480c8",
"type": "function",
"z": "88fe036.c4c23",
"name": "Rotate 180 Text Red Background Blue Speed 5",
"func": "msg.background = \"off\";\nmsg.colour = \"off\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1020,
"y": 1660,
"wires": [
[
"71f8d9cf.684ee8"
]
]
},
{
"id": "71f8d9cf.684ee8",
"type": "rpi-sensehat out",
"z": "88fe036.c4c23",
"name": "",
"x": 1210,
"y": 1560,
"wires": []
},
{
"id": "82b4dd32.05812",
"type": "ui_group",
"z": "",
"name": "Cocktail",
"tab": "477bd088.4ab9e",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "477bd088.4ab9e",
"type": "ui_tab",
"z": "",
"name": "iTender",
"icon": "dashboard",
"order": 1
}
]
2. iTender speaks!
And today iTender speaks! A touch of fun in this crazy project!
For that I use "node-red-node-watson":
https://flows.nodered.org/node/node-red-node-watson.
I use more specifically the node "text-to-speech" for the configuration I invite you to watch this video :
I also use "node-red-contrib-play-audio" : https://flows.nodered.org/node/node-red-contrib-play-audio.
Here is the program that announces the name of the drink when I throw a cocktail.
[
{
"id": "efb146df.e35978",
"type": "ui_button",
"z": "88fe036.c4c23",
"name": "",
"group": "82b4dd32.05812",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"label": "Whisky - coca",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "0",
"payloadType": "num",
"topic": "",
"x": 520,
"y": 1340,
"wires": [
[
"b21d17b2.035368"
]
]
},
{
"id": "7cf61c23.eac3b4",
"type": "inject",
"z": "88fe036.c4c23",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"x": 340,
"y": 1340,
"wires": [
[
"efb146df.e35978"
]
]
},
{
"id": "b21d17b2.035368",
"type": "change",
"z": "88fe036.c4c23",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Whisky - Coca",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 720,
"y": 1340,
"wires": [
[
"c0e12916.1d2648"
]
]
},
{
"id": "c0e12916.1d2648",
"type": "watson-text-to-speech",
"z": "88fe036.c4c23",
"name": "Justin_iTender",
"lang": "fr-FR",
"langhidden": "fr-FR",
"langcustom": "NoCustomisationSetting",
"langcustomhidden": "",
"voice": "fr-FR_ReneeVoice",
"voicehidden": "",
"format": "audio/wav",
"password": "ti3XDHqn07I1",
"payload-response": false,
"default-endpoint": true,
"service-endpoint": "https://stream.watsonplatform.net/text-to-speech/api",
"x": 920,
"y": 1340,
"wires": [
[
"337a73ae.2dc26c"
]
]
},
{
"id": "337a73ae.2dc26c",
"type": "play audio",
"z": "88fe036.c4c23",
"name": "",
"voice": "0",
"x": 1110,
"y": 1340,
"wires": []
},
{
"id": "82b4dd32.05812",
"type": "ui_group",
"z": "",
"name": "Cocktail",
"tab": "477bd088.4ab9e",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "477bd088.4ab9e",
"type": "ui_tab",
"z": "",
"name": "iTender",
"icon": "dashboard",
"order": 1
}
]In the next report I will show you the cabinet plans, I am currently doing them. I am also thinking about integrating a car part into a machine.




Top Comments