Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitorccs/arduino-halloween-witch
Fun Halloween toy made in Arduino whichs detects people presence and plays an audio of a witch laughing
https://github.com/vitorccs/arduino-halloween-witch
arduino platformio
Last synced: 21 days ago
JSON representation
Fun Halloween toy made in Arduino whichs detects people presence and plays an audio of a witch laughing
- Host: GitHub
- URL: https://github.com/vitorccs/arduino-halloween-witch
- Owner: vitorccs
- License: gpl-3.0
- Created: 2023-10-24T03:58:16.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-11T15:51:39.000Z (about 1 year ago)
- Last Synced: 2024-11-18T22:36:14.709Z (3 months ago)
- Topics: arduino, platformio
- Language: C++
- Homepage:
- Size: 195 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Arduino Halloween Witch
Fun Halloween toy made in Arduino which detects human presence and plays an audio of a witch laughing.
## Video footage
Note: Before playing the video below, you must enable the sound by clicking on the toolbar button with a speaker icon:[video.webm](https://github.com/vitorccs/arduino-halloween-witch/assets/9891961/8df2df78-2068-4461-9dc9-b7e5add590b6)
## Description
![ArduinoHalloween_bb](https://github.com/vitorccs/arduino-halloween-witch/assets/9891961/438a9ba2-e9ba-4de0-9060-833ce816f3ac)This is a [Platform IO IDE](https://platformio.org/platformio-ide) project coded in C++.
Once a person is detected, the Arduino will firstly open and close the witch's legs twice, and afterwards will play an audio of a witch laughing.
Note: when using 04 AAA batteries (1.5v each, total 6v), you should connect the positive cable to the "VIN" pin since it has a built-in voltage regulator. However, with 04 rechargeable batteries (1.2v each, total 4.8v) it is acceptable to place the cable in "5v" pin. See [Arduino docs](https://docs.arduino.cc/learn/electronics/power-pins#vin-pin).
## Components
* 01 - HC-SR04 Ultrasonic sensor
* 01 - Speaker (8Ohms - 0.5 to 1.0 Watts)
* 01 - Micro Servo Motor 9g SG90 (or similar)
* 01 - BC547 transistor
* 04 - AAA batteries (or any 5v source supply)
* 01 - AAA batteries support## About PlatformIO IDE
Platform IO is a plugin for Microsoft Visual Studio Code. It is a more robust IDE compared to the official Arduino IDE. It also allows us to easily create our own private libraries and use a more object oriented code.## About the "witch hat"
You may create your own hat or buy any that fits the arduino components.
Find below the components used to create the legs movement:
* 02 - Sticks (like chopsticks)
* 02 - Nylon clamps
* 01 - A mechanism which attaches to a servo motor and creates the movement of opening and closing the legs ([like this one](https://www.robocore.net/item-mecanico/garra-robotica-ant_v2))
## Steps to change the audio sample
1) Download and install [Audacity](https://www.audacityteam.org/download/)
2) Import the MP3 audio and make the audio louder (Effect > Amplify)
3) Export a new version in 8KHz in mono mode. The file should not exceed 30.000 bytes.
4) Download the encoder program for your operating system:
* [EncodeAudio - Windows.zip](https://github.com/vitorccs/arduino-halloween-witch/files/13110714/EncodeAudio-windows.zip)
* [EncodeAudio - MacoOSX.zip](https://github.com/vitorccs/arduino-halloween-witch/files/13110716/EncodeAudio-macosx.zip)
* [EncodeAudio - Linux.zip](https://github.com/vitorccs/arduino-halloween-witch/files/13110717/EncodeAudio-linux.zip)
5) Unzip and run the application.
6) The application will prompt you to input an audio file. Select the audio file you have just created in the previous steps.
7) After a few seconds, the program will copy the encoded data to your clipboard
8) In the `main.cpp` file, delete the contents of `sample[]` array and paste the content from your clipboard. The data is a a very large sequence of numbers.Sources:
* https://www.codrey.com/arduino-projects/arduino-pcm-audio-primer/
* https://highlowtech.org/?p=1963
* https://www.youtube.com/watch?v=aaqaAXlZbuc## Fritzing file
The electronic schematic was created in the Fritzing software and can be downloaded at [ArduinoHalloween.zip](https://github.com/vitorccs/arduino-halloween-witch/files/13110614/ArduinoHalloween.zip)