Difference between revisions of "Electronic Greeter (X02)"
(Created page with "right|thumb|Electronic Greeter Project Build =About= This project uses the PIR sensor to detect heat. If a heat signature is detect...") |
(→Debugging) |
||
Line 48: | Line 48: | ||
4. Upload the program by clicking on the '''right arrow icon''' on the top left of the window. Or under '''Sketch > Upload'''. | 4. Upload the program by clicking on the '''right arrow icon''' on the top left of the window. Or under '''Sketch > Upload'''. | ||
==Debugging== | ==Debugging== | ||
− | *Open the Serial monitor. Information on the | + | *Open the Serial monitor. Information on detecting the the Audio module (successfully or failed) and start / stop playing of music will be outputted. |
− | |||
==Tweaking== | ==Tweaking== |
Revision as of 23:55, 14 March 2017
Contents
About
This project uses the PIR sensor to detect heat. If a heat signature is detected. Sound will play, such as a song or a sound byte. An addition, the LED Matrix will turn on. When there is no heat signature the sound will turn off. Along with the LED Matrix.
This project was designed for the second generation mCookie Maker kits (202 Advanced and 302 Expert kits).
Required Materials
- 1 x mCookie Core
- 1 x mBattery (202/302 Kit)
- 1 x mCookie Sensor Hub
- 1 x LED Matrix
- 1 x Audio Pro Module
- 1 x MicroSD Module
- 1 x PIR Sensor
- 1 x Sensor Cable
- 1 x MicroSD Card
- 2 x Speaker
- 1 x MicroUSB Cable
Build
Sound File
- There should be a MicroSD card and reader included in 202 and 302 kits.
- Put an MP3 file onto the root of your MicroSD Card with the name a.mp3. This is the file this program looks to play when activated. It can be a sound effect or a song (such as Alan Walker's Fade).
- Or download the a simple tone effect here: http://soundbible.com/grab.php?id=1815&type=mp3. Make sure to save it on the MicroSD card as a.mp3.
Assembly
NOTE: When connecting sensor wires, push on the plastic connector and not on the wires. Pushing on the wire can damage them.
- Connect the PIR Sensor to the Sensor Hub on Pin 6/7
- Connect the Two Speakers to the Audio Pro Module.
- Insert the MicroSD card with the a.mp3 file into the MicroSD Module.
- Create two stacks containing:
- (Bottom of Stack) MicroSD Module | Audio Pro Module | Sensor Hub (Top of Stack)
- (Bottom of Stack) Core | LED Matrix (Top of Stack)
- Stack the two stacks onto the mBattery
- Plug in the MicroUSB cable to the mBattery to a computer.
Program
1. Connect mCookie Core to the PC with the USB Cable. Open the Microduino IDE.
2. Copy and paste the code below and upload.
3. Select the board, processor and port:
- Go to Tools > Board and select Microduino/mCookie-Core (328p)
- Go to Tools > Processor and select Atmega328P16M,5V
- Go to Tools > Port and select the available port
4. Upload the program by clicking on the right arrow icon on the top left of the window. Or under Sketch > Upload.
Debugging
- Open the Serial monitor. Information on detecting the the Audio module (successfully or failed) and start / stop playing of music will be outputted.
Tweaking
Variables can be edited to change the threshold / detection value for various functions to better fine tune to your environment.
DEBUG will enable debugging mode. Which outputs information to the Serial Port.
MIC_MIN is the minimum value from the Microphone that will anger Grandpa.
- Adjustable between 0 ~ 1023
- Default is 200
NOISE_TIME is the time in milliseconds (1 second = 1000 milliseconds) where minimum noise level is maintained which will anger Grandpa.
- Default is 200
Usage
Cause enough noise (MIC_MIN) for a time period (NOISE_TIME) and this will anger Grandpa. Grandpa will start yelling (making noise with the Buzzer). Once, Grandpa is angry. Calm him down by pressing the button.