The Spice Assistant

by mcconnbb in Circuits > Microcontrollers

121 Views, 0 Favorites, 0 Comments

The Spice Assistant

PXL_20230429_065152710 (1).jpg
the spice assistant

If you're like me and cook often, you've had this experience: you want to grab your spice bottles but your hands are dirty. I created the spice assistant to attempt to remedy this problem. I used servos as latches to open and close the spice containers, meaning you don't have to touch anything but the spices. The gesture sensor allows you go pick which spice you want without touching anything. I also added a Dune quote for a funny touch.

Supplies

  • Raspberry Pi Pico W
  • 1/8 inch Baltic Birch wood
  • 2 simple rotation servos
  • APDS 9960 gesture sensor
  • Pins and alligator clips
  • Hamburger speaker
  • Wood glue
  • Mounted SD card

Create the Containers and Overall Structure

First, design the apparatus in Adobe Illustrator. There is one large base that everything else is attached to. The design has slots so the pieces can fit into each other. For the containers, the tops are constructed with living hinges that allow them to bend and the servos to hold them in place. It's important that you measure the distance between the panels correctly so the servo has enough space to fit in.

Downloads

Put the Pieces Together

PXL_20230429_065143145.jpg

I used wood glue to make the pieces stick together. The assembly is fairly simple, but it's important to let the wood glue dry completely before working with the pieces. I also suggest keeping the living hinge doors down as much as possible, as this helps to reduce their elastic potential and allows the servo to keep them in place easier.

Prepare the Code

The code is fairly simple and involves a lot of status checking on the two containers. First, set up the libraries and all of the components, including the SD card, mp3 player, speaker, LID sensors, and servos. Then, initialize the servos by setting the two status variables to the correct setting. The while true loop will then check the two status variables and move the servos accordingly. I used the play_mp3 function to unlock the containers, which allowed the audio to be played at the same time as the movement.

Downloads

Wire Everything Together

PXL_20230429_060752074.jpg

The design uses a lot of wires, and some of them were a little difficult to fit through the holes. I used the two left rails for the two power ports, VBUS and 3.3VOUT. Here's the list:

  • Servo 1: signal to GP14, power to VBUS, ground to GND
  • Servo 2: signal to GP15, power to VBUS, ground to GND
  • SD Card: power to 3.3 VOUT, ground to GND, SCK to GP10, SI to GP11, SO to GP12, CS to GP13
  • Gesture I2C (assumes you have an I2C connection bus): black to GND, red to 3.3 VOUT, blue to GP4, yellow to GP5
  • Speaker: base to GND, tip to GP22

Get and Prepare the Audio File (optional)

audacity.PNG
ytmp3.PNG

For an added touch, I added an audio file that plays the Dune soundbite "The spice must flow!" First, I used a Youtube to MP3 Converter to convert the video to an MP3 file. I then used Audacity to change the format from stereo to mono and reduce the sample rate to 22000 Hz. I also raised the volume, but this is optional. Then, I put the MP3 from Audacity onto the SD card and plugged it into the Pico.

Put Everything Together and Turn It On!

You can power it either through a USB cable from your computer or a portable battery pack. A demonstration of how mine works is at the top!