Because it's not BBQ time in Europe currently, I have to cook my steak in the pan. Making the steak perfectly medium rare or well-done is a science for itself. Therefore, I decided to create something like a sous-vide cooker with my Sony Spresense, connected as smart home device to Amazon Alexa, and with audio output when finished cooking. I can either start the cooking process by Alexa with the command "Alexa, tell my steak to be medium rare," or use some buttons connected to the Spresense to set temperature and duration. Of course, besides steak it's also possible to cook vegetables inside the with water filled pot at different temperatures and durations.
I'm using an immersion coil to heat up the water. A thermistor is measuring the temperature. To heat or stop heating, I decided to not use a MOSFET or relay, because I didn't want to cut the power cable. I came up with the idea of using a remote power socket, controlable by 433MHz frequency. They are cheap and it was no problem because the coil doesn't have a start button that needs to be pushed to start.
Temperature SensorAt first, I needed to measure the temperature. My WS401 had a water resistant thermistor which suits perfect. To read the temperature, you measure the resistance, or better the voltage division. Therefore you need the know the default restistance of your thermistor. In my case I used a multimeter and measured 10k Ohm resistance. With the help of another resistor with the same resistance, you can create a small circuit for measurement. See Using a thermistor for some more information. Unfortunately, the Spresense only accepts 5V analog reading, also the link suggests to use 1.1V internal reference for more precise readings.
To calculate the temperature, you can use the Steinhart Equation. But it requires some unknown constants a, b and c, which was the second challenge with the thermistor. Also, I don't have a ntc-thermistor, what makes me not able to use the transformed β parameter equation that works without those unknown constants. To estimate the values, I have measure the resitance at three differnt temperatures 2°C, 50°C and 85°C, and used the gauß method to solve three steinhart equations, each with one of the measured temperature and resistance. The resistance needs to be calculated by equation R = 10K / (1023/ADC - 1). Afterwards, I had my unkown constants a, b and c for the calculation of all temperatures in between.
Remote Power SocketThe next step was dealing with the radio frequency to control the 433MHz power socket. I have a receiver and a sender. You need the receiver to retrieve the codes to power on and power off the socket. See 433MHhz for more information on how to use a 433MHz receiver and sender. For the final circuit, I only need the sender.
LCD Panel and ButtonsHaving all those connected, I was able to read the temperature and switch the socket (and therefore the immersion coil) on and off. Connecting the buttons to the Spresense was quite easy. Using an interrupt, I have conneted the buttons to the pins PIN-2, PIN-3 and PIN-4 of the Spresense's extension board. The interrupts execute when the pins get LOW. The result has 4 states, set temperature, set duration, cooking and finished. The temperature and the duration can be increased und decreased with one pin each. The last pin is to confirm and switch the states. An LCD was added to show the states and enable the user to define the paramters for the cooking.
Up to now, the solution was able to work independently and fullfill the main requirements.
Alexa Voice ControlAs for Smart Home standards, the device needs to be controlable by remote. I decided to use the Alexa for starting the cooking process. Unfortunately, the Spresense doesn't have a WiFi connection. After some problems with other remote technologies (such as RF24L01) I decided used an ESP2866 to receive the remote actions and pass them via UART serial communication to the Spresense. Currently, it's a one-way communication only, but this can be extended by yourself if needed. For the UART communication you must connect the pin RX of the Spresense with the TX of ESP, and the TX with the RX. The next important information is to use Serial2 of the Spresense for receiving commands. Similar to one of my previous projects Herb Box Eco System I have created an Alexa Skill with the intents to start the cooking process. The intent's parameters are forwarded to a website (php + mySQL database), wich is further requested by the ESP. A new action entry is removed and send via UART to the Spresense.
The intents inside the Alexa skill are:
- "tell my steak to be [option]" (option: "medium rare" = 52°C and 90 minutes, "well done" = 60°C and 60 minutes)
- "start cooking with [degrees] degrees for [minutes] minutes" (degrees and minutes are numbers)
- "start cooking for [minutes] minutes with [degrees] degrees" (degrees and minutes are numbers)
Last but not least, I added audio to give feedback when the cooking process is done. For the audio, I used the tutorial from Hackster. I was able to run an mp3 file from a SD card once and connected an external speaker by the audio jack. Here is still some optimization possible, because the speaker needs to be alive for the full time and the audio was only able to play once (https://stackoverflow.com/questions/54305160/repeatedly-play-audio-on-sony-spresense your help is welcome).
ResultI put the meat into a sous-vide vacuum film.
I asked Alexa to make my steak medium rare. This started the cooker for 90 minutes with 52°C.
I enjoyed the dish afterwards.
Comments