Difference between revisions of "Remote Controlled Karaoke Machine"

From Microduino Wiki
Jump to: navigation, search
(Created page with "{| style="width: 1000px;" |- | ==Outline== 600px|center Let’s make a remote controlled karaoke machine, which can be controlled to...")
 
Line 7: Line 7:
 
[[File:anywhere_remote-musicplay.jpg|600px|center]]
 
[[File:anywhere_remote-musicplay.jpg|600px|center]]
  
Let’s make a remote controlled karaoke machine, which can be controlled to play different songs by IR remote control.  
+
Let's make a remote controlled karaoke machine, which can be controlled to play different songs by IR remote control.  
  
 
<br>
 
<br>
Line 45: Line 45:
 
**It can receive the external infrared signal, as well as the signal emitted by IR remote control.  
 
**It can receive the external infrared signal, as well as the signal emitted by IR remote control.  
 
*'''IR remote control'''
 
*'''IR remote control'''
**If you have installed an “IR receiver” on your application, you can use remote control to control it.  
+
**If you have installed an "IR receiver" on your application, you can use remote control to control it.  
 
[[File:anywhere_remote-musicplay-module—step.jpg|600px|center]]
 
[[File:anywhere_remote-musicplay-module—step.jpg|600px|center]]
 
*Assemble modules and sensors:  
 
*Assemble modules and sensors:  
Line 56: Line 56:
 
==Programming==
 
==Programming==
 
===Required Program Blocks===
 
===Required Program Blocks===
*[[“Buzzer on-song” program block]]
+
*[["Buzzer on-song" program block]]
*[[“If-do”program block]]
+
*[["If-do" program block]]
*[[“IR receive” program block]]
+
*[["IR receive" program block]]
*[[“IR receive enable” program block]]
+
*[["IR receive enable" program block]]
  
 
===Programming Thought===
 
===Programming Thought===
Line 88: Line 88:
 
<br>
 
<br>
 
==FAQ==
 
==FAQ==
*Q: Why does the buzzer not buzz when connect directly to the power supply? **A: Because the buzzer is passive, only changed voltage signal can make it buzz. The active buzzer can buzz if only it is connected to the power supply.  
+
*Q: Why does the buzzer not buzz when connect directly to the power supply?
 +
**A: Because the buzzer is passive, only changed voltage signal can make it buzz. The active buzzer can buzz if only it is connected to the power supply.  
 
<br>
 
<br>
 
*Q: Can the buzzer sing songs?  
 
*Q: Can the buzzer sing songs?  
 
**A: It can produce tunes do, re, mi, fa, sol, la, si of different frequency, which can make up songs. Please refer to [[Music Painting]]. If you want to play the music, you are supposed to have an audio decoding ship and a horn.  
 
**A: It can produce tunes do, re, mi, fa, sol, la, si of different frequency, which can make up songs. Please refer to [[Music Painting]]. If you want to play the music, you are supposed to have an audio decoding ship and a horn.  
 
<br>
 
<br>
*Q: Why can’t we select the songs when it is playing music?  
+
*Q: Why can't we select the songs when it is playing music?  
**A: Because the “Buzzer on-song” program block has integrated the code, it has internal delay. Only after it has executed the song can it execute other control command.  
+
**A: Because the "Buzzer on-song" program block has integrated the code, it has internal delay. Only after it has executed the song can it execute other control command.  
 
|}
 
|}

Revision as of 06:56, 13 October 2016


Outline

Anywhere remote-musicplay.jpg

Let's make a remote controlled karaoke machine, which can be controlled to play different songs by IR remote control.


Suitable kits: mCookie202, mCookie302, IBC


Module Bill

Module

Module Number Function
mCookie-Core 1 Core board
Battery box 1 Program download and power supply
mCookie-Hub 1 Sensor adapter plate
Buzzer 1 Produce sound
IR Receiver 1 Receive infrared signal

Other Equipment

  • USB cable*1
  • Sensor cable*2
  • IR remote control
  • Sensor shell*1
  • Lego or other fixation structure
Anywhere remote-musicplay-module.jpg


Module Setup

Look at the New Sensors

Anywhere remote.jpg
  • IR Receiver
    • It can receive the external infrared signal, as well as the signal emitted by IR remote control.
  • IR remote control
    • If you have installed an "IR receiver" on your application, you can use remote control to control it.
Anywhere remote-musicplay-module—step.jpg
  • Assemble modules and sensors:
    • Stick the red core module, battery base and green extension module together;
    • Connect the buzzer to pin 8/9 of Hub;
    • Connect the IR receiver to pin 4/5 of Hub;
    • Insert one end of USB into the USB upload module, and connect the other to computer;


Programming

Required Program Blocks

Programming Thought

Detect whether there was IR signal received. If signal of button A, B and C was received, it will play the corresponding song. After that, IR receiver is enabled, waiting for the next receipt.

Mixly-ctrl-remote-musicplay.jpg

Start to Program

IR remote controlled karaoke machine
Save the command code received by the IR receiver of pin 4 in variable ir_code.
Fill in the if program block according to the command code of remote control A, B and C written before, and play different songs according to different codes.
After that, enable the IR receiver of pin 4.

Mixly-ctrl-remote-musicplay-code.jpg

Test the result
After upload, press button A, B and C of the remote control toward the IR receiver, and it will play different songs. Only after a song is played completely and the IR receiver is enabled can the next song be played.

Anywhere remote-musicplay.jpg

Technical Specification

  • The product number of IR Receiver:
  • For details about IR receiver, please refer to Sensor-IR Receiver.


Related Cases


FAQ

  • Q: Why does the buzzer not buzz when connect directly to the power supply?
    • A: Because the buzzer is passive, only changed voltage signal can make it buzz. The active buzzer can buzz if only it is connected to the power supply.


  • Q: Can the buzzer sing songs?
    • A: It can produce tunes do, re, mi, fa, sol, la, si of different frequency, which can make up songs. Please refer to Music Painting. If you want to play the music, you are supposed to have an audio decoding ship and a horn.


  • Q: Why can't we select the songs when it is playing music?
    • A: Because the "Buzzer on-song" program block has integrated the code, it has internal delay. Only after it has executed the song can it execute other control command.