<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.cqrobot.wiki/index.php?action=history&amp;feed=atom&amp;title=Shake_Sensor</id>
		<title>Shake Sensor - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.cqrobot.wiki/index.php?action=history&amp;feed=atom&amp;title=Shake_Sensor"/>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Shake_Sensor&amp;action=history"/>
		<updated>2026-04-05T18:25:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Shake_Sensor&amp;diff=2618&amp;oldid=prev</id>
		<title>Chenqi at 07:37, 25 September 2020</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Shake_Sensor&amp;diff=2618&amp;oldid=prev"/>
				<updated>2020-09-25T07:37:58Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:37, 25 September 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l129&quot; &gt;Line 129:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 129:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ls&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ls&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;sudo ./TS1732&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;sudo ./TS1732&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|[[File:Shake_Sensor-5.jpg |left|800px]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|[[File:Shake_Sensor-5.jpg |left|800px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Chenqi</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Shake_Sensor&amp;diff=2617&amp;oldid=prev</id>
		<title>Chenqi: Created page with &quot;Crash Sensor =='''Introduction'''== The vibration sensor is a digital sensor that is only sensitive to one-way manual swing. Adop...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Shake_Sensor&amp;diff=2617&amp;oldid=prev"/>
				<updated>2020-09-25T07:35:11Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php/File:Shake_Sensor-1.jpg&quot; title=&quot;File:Shake Sensor-1.jpg&quot;&gt;thumb|300px|right|Crash Sensor&lt;/a&gt; ==&amp;#039;&amp;#039;&amp;#039;Introduction&amp;#039;&amp;#039;&amp;#039;== The vibration sensor is a digital sensor that is only sensitive to one-way manual swing. Adop...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[File:Shake_Sensor-1.jpg|thumb|300px|right|Crash Sensor]]&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
The vibration sensor is a digital sensor that is only sensitive to one-way manual swing. Adopt spring-type vibration switch, output high level when stationary, when the user shakes strongly in the specified direction once, the module outputs a low level pulse, and the onboard indicator light flashes at the same time. Thanks to the unidirectional sensitivity characteristics of the vibration switch and the corresponding filter circuit, medium-strength collisions or vibrations (such as drops, shocks) will not trigger an interrupt signal by mistake, and have strong anti-shock interference capabilities. Just shake and wave, all kinds of switch control are in your hand.&lt;br /&gt;
&lt;br /&gt;
The module comes with a JST PA SMT 3-Pin buckle socket. Also, a JST PA SMT 3-Pin to DuPont female single-head wire is offered to facilitate wiring. Length: 210mm, buckle attached.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Product Size'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Shake_Sensor-2.jpg |left|400px]]&lt;br /&gt;
|[[File:PA_3Pin_Wire-3.jpg |left|400px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Connection Diagram'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Shake_Sensor-4.jpg |left|1000px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Specifications'''==&lt;br /&gt;
'''Module'''&lt;br /&gt;
*Operating Voltage: 3.3V-5.0V&lt;br /&gt;
*Switch Life: more than 200,000 times&lt;br /&gt;
*Communication Interface: JST PA SMT 3-Pin interface&lt;br /&gt;
*Dimensions: 30mm * 22mm&lt;br /&gt;
*Fixing Hole Size: 3mm &lt;br /&gt;
'''Wire'''&lt;br /&gt;
*Withstand Voltage: ＜50V&lt;br /&gt;
*Withstand Current: ＜1000MA&lt;br /&gt;
*Length: 21CM&lt;br /&gt;
*Wire Sequence: Black - Negative power supply, Red - Positive power supply, Green - Digital signal output (Stand still - High level, Shaking - Low-level pulse)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Demo for Arduino'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define LED_PIN                 13&lt;br /&gt;
#define DIGITAL_INPUT_PIN       3             //Connect the sensor to digital Pin 3 which is Interrupts 1.&lt;br /&gt;
&lt;br /&gt;
int stateFlag = 0;&lt;br /&gt;
unsigned long timepoint = 0;&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  pinMode(LED_PIN, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
  // Set to input mode with internal pull-up.&lt;br /&gt;
  // This can ensure generating intterupts under 3.3V power supply.&lt;br /&gt;
  pinMode(DIGITAL_INPUT_PIN, INPUT_PULLUP);&lt;br /&gt;
&lt;br /&gt;
  attachInterrupt(1, toggleLED, FALLING);     // Trigger LED toggle function when the falling edge is detected&lt;br /&gt;
  timepoint = millis();&lt;br /&gt;
}&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  // toggle onboard LED&lt;br /&gt;
  if (stateFlag != 0) {&lt;br /&gt;
    digitalWrite(LED_PIN, HIGH);&lt;br /&gt;
  }&lt;br /&gt;
  else {&lt;br /&gt;
    digitalWrite(LED_PIN, LOW);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Interrupt serivce routinue&lt;br /&gt;
void toggleLED()&lt;br /&gt;
{&lt;br /&gt;
  // The hardware has done some filter.&lt;br /&gt;
  // To further improve stability, here add a 50ms for debouncing.&lt;br /&gt;
  // This will not block the main function.&lt;br /&gt;
  if (millis() - timepoint &amp;gt; 500) {&lt;br /&gt;
    timepoint = millis();&lt;br /&gt;
    stateFlag = (stateFlag + 1) % 2;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Test Methods and Results'''&lt;br /&gt;
&lt;br /&gt;
Wire up, upload code to Arduino board and plug in power. The ON indicator will flash once when shaking sensor once, and L indicator of Arduino board will light up or go off once.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Demo for Raspberry Pi'''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;wiringPi.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
// interrupt pins&lt;br /&gt;
#define  btn_pin 1 // the pin of button&lt;br /&gt;
// interrupt flag,  &lt;br /&gt;
int flag = 0;&lt;br /&gt;
//  this function will be run once interrupt happens&lt;br /&gt;
void blank(void){&lt;br /&gt;
    flag = 1;&lt;br /&gt;
}&lt;br /&gt;
int main (void)&lt;br /&gt;
{&lt;br /&gt;
    wiringPiSetup();&lt;br /&gt;
    pinMode(btn_pin, INPUT);&lt;br /&gt;
    pullUpDnControl (btn_pin, PUD_UP); // it is vital to set the interrupt pinto pull-up inout&lt;br /&gt;
    delay(100);&lt;br /&gt;
    wiringPiISR(btn_pin,INT_EDGE_FALLING,&amp;amp;blank);&lt;br /&gt;
    while(1){&lt;br /&gt;
        if(flag == 1){&lt;br /&gt;
            delay(20); // delay to eliminate the jitter of button&lt;br /&gt;
            if(flag == 1){&lt;br /&gt;
                flag = 0; // reset flag&lt;br /&gt;
                // LED flashes&lt;br /&gt;
               printf(&amp;quot;Vibrative\n&amp;quot;);&lt;br /&gt;
                delay(100);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Test Methods and Results'''&lt;br /&gt;
&lt;br /&gt;
1. Connect sensor to Raspberry pi 4B board, and put test code in folder way into Raspberry pi system.&lt;br /&gt;
&lt;br /&gt;
2. Execute the following command in the terminal and run the program.The ON indicator will flash once when shaking sensor once, the character Vibrative will be displayed on Raspberry pi terminal for one time and press Ctrl+C to end the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd TS1732&lt;br /&gt;
ls&lt;br /&gt;
gcc TS1732.c -o TS1732 -lwiringPi&lt;br /&gt;
ls&lt;br /&gt;
sudo ./TS1732&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Shake_Sensor-5.jpg |left|800px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Chenqi</name></author>	</entry>

	</feed>