With COVID-19 still persisting, many are deciding to postpone or even cancel their Halloween plans due to safety concerns. The main issue with Halloween, in regards to safety, is Trick or Treating; the sheer amount of social interaction present in Trick or Treating means that a single person could unknowingly spread the virus to hundreds of other people. While masks could help they aren't foolproof, when you consider how many people a single household can interact with in a night, there is an extremely high possibility that someone will catch the virus.

What it does

If you can eliminate all door to door contact present in Trick or Treating then you can preserve Trick or Treat whilst preserving the health of the Trick or Treaters. This is what the Voice Activated Candy Dispenser aims to do. The project consists of two main parts, the Arduino and its accompanying hardware and a companion app. The companion app is responsible for speech recognition, it pairs with a HC-05 Bluetooth receiver and prompts it to signal the Arduino to dispense candy when it detects the phrase "Trick or Treat". The app uses Google Cloud's Realtime Speech Recognition function to perform speech recognition. Upon entering "speech mode" the app begins a speech recognition session. Once the session yields a result or times out, a new session is launched. Once the HC-05 receives a signal from the app it alerts the Arduino to turn the motor on and dispense candy. Because the Arduino lacks the power to turn on the motor, an N-channel MOSFET coupled with an external battery pack is used to power the motor.

How I built it

I built the companion app in android studio and wrote the code for the hardware with the Arduino IDE. For speech recognition I used Google Cloud's Realtime Speech Recognition function.

Challenges I ran into

I ran into many challenges when attempting to build this hack, probably the biggest challenge was building the cardboard frame of the dispenser and powering it through a motor. When I began to build this hack I used the Arduino to power the motor however I quickly realized that the Arduino lacked the voltage to power the motor and so I had to use an external battery pack and a N-channel MOSFET. In addition to this, developing the app and getting it to connect to a Google Cloud API was also a challenge.

Accomplishments that I'm proud of

I am extremely proud of the fact that I was able to build a functioning project with completed hardware and software in just 24 hours.

What I learned

While the concept behind this hack seems simple enough, I learnt surprising amount in the process of building it, for one I learnt some of the basics behind professional app development, I learnt how to build a Java based app from scratch, package it into an APK and deploy it on a physical device. I learnt how to call APIs from said app. I learnt about Bluetooth communication and Serial communication. I also learnt about MOSFETs and how to use them to regulate the flow of power with a circuit.

What's next for Voice Activated Candy Dispenser (VACD)

I would like to add a "trick" function to the project so that every time a person says "trick-or-treat" the project randomly chooses to give them a candy (treat) or to play a scary sound (trick).

Built With

Share this project: