Difference between revisions of "Say Cheese"

From Microduino Wiki
Jump to: navigation, search
(Hardware Buildup搭建硬件)
 
(2 intermediate revisions by 2 users not shown)
Line 22: Line 22:
 
| [[mCookie-BM]]||1||Battery management
 
| [[mCookie-BM]]||1||Battery management
 
|-
 
|-
| [[Microduino-Sound]]||1||Sound detection sensor  
+
| [[Microduino-Microphone]]||1||Sound detection sensor  
 
|-
 
|-
| [[Microduino-IR transmitter]]||1||Infrared transmitting sensor  
+
| [[Microduino-IR Emitter]]||1||Infrared transmitting sensor  
 
|}
 
|}
 
[[File: take_photo-module.jpg|600px|center]]
 
[[File: take_photo-module.jpg|600px|center]]
  
 
==Program Download==
 
==Program Download==
*Setup 1:Connect CoreUSB and your PC/Mac with a USB cable, and then open Arduino IDE.
+
*Setup 1: Connect CoreUSB and your PC/Mac with a USB cable, and then open Arduino IDE.
 
[[Image:CoreUSB_Ble_pc.jpg|600px|center]]
 
[[Image:CoreUSB_Ble_pc.jpg|600px|center]]
*Setup 2:Click file > example> mCookie > _204_JoyfulGreeter
+
*Setup 2: Click file > example> mCookie > _205_SayCheese
 
[[File: take_photo-upload2.jpg|600px|center]]
 
[[File: take_photo-upload2.jpg|600px|center]]
*Setup 3:Select the right board and COM port, and then download the program.
+
*Setup 3: Select the right board and COM port, and then download the program.
 
[[File: take_photo-upload3.jpg|600px|center]]
 
[[File: take_photo-upload3.jpg|600px|center]]
 +
 
==Software Debugging==
 
==Software Debugging==
 
*Define Sony camera infrared transmitting code  
 
*Define Sony camera infrared transmitting code  
Line 90: Line 91:
  
 
==Hardware Buildup==
 
==Hardware Buildup==
*Setup1:Connect MIC sensor to A0 pin of the Sensorhub and infrared transmitting sensor to D6 pin.  
+
*Setup1: Connect MIC sensor to A0 pin of the Sensorhub and infrared transmitting sensor to D6 pin.  
 
[[file: take_photo _setup_1.jpg |600px|center]]
 
[[file: take_photo _setup_1.jpg |600px|center]]
*Setup2:Connect the activated battery box and BM module.  
+
*Setup2: Connect the activated battery box and BM module.  
 
[[File:CoreUSB_Ble_steup2.jpg|600px|center]]
 
[[File:CoreUSB_Ble_steup2.jpg|600px|center]]
*Setup3:Stack all modules together without fixed order and finish the buildup.  
+
*Setup3: Stack all modules together without fixed order and finish the buildup.  
 
[[file: take_photo _steup_ok.JPG|600px|center]]
 
[[file: take_photo _steup_ok.JPG|600px|center]]
  

Latest revision as of 07:00, 30 September 2016

Language: English  • 中文

Objective

Say "Cheese!" towards MIC, it will send out infrared signal and at the same time, the camera will take a picture.

Take photo.jpg

Principle

Take photo-sch.jpg

Equipment

Module Number Function
mCookie-CoreUSB 1 Core board
mCookie-Hub 1 Sensor pin board
mCookie-BM 1 Battery management
Microduino-Microphone 1 Sound detection sensor
Microduino-IR Emitter 1 Infrared transmitting sensor
Take photo-module.jpg

Program Download

  • Setup 1: Connect CoreUSB and your PC/Mac with a USB cable, and then open Arduino IDE.
CoreUSB Ble pc.jpg
  • Setup 2: Click file > example> mCookie > _205_SayCheese
Take photo-upload2.jpg
  • Setup 3: Select the right board and COM port, and then download the program.
Take photo-upload3.jpg

Software Debugging

  • Define Sony camera infrared transmitting code
#define PHOTO 0xB4B8F
  • Control pin definition
#define mic_pin A0
#define IR_pin 6
  • Sound trigger value
#define voice 400#define voice 400
  • When the sound is louder than the trigger value, the camera will be triggered after a period of time delay and counting. The time delay is decided by function values of "num" and "delay". Users can also change the related parameters can have a try. Taking picture is controlled by the function "take", which can only send photographing instruction once.
  if (voice_data > voice && take == false)
  {
    time = millis();
    num++;
    delay(10);
    Serial.println(num);
    if (num > 20)
    {
      take = true;
      takePhoto();
      Serial.println("takePhoto...");
    }
  }
  • The next shot can be triggered one second later after detecting no sound.
  else if (millis() - time > 1000 )//Take pictures after one second.   {
    voice_data = analogRead(mic_pin);
    if (voice_data < voice)
    {
      num = 0;
      take = false;
    }
    time = millis();
  }
  • Send photographing instruction function
 void takePhoto()
{
  for (int i = 0; i < 3; i++)
  {
    irsend.sendSony(PHOTO, 20); // Sony code
    delay(10);
  }
}

Hardware Buildup

  • Setup1: Connect MIC sensor to A0 pin of the Sensorhub and infrared transmitting sensor to D6 pin.
Take photo setup 1.jpg
  • Setup2: Connect the activated battery box and BM module.
CoreUSB Ble steup2.jpg
  • Setup3: Stack all modules together without fixed order and finish the buildup.
Take photo steup ok.JPG

Caution

Take photo case.JPG

Result

Yell at MIC and trigger the camera.

Take photo legao-ok.JPG

Video