Vibration Detection

From Microduino Wiki
Revision as of 09:41, 23 March 2016 by Admin (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Function of the Module

  • Please refer to: Microduino-Shake
  • As a digital input sensor, it can only detect "0" and "1", that is "Yes" and "No".

Overview

To use the Shake sensor to detect if there is vibration and print monitored data in the serial monitor.

Bill of Material

  • Module
Module Number Function
mCookie-CoreUSB 1 Core board
mCookie-Hub 1 Sensor pin board
Microduino-Shake 1 Vibration sensor
  • Other Hardware Equipment
    • One USB cable


Hardware Buildup

  • Setup 1:Connect the interface of the Shake with the digital port (10) of the Hub. Accessible Hub pins: 0,2,4,6,8,10 and 12.
  • Setup 2:Connect the CoreUSB, Hub and Shake sensor to the computer with a USB cable.

Mixly Programming

  • Step1:Since using serial monitor, we need to find "Serial Communication" from "Communication" item.
Mixly Serial.jpg
  • Step2:"Serial Communication" description.
  • Step3:The Shake sensor is an input device while the returned data is digital quantity, based on which we can find and drag out the digital input and output from "Input/Output".
  • "Digital Input" description.
  • Overall code description.

Debugging

  • Step1:Select the right board card(Core USB 32U4) and COM port(Recognized automatically by default).
Mixly board COM.jpg
  • Step2:Open the serial monitor.
Mixly COMXX.jpg
  • Step3:Check if the serial baud rate is the same with the pre-set one.
Mixly COMXX ok.jpg
  • Step4:Observe the data, which is "0" when no vibration happens and is "1" when there is a vibration. You can also see the indicator blink when there is a vibration.