Electronic Greeting Card

From Microduino Wiki
Jump to: navigation, search


Overview

Anywhere Electronic cards.jpg

Make an electronic greeting card which can play Happy Birthday to You automatically as it is open. Suitable kits: mCookie102, mCookie202, mCookie302, IBC


Module Bill

Module

Module Number Function
mCookie-Core 1 Core board
Battery base 1 Program download and power supply
mCookie-Hub 1 sensor adapter plate
Line Finder 1 Detect objects
Buzzer 1 Produce sound

Other Equipment

  • USB cable*1
  • Sensor cable*1
  • Sensor shell*1
  • Lego or other fixation structure
Anywhere Electronic cards-module.jpg


Module Setup

Anywhere Electronic cards—step.jpg
  • Assemble the modules and sensors:
    • Stick the red core module, battery base and green extension module together;
    • Connect the line finder to pin A0/A1 of Hub;
    • Connect the buzzer to pin 6/7 of Hub;
    • Insert one end of USB cable into the USB upload module, and connect the other to the computer;


Programming

Required Program Blocks

Programming Thought

Wait for the line finder to detect the distance, and judge whether it is larger than 300, if it is, it will play the music.

Mixly-ctrl-Electronic cards.jpg

Start to Program

Wait for the distance value of line finder to be larger than 300(open the card), and then play the Happy Birthday to You.

Mixly-ctrl-Electronic cards-code.jpg


Test the result
After upload the program, it will play Happy Birthday to You just as the line finder isn’t covered.

Anywhere Electronic cards.jpg



Q: Can a color LED be added to the electronic greeting card?
A: Yes, it can, you can make it light up while the Happy Birthday to You is played.
Active the color LED before play the Happy Birthday to You. Turn the color LED off after the song is over.

Mixly-ctrl-Electronic cards-code1.jpg


Technical Specification


Related Cases


Q&A

  • Q: Why can't the buzzer ring, directly connected to the power supply?
    • A: Because the buzzer belongs to passive buzzer, only changed voltage signal can make it ring. It is the active buzzer that can ring after added voltage.
  • Q: Can the buzzer sing?
    • A: It can emit do, re, mi, fa, sol, la, si of different frequencies, and can make up music, please refer to Music Painting. If you want to play music, audio decoder chip and horn are required.