Difference between revisions of "Lazy Donkey"

From Microduino Wiki
Jump to: navigation, search
(Created page with "{{Language| Lazy Donkey}} {| style="width: 800px;" |- | ==Overview== Mr. donkey will have a rest when he has time, beat the desktop, it will obediently work. File: _304_Dozi...")
 
(Schematic)
 
(10 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
|
 
|
 
==Overview==
 
==Overview==
Mr. donkey will have a rest when he has time, beat the desktop, it will obediently work.
+
Mr. donkey is always too lazy to work. Only by beating the table will get him work.
 
[[File: _304_DozingDonkey-stater.jpg|600px|center]]
 
[[File: _304_DozingDonkey-stater.jpg|600px|center]]
 +
 
==Schematic==
 
==Schematic==
Use shock sensor detects the beat, and then let the motor run some distance the donkey
+
Use Microduino-shake sensor to detect the beat and let the motor lead the donkey to run forward for some distance. For the running speed and duration time, users can set by yourself based on personal needs.
 +
[[File: _304_DozingDonkey-sch-En.jpg|600px|center]]
  
forward. User can set the speed and duration time of donkey running.
 
[[File: _304_DozingDonkey-sch.jpg|600px|center]]
 
 
==Equipment==
 
==Equipment==
 
{|class="wikitable"
 
{|class="wikitable"
Line 16: Line 16:
 
|Module|| Number||Function  
 
|Module|| Number||Function  
 
|-
 
|-
|[[Microduino-CoreUSB/zh]]||1||Core board  
+
|[[Microduino-CoreUSB]]||1||Core board  
 
|-
 
|-
|[[Microduino-Sensorhub/zh]]||1||sensor hub
+
|[[Microduino-Sensorhub]]||1||sensor hub
 
|-
 
|-
| [[Microduino-Shack/zh]]||1||Shack sensor
+
| [[Microduino-Shake]]||1||Vibration sensor
 
|-
 
|-
| [[Microduino-Robot/zh]]||1||robot module
+
| [[Microduino-Robot]]||1||robot module
 
|-
 
|-
| [[Microduino-Motor/zh]]||1||DC motor module
+
| [[Microduino-Motor]]||1||DC motor module
 
|-
 
|-
 
| [[Motor]]||1||motor
 
| [[Motor]]||1||motor
 
|}
 
|}
[[File: _304_DozingDonkey-module.jpg|600px|center]]
+
[[File: _304_DozingDonkey-module-E.jpg|600px|center]]
  
 
==Preparation==
 
==Preparation==
Line 69: Line 69:
 
</source>
 
</source>
 
==Hardware Buildup==
 
==Hardware Buildup==
*Setup 1:Using the below diagram as reference, connect the sensors into the  
+
*Setup 1:Use the below diagram as reference and connect the sensors into the corresponding ports on the Hub module.
 
 
corresponding ports on the Hub module.
 
 
[[File: _304_DozingDonkey _hub.jpg|600px|center]]
 
[[File: _304_DozingDonkey _hub.jpg|600px|center]]
*Setup 2:Connect the motor to the Motor module as shown above.
+
*Setup 2:Connect the motor to the Motor module as it is shown above.
 
[[File: _304_DozingDonkey _Motor.jpg|600px|center]]
 
[[File: _304_DozingDonkey _Motor.jpg|600px|center]]
*Setup 3:According to your project needs, you can attach the motor accessories for  
+
*Setup 3:According to your project needs, you can attach the motor accessories for attachment to other devices.
 
 
attachment to other devices.
 
 
[[File: _304_DozingDonkey _Motor1.jpg|400px|center]]
 
[[File: _304_DozingDonkey _Motor1.jpg|400px|center]]
*Setup 4:Connect the activated Battery module to your Battery Management module.
+
*Setup 4:Connect the activated Battery box to your Battery Management module.
 
[[File:CoreUSB_Ble_steup2.jpg|600px|center]]
 
[[File:CoreUSB_Ble_steup2.jpg|600px|center]]
*Setup 5:Stack all the modules together in any order you like. Congratulations, you have  
+
*Setup 5:Stack all the modules together in any order you like. Congratulations, you have finished building the circuit!
 
+
[[File: _304_DozingDonkey _steup-ok-E.jpg|600px|center]]
finished building the circuit!
 
[[File: _304_DozingDonkey _steup-ok.jpg|600px|center]]
 
  
 
==Result==
 
==Result==
Tapping the table, shock sensor detects vibrations, the donkey moves forward 1 second.
+
By beating the table once, Microduino-Shake sensor can detect the vibration and the donkey will move forward accordingly for one second.
 
[[File: _304_DozingDonkey _lego-ok.jpg|600px|center]]
 
[[File: _304_DozingDonkey _lego-ok.jpg|600px|center]]
  

Latest revision as of 08:28, 30 October 2015

Language: English  • 中文

Overview

Mr. donkey is always too lazy to work. Only by beating the table will get him work.

304 DozingDonkey-stater.jpg

Schematic

Use Microduino-shake sensor to detect the beat and let the motor lead the donkey to run forward for some distance. For the running speed and duration time, users can set by yourself based on personal needs.

304 DozingDonkey-sch-En.jpg

Equipment

Module Number Function
Microduino-CoreUSB 1 Core board
Microduino-Sensorhub 1 sensor hub
Microduino-Shake 1 Vibration sensor
Microduino-Robot 1 robot module
Microduino-Motor 1 DC motor module
Motor 1 motor
304 DozingDonkey-module-E.jpg

Preparation

  • Setup 1:Connect the CoreUSB module to your computer and then start the Arduino IDE
CoreUSB Ble pc.jpg
  • Setup 2:Select Files > Examples > mCookie > _304_DozingDonkey
304 DozingDonkey load.jpg
  • Setup 3:Click upload to upload the program. When "Done Uploading" appears, the

program should have successfully been uploaded into the CoreUSB.

304 DozingDonkey load-ok.jpg

Program description

  • Control pin definitions explained.
#define motor_pinB 6  //Motor 1
#define motor_pinA 8  //Motor 1

//#define servo_pinB 5   //Motor 2
//#define servo_pinA 7   //Motor 2

const int vibrationPin = 10;  // Shack sensor
  • Locate the following code, where 255 is the maximum value of the motor speed, you can

adjust to any value from 0 to 255 (recommended value not less than 60, or may be

triggering Movies sensor stability).

  • Delay can be controlled motor running time, preset to 1000 ms, that one second, you can

modify it as needed.

void fullForward() {
  //digitalWrite(motor_pinB, HIGH);
  analogWrite(motor_pinB,255);//0-255
  digitalWrite(motor_pinA, LOW);
  delay(1000);
}

Hardware Buildup

  • Setup 1:Use the below diagram as reference and connect the sensors into the corresponding ports on the Hub module.
304 DozingDonkey hub.jpg
  • Setup 2:Connect the motor to the Motor module as it is shown above.
304 DozingDonkey Motor.jpg
  • Setup 3:According to your project needs, you can attach the motor accessories for attachment to other devices.
304 DozingDonkey Motor1.jpg
  • Setup 4:Connect the activated Battery box to your Battery Management module.
CoreUSB Ble steup2.jpg
  • Setup 5:Stack all the modules together in any order you like. Congratulations, you have finished building the circuit!
304 DozingDonkey steup-ok-E.jpg

Result

By beating the table once, Microduino-Shake sensor can detect the vibration and the donkey will move forward accordingly for one second.

304 DozingDonkey lego-ok.jpg

Video