Reports.SQ-SEN-200 History

Hide minor edits - Show changes to output

Deleted line 77:
Deleted line 78:
Changed lines 73-74 from:
!!! [[http://pitaru.com/itp/sensors-workshop/final_signalquest/applet_include.html | Click here to view a processing simulation of the algorythm (external link to http://pitaru.com).]]
to:
!!!! [[http://pitaru.com/itp/sensors-workshop/final_signalquest/applet_include.html | *Click here to view a processing simulation of the algorythm (external link to http://pitaru.com).]]
Changed lines 4-6 from:
!!!Omnidirectional Tilt and Vibration Sensor
Model: SQ-SEN-200
to:
!!Omnidirectional Tilt and Vibration Sensor, Model SQ-SEN-200 (/390)
Deleted lines 9-10:
!!!!See original report page on [[http://pitaru.com/itp/sensors-workshop/final_signalquest/ | pitaru.com]], containing a java applet which is not included here (at the end of the page).
Changed lines 71-72 from:
The following PicBasicPro code demonstrates the simplest implementation of motion detection, using the sensor. This code will disregard the interrupt routines mentioned above . The program will light up an LED when motion is detected. Every 50ms, the input-pin will be checked. If its state has changed since the last check, a counter will increase by 5, otherwise it will decrease by 1. If the counter rises above 25, we will light up the LED. When it drops below 25, the led will be turned off:
to:
The following PicBasicPro code demonstrates the simplest implementation of motion detection, using the sensor. This code will disregard the interrupt routines mentioned above . The program will light up an LED when motion is detected. Every 50ms, the input-pin will be checked. If its state has changed since the last check, a counter will increase by 5, otherwise it will decrease by 1. If the counter rises above 25, we will light up the LED. When it drops below 25, the led will be turned off.

!!! [[http
://pitaru.com/itp/sensors-workshop/final_signalquest/applet_include.html | Click here to view a processing simulation of the algorythm (external link to http://pitaru.com).]]
Changed line 1 from:
(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
to:
(:table border=0 cellpadding=5 cellspacing=0 width=1000 :)
Added line 77:
!!! ADAPT FOR THROUGH-HOLE
Changed line 81 from:
(:table border=0 cellpadding=20 cellspacing=20 width=1000 :)
to:
(:table border=0 cellpadding=20 cellspacing=20 width=500 :)
Changed line 76 from:
(:cell width = 250:)
to:
(:cell width = 250 align=center:)
Deleted line 81:
(:cell width = 200:)
Added lines 75-78:

(:cell width = 250:)
ThisWiki:/uploads/Reports/strip.jpg
Deleted lines 150-152:

(:cell width = 250:)
ThisWiki:/uploads/Reports/strip.jpg
Changed lines 2-3 from:
(:cell width = 800:)
to:
(:cell width = 600:)
Changed lines 148-149 from:
(:cell width = 200:)
Attach:ThisWiki:/uploads/Reports/strip.jpg
to:
(:cell width = 250:)
ThisWiki:/uploads/Reports/strip.jpg
Changed line 149 from:
Attach:strip.jpg
to:
Attach:ThisWiki:/uploads/Reports/strip.jpg
Changed line 149 from:
[[Attach:strip.jpg]]
to:
Attach:strip.jpg
Deleted line 1:
(:cell width = 200:)
Added lines 148-149:
(:cell width = 200:)
[[Attach:strip.jpg]]
Changed lines 85-127 from:
'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor

sensorPrev VAR BYTE

sensorPrev = tilt

'a counter- increases when the sensor moves

sensorCount VAR WORD

sensorCount = 0

'a couter - increases on every loop iteration

gapcount VAR WORD

gapcount = 0

'this variable determines how often we check for sensor changes.

gap VAR WORD

gap = 500

'take a breather

PAUSE 1000

'beginning of main loop routine

main:

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -

'- once every {gap} cycles. In this code - once every 500 loops.

IF gapcount > gap THEN
to:
'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor
sensorPrev VAR BYTE
sensorPrev = tilt

'a counter- increases when the sensor moves
sensorCount VAR WORD
sensorCount = 0

'a couter - increases on every loop iteration
gapcount VAR WORD
gapcount = 0

'this variable determines how often we check for sensor changes.
gap VAR WORD
gap = 500

'take a breather
PAUSE 1000

'beginning of main loop routine
main:

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -
'- once every {gap} cycles. In this code - once every 500 loops.

IF gapcount > gap THEN
Deleted line 117:
Deleted line 120:
Changed lines 143-144 from:
ENDIF
to:
ENDIF
Changed lines 146-148 from:
'loop again...
GOSUB main
to:
'loop again...
GOSUB main
Changed line 9 from:
to:
Changed lines 82-85 from:
'Place the sensor is on portB.2

sensorPin VAR portB.2 : TrisIO.2=1
to:
'Place the sensor is on portB.2
sensorPin VAR portB.2 : TrisIO.2=1
Deleted line 85:
Added line 83:
Added line 93:
Added line 99:
Added line 105:
Added line 111:
Added line 119:
Added line 125:
Added line 127:
Added line 131:
Added line 135:
Changed lines 77-78 from:
(:table border=0 cellpadding=5 cellspacing=0 width=1000 :)
to:
(:table border=0 cellpadding=20 cellspacing=20 width=1000 :)
Added line 81:
Added line 86:
Added line 90:
Added line 95:
Added line 100:
Added line 105:
Added line 110:
Changed lines 78-80 from:
(:cell width = 200 bgcolor = #FFFFCC:)
(:cell width = 500:)
to:
(:cell width = 200:)
(:cell width = 500 bgcolor = #FFFFCC:)
'Place the sensor is on portB.2
sensorPin VAR portB.2 : TrisIO.2=1

'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor
sensorPrev VAR BYTE
sensorPrev = tilt

'a counter- increases when the sensor moves
sensorCount VAR WORD
sensorCount = 0

'a couter - increases on every loop iteration
gapcount VAR WORD
gapcount = 0

'this variable determines how often we check for sensor changes.
gap VAR WORD
gap = 500

'take a breather
PAUSE 1000

'beginning of main loop routine
main:

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -
'- once every {gap} cycles. In this code - once every 500 loops.
IF gapcount > gap THEN

'reset the counter
gapcount = 0

'if the sensor pin has changed since last checked
IF sensorPin <> sensorPrev THEN
'increment by 5 unless the counter is already very high
IF sensorCount < 50 THEN
sensorCount = sensorCount+5
ENDIF
'else if the sensor did not change states
ELSE
'slowly decrease the sensor unless its already at 0
IF sensorCount> 0 THEN
sensorCount = sensorCount-1
ENDIF
ENDIF

'if the sensor moved repeatedly - we have real motion!
IF sensorCount> 25 THEN
testLED = 1
ELSE
testLED = 0
ENDIF

'set the sensor buffer to current sensorPit, toward next check
sensorPrev = sensorPin
ENDIF


'loop again...
GOSUB main
Changed lines 77-80 from:
(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
(:cell width = 200:)
(:cell width
= 800:)
to:
(:table border=0 cellpadding=5 cellspacing=0 width=1000 :)
(:cell width = 200 bgcolor = #FFFFCC:)
(:cell width = 500
:)
Changed lines 76-77 from:
(:tableend:)(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
to:
(:tableend:)
(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
Changed lines 76-78 from:
(:tableend:)

(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
to:
(:tableend:)(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
Changed lines 76-77 from:
(:includeurl http://pitaru.com/itp/sensors-workshop/final_signalquest/code_include.html :)
to:
(:tableend:)

(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
(:cell width = 200:)
(:cell width = 800:)

(:tableend
:)
Changed lines 77-78 from:
>>blue<<
lkj
to:
(:includeurl http://pitaru.com/itp/sensors-workshop/final_signalquest/code_include.html :)
Changed lines 78-161 from:



sensorPin VAR portB.2 : TrisIO.2=1 'Place the sensor is on portB.2



testLED VAR portB.4 : trisio.4 = 0 : testLED = 0 'Place a LED on port B.4



sensorPrev VAR BYTE 'this variable holds (buffers) the previous state of the sensor
sensorPrev = tilt



sensorCount VAR WORD 'a counter- increases when the sensor moves
sensorCount = 0



gapcount VAR WORD 'a couter - increases on every loop iteration
gapcount = 0



gap VAR WORD 'this variable determines how often we check for sensor changes.
gap = 500



PAUSE 1000 'take a breather




main: 'beginning of main loop routine

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -

'- once every {gap} cycles. In this code - once every 500 loops.

IF gapcount > gap THEN

'reset the counter

gapcount = 0

'if the sensor pin has changed since last checked

IF sensorPin <> sensorPrev THEN

'increment by 5 unless the counter is already very high
IF sensorCount < 50 THEN
sensorCount = sensorCount+5
ENDIF

'else if the sensor did not change states
ELSE

'slowly decrease the sensor unless its already at 0
IF sensorCount> 0 THEN
sensorCount = sensorCount-1
ENDIF
ENDIF

'if the sensor moved repeatedly - we have real motion!
IF sensorCount> 25 THEN
testLED = 1
ELSE
testLED = 0
ENDIF

'set the sensor buffer to current sensorPit, toward next check
sensorPrev = sensorPin
ENDIF

'loop again...

GOSUB main

(:tableend:)
to:
lkj
Changed lines 79-86 from:
'Place the sensor is on portB.2
sensorPin VAR portB.2 : TrisIO.2=1

'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor
sensorPrev VAR BYTE
to:

sensorPin VAR
portB.2 : TrisIO.2=1 'Place the sensor is on portB.2



testLED VAR portB.4 : trisio.4 = 0 : testLED = 0 'Place a LED on port B.4



sensorPrev VAR BYTE 'this variable holds (buffers) the previous state of the sensor
Changed lines 92-93 from:
'a counter- increases when the sensor moves
sensorCount VAR WORD
to:

sensorCount VAR WORD 'a counter- increases when the sensor moves
Changed lines 97-98 from:
'a couter - increases on every loop iteration
gapcount VAR WORD
to:

gapcount VAR WORD 'a couter - increases on every loop iteration
Changed lines 102-103 from:
'this variable determines how often we check for sensor changes.
gap VAR WORD
to:

gap VAR WORD 'this variable determines how often we check for sensor changes.
Changed lines 107-112 from:
'take a breather
PAUSE 1000

'beginning of main loop routine

main:
to:

PAUSE 1000 'take a breather




main: 'beginning of main loop routine
Changed lines 77-78 from:
lkjhlkjh
to:
>>blue<<

'Place the sensor is on portB.2
sensorPin VAR portB.2 : TrisIO.2=1

'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor
sensorPrev VAR BYTE
sensorPrev = tilt

'a counter- increases when the sensor moves
sensorCount VAR WORD
sensorCount = 0

'a couter - increases on every loop iteration
gapcount VAR WORD
gapcount = 0

'this variable determines how often we check for sensor changes.
gap VAR WORD
gap = 500

'take a breather
PAUSE 1000

'beginning of main loop routine
main:

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -

'- once every {gap} cycles. In this code - once every 500 loops.

IF gapcount > gap THEN

'reset the counter

gapcount = 0

'if the sensor pin has changed since last checked

IF sensorPin <> sensorPrev THEN

'increment by 5 unless the counter is already very high
IF sensorCount < 50 THEN
sensorCount = sensorCount+5
ENDIF

'else if the sensor did not change states
ELSE

'slowly decrease the sensor unless its already at 0
IF sensorCount> 0 THEN
sensorCount = sensorCount-1
ENDIF
ENDIF

'if the sensor moved repeatedly - we have real motion!
IF sensorCount> 25 THEN
testLED = 1
ELSE
testLED = 0
ENDIF

'set the sensor buffer to current sensorPit, toward next check
sensorPrev = sensorPin
ENDIF

'loop again...

GOSUB main
Changed lines 77-78 from:
to:
lkjhlkjh
Changed lines 77-151 from:
>>blue<<
->
'Place the sensor is on portB.2
sensorPin VAR portB.2 : TrisIO.2=1

'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor
sensorPrev VAR BYTE
sensorPrev = tilt

'a counter- increases when the sensor moves
sensorCount VAR WORD
sensorCount = 0

'a couter - increases on every loop iteration
gapcount VAR WORD
gapcount = 0

'this variable determines how often we check for sensor changes.
gap VAR WORD
gap = 500

'take a breather
PAUSE 1000

'beginning of main loop routine
main:

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -

'- once every {gap} cycles. In this code - once every 500 loops.

IF gapcount > gap THEN

'reset the counter

gapcount = 0

'if the sensor pin has changed since last checked

IF sensorPin <> sensorPrev THEN

'increment by 5 unless the counter is already very high
IF sensorCount < 50 THEN
sensorCount = sensorCount+5
ENDIF

'else if the sensor did not change states
ELSE

'slowly decrease the sensor unless its already at 0
IF sensorCount> 0 THEN
sensorCount = sensorCount-1
ENDIF
ENDIF

'if the sensor moved repeatedly - we have real motion!
IF sensorCount> 25 THEN
testLED = 1
ELSE
testLED = 0
ENDIF

'set the sensor buffer to current sensorPit, toward next check
sensorPrev = sensorPin
ENDIF

'loop again...

GOSUB main
to:
Changed line 78 from:
to:
->
Deleted line 146:
Added line 2:
(:cell width = 200:)
Added line 4:
Deleted lines 152-153:
(:cell width = 200:)
Changed lines 2-3 from:
(:cell width = 200:)
(:cell width = 800
)
to:
(:cell width = 800:)
Deleted lines 5-6:
%audience% authors (intermediate)
Changed lines 75-76 from:
(:cell border=1 cellpadding=5 cellspacing=0 width=500 align=left bgcolor=#FFFFCC:)
to:
>>blue<<
Changed lines 151-152 from:
to:
(:cell width = 200:)
Changed line 3 from:
(:cell width = 800 colspan = 2:)
to:
(:cell width = 800)
Added lines 7-8:
%audience% authors (intermediate)
Changed line 3 from:
(:cell width = 800 corspan = 2:)
to:
(:cell width = 800 colspan = 2:)
Changed line 3 from:
(:cell width = 800:)
to:
(:cell width = 800 corspan = 2:)
Changed lines 76-78 from:
|| border=1
||
to:
(:cell border=1 cellpadding=5 cellspacing=0 width=500 align=left bgcolor=#FFFFCC:)
Changed lines 152-153 from:
||
to:
Changed line 76 from:
|| border=1 cellpadding=5 cellspacing=0 width=500 align=left bgcolor=#FFFFCC
to:
|| border=1
Changed lines 153-154 from:
to:
||
Changed lines 76-77 from:
(:table border=1 cellpadding=5 cellspacing=0 width=500 bgcolor=#FFFFCC :)
(:cell:)
'Place the sensor is on portB.2
to:
|| border=1 cellpadding=5 cellspacing=0 width=500 align=left bgcolor=#FFFFCC
||

'Place the sensor is on portB.2
Changed lines 152-154 from:
(:tableend:)
to:
Added line 2:
(:cell width = 200:)
Changed line 152 from:
(:cell width = 200:)
to:
Added lines 1-2:
(:table border=1 cellpadding=5 cellspacing=0 width=1000 :)
(:cell width = 800:)
Changed lines 10-11 from:
!!!!See original report page on [[http://pitaru.com/itp/sensors-workshop/final_signalquest/ || pitaru.com]], containing a java applet which is not included here (at the end of the page).
to:
!!!!See original report page on [[http://pitaru.com/itp/sensors-workshop/final_signalquest/ | pitaru.com]], containing a java applet which is not included here (at the end of the page).
Added lines 149-151:
(:tableend:)

(:cell width = 200:)
Changed lines 8-9 from:
* See original report page on [[http://pitaru.com/itp/sensors-workshop/final_signalquest/ || pitaru.com]], containing a java applet which is not included here (at the end of the page).
to:
!!!!See original report page on [[http://pitaru.com/itp/sensors-workshop/final_signalquest/ || pitaru.com]], containing a java applet which is not included here (at the end of the page).
Changed lines 65-70 from:
* Interrupts: Connect the sensor to an interrupt line on the microcontroller or CPU.
* One-shot: While remaining in
a low power mode i.e. running on a 32 KHz watch crystal, look for an interrupt. After the first interrupt pulse, disable further interrupts for 0.5 seconds, thereby only allowing one pulse per Ĺ second time-lice to be recognized. Do not wake up the processor at this time.
* Leaky integrator: Every Ĺ second time-slice, if the one-shot is
tripped, increment a pulse counter variable by 5. If it isnít tripped, decrement the pulse counter variable by 1. Do not switch to a high power mode yet.
* Threshold: If the pulse counter value exceeds
a threshold of 25 (5 seconds of motion) then the device is moving. Now, switch to a high power state.
* Notes: Be sure to stop incrementing at some maximum pulse counter value (try 50), so it doesnít continue to grow with continuous motion. Be sure to stop decrementing the pulse counter at zero so a numerical underflow doesn'tít occur.
to:
* Interrupts: Connect the sensor to an interrupt line on the microcontroller or CPU.
* One-shot: While remaining in a low power mode i.e. running on
a 32 KHz watch crystal, look for an interrupt. After the first interrupt pulse, disable further interrupts for 0.5 seconds, thereby only allowing one pulse per Ĺ second time-lice to be recognized. Do not wake up the processor at this time.
* Leaky integrator: Every Ĺ second
time-slice, if the one-shot is tripped, increment a pulse counter variable by 5. If it isnít tripped, decrement the pulse counter variable by 1. Do not switch to a high power mode yet.
* Threshold: If the pulse counter value exceeds
a threshold of 25 (5 seconds of motion) then the device is moving. Now, switch to a high power state.
*
Notes: Be sure to stop incrementing at some maximum pulse counter value (try 50), so it doesnít continue to grow with continuous motion. Be sure to stop decrementing the pulse counter at zero so a numerical underflow doesn'tít occur.
Added lines 8-9:
* See original report page on [[http://pitaru.com/itp/sensors-workshop/final_signalquest/ || pitaru.com]], containing a java applet which is not included here (at the end of the page).
Deleted lines 0-3:
(:table border=1 cellpadding=5 cellspacing=0 width=1000 bgcolor=#FFFFCC :)
(:cell width=600:)
'Place the sensor is on portB.2
Deleted lines 144-146:
(:tableend:)

(:cell: width=200)
Changed line 2 from:
(:cell: width=600:)
to:
(:cell width=600:)
Changed lines 1-3 from:
(:table border=1 cellpadding=5 cellspacing=0 width=500 bgcolor=#FFFFCC :)
(:cell: width=600) 'Place the sensor is on portB.2
to:
(:table border=1 cellpadding=5 cellspacing=0 width=1000 bgcolor=#FFFFCC :)
(:cell: width=600:)
'Place the sensor is on portB.2
Added lines 1-3:
(:table border=1 cellpadding=5 cellspacing=0 width=500 bgcolor=#FFFFCC :)
(:cell: width=600) 'Place the sensor is on portB.2
Added lines 148-150:
(:tableend:)

(:cell: width=200)
Deleted line 116:
Deleted line 121:
Deleted line 124:
Added line 109:
Added line 113:
Added line 115:
Added line 117:
Added line 121:
Added line 123:
Added line 125:
Added line 127:
Added line 146:
Added line 103:
Added line 105:
Changed lines 72-136 from:
(:cell:) a1
to:
(:cell:) 'Place the sensor is on portB.2
sensorPin VAR portB.2 : TrisIO.2=1

'Place a LED on port B.4
testLED VAR portB.4 : trisio.4 = 0 : testLED = 0

'this variable holds (buffers) the previous state of the sensor
sensorPrev VAR BYTE
sensorPrev = tilt

'a counter- increases when the sensor moves
sensorCount VAR WORD
sensorCount = 0

'a couter - increases on every loop iteration
gapcount VAR WORD
gapcount = 0

'this variable determines how often we check for sensor changes.
gap VAR WORD
gap = 500

'take a breather
PAUSE 1000

'beginning of main loop routine
main:

gapcount = gapcount + 1

'we use this if statement to activate the sensor routine -
'- once every {gap} cycles. In this code - once every 500 loops.
IF gapcount > gap THEN

'reset the counter
gapcount = 0

'if the sensor pin has changed since last checked
IF sensorPin <> sensorPrev THEN
'increment by 5 unless the counter is already very high
IF sensorCount < 50 THEN
sensorCount = sensorCount+5
ENDIF
'else if the sensor did not change states
ELSE
'slowly decrease the sensor unless its already at 0
IF sensorCount> 0 THEN
sensorCount = sensorCount-1
ENDIF
ENDIF

'if the sensor moved repeatedly - we have real motion!
IF sensorCount> 25 THEN
testLED = 1
ELSE
testLED = 0
ENDIF

'set the sensor buffer to current sensorPit, toward next check
sensorPrev = sensorPin
ENDIF


'loop again...
GOSUB main
Changed line 71 from:
(:table border=1 cellpadding=5 cellspacing=0:)
to:
(:table border=1 cellpadding=5 cellspacing=0 width=500 bgcolor=#FFFFCC :)
Changed lines 69-73 from:
The following PicBasicPro code demonstrates the simplest implementation of motion detection, using the sensor. This code will disregard the interrupt routines mentioned above . The program will light up an LED when motion is detected. Every 50ms, the input-pin will be checked. If its state has changed since the last check, a counter will increase by 5, otherwise it will decrease by 1. If the counter rises above 25, we will light up the LED. When it drops below 25, the led will be turned off:
to:
The following PicBasicPro code demonstrates the simplest implementation of motion detection, using the sensor. This code will disregard the interrupt routines mentioned above . The program will light up an LED when motion is detected. Every 50ms, the input-pin will be checked. If its state has changed since the last check, a counter will increase by 5, otherwise it will decrease by 1. If the counter rises above 25, we will light up the LED. When it drops below 25, the led will be turned off:

(:table border=1 cellpadding=5 cellspacing=0:)
(:cell:) a1
(:tableend:)
Added lines 57-69:


!!!IMPLEMENTATION OF MOTION DETECTION:

The following instructions were given by the manufacturer, towards a motion-detection application that wakes up a MCU from Sleep mode (low-power consumption mode):

* Interrupts: Connect the sensor to an interrupt line on the microcontroller or CPU.
* One-shot: While remaining in a low power mode i.e. running on a 32 KHz watch crystal, look for an interrupt. After the first interrupt pulse, disable further interrupts for 0.5 seconds, thereby only allowing one pulse per Ĺ second time-lice to be recognized. Do not wake up the processor at this time.
* Leaky integrator: Every Ĺ second time-slice, if the one-shot is tripped, increment a pulse counter variable by 5. If it isnít tripped, decrement the pulse counter variable by 1. Do not switch to a high power mode yet.
* Threshold: If the pulse counter value exceeds a threshold of 25 (5 seconds of motion) then the device is moving. Now, switch to a high power state.
* Notes: Be sure to stop incrementing at some maximum pulse counter value (try 50), so it doesnít continue to grow with continuous motion. Be sure to stop decrementing the pulse counter at zero so a numerical underflow doesn'tít occur.

The following PicBasicPro code demonstrates the simplest implementation of motion detection, using the sensor. This code will disregard the interrupt routines mentioned above . The program will light up an LED when motion is detected. Every 50ms, the input-pin will be checked. If its state has changed since the last check, a counter will increase by 5, otherwise it will decrease by 1. If the counter rises above 25, we will light up the LED. When it drops below 25, the led will be turned off:
Changed lines 54-55 from:
ThisWiki:/uploads/Reports/Attach: pull-up_circuit.gif
to:
ThisWiki:/uploads/Reports/pull-up_circuit.gif
Changed lines 56-62 from:
ThisWiki:/uploads/Reports/bread_1.JPG ThisWiki:/uploads/Reports/Attach: bread_2.JPG


[[Attach: bread_1_thumb.jpg]]
[[Attach: bread_2_thumb.jpg]]
to:
ThisWiki:/uploads/Reports/bread_1_thumb.jpg ThisWiki:/uploads/Reports/bread_2_thumb.jpg
Changed lines 40-41 from:
[[ ThisWiki:/uploads/Reports/electrical_chars.gif]]
to:
ThisWiki:/uploads/Reports/electrical_chars.gif
Added line 51:
Changed lines 54-56 from:
[[Attach: pull-up_circuit.gif]]
[[Attach
: bread_1.JPG]]
[[Attach:
bread_2.JPG]]
to:
ThisWiki:/uploads/Reports/Attach: pull-up_circuit.gif

ThisWiki
:/uploads/Reports/bread_1.JPG ThisWiki:/uploads/Reports/Attach: bread_2.JPG
Changed line 34 from:
Attach: ThisWiki:/uploads/Reports/table1_sq_sen_200.gif
to:
ThisWiki:/uploads/Reports/table1_sq_sen_200.gif
Changed lines 36-37 from:
Attach: ThisWiki:/uploads/Reports/table1_sq_sen_390.gif
to:
ThisWiki:/uploads/Reports/table1_sq_sen_390.gif
Changed line 34 from:
Attach:table1_sq_sen_200.gif
to:
Attach: ThisWiki:/uploads/Reports/table1_sq_sen_200.gif
Changed lines 36-37 from:
Attach:table1_sq_sen_390.gif]]
to:
Attach: ThisWiki:/uploads/Reports/table1_sq_sen_390.gif
Changed line 34 from:
[[ ThisWiki:/uploads/Reports/table1_sq_sen_200.gif]]
to:
Attach:table1_sq_sen_200.gif
Changed lines 36-37 from:
[[ ThisWiki:/uploads/Reports/table1_sq_sen_390.gif]]
to:
Attach:table1_sq_sen_390.gif]]
Changed lines 42-43 from:
[--* Current consumption is determined by the resistance of the application circuit and the supply voltage.-]]
to:
[--* Current consumption is determined by the resistance of the application circuit and the supply voltage.-]
Changed lines 34-36 from:
[[Attach: table1_sq_sen_200.gif]]
[[Attach: table1_sq_sen_390.gif]]
[[Attach: electrical_chars.gif]]
to:
[[ ThisWiki:/uploads/Reports/table1_sq_sen_200.gif]]

[[ ThisWiki:/uploads/Reports/table1_sq_sen_390.gif]]

!!!ELECTRICAL CHARACARISTICS :

[[ ThisWiki:/uploads/Reports/
electrical_chars.gif]]

[--* Current consumption is determined by the resistance of the application circuit and the supply voltage.-]]

The table above shows that this sensor can take between 2.7V and 12V, without affecting its sesing operation. When supplied higher voltages, it will consume more current when the circuit is closed (as it usually is withthe sen-200). This will affect power conservation when using a battery. For this reason it is recomended to use a resistor and limit supplied voltage to the minimum 2.7V. I found that the usual 10K does the trick when working with a 3V coin-cell battery as power source.

!!!GENERAL APPLICATION CIRCUIT:

The sensor can be integrated into a circuit similarly to a an on/off switch. The circuit below uses the pic's internal ('weak') pull-up resistor on Pin-5. This means that the pic is providing 3V to Pin-5, keaping it normaly high. But when the sensor closes the circuit, Pin-5 will be pulled to ground and therefor go low. There are two main benefits to using an internal pullup as opposed to the usual swithc circuit:

1. We usually add a pulldown resistor to ground on input pins, to prevent the pin from 'floating' between hi/low. In this case, the internal resistor pulls the pin up permamently so we save one resistor.
2. The pic itself provides the voltage for the sensor. In return, we can conserve energy by putting the pic to sleep, and only checking for movements every .5 seconds by momentarily supplying voltage to the sensor. This is called an interrupt wake-up routine. It is explained in further detail below.
Changed lines 32-43 from:
Signalquest has a twin model - the SQ-SEN-390. The two models are almost identical, except tht the 390 will sometimes remain open and sometimes closed when rested - depending on its orientation. This could be helpful if you wish to detect vibration and overal oreintation (think digital-cameras and how their LCD flips direction when the camera is tilted). Following are two schematics that show the difecence between the two sensors when at rest:
to:
Signalquest has a twin model - the SQ-SEN-390. The two models are almost identical, except tht the 390 will sometimes remain open and sometimes closed when rested - depending on its orientation. This could be helpful if you wish to detect vibration and overal oreintation (think digital-cameras and how their LCD flips direction when the camera is tilted). Following are two schematics that show the difecence between the two sensors when at rest:

[[Attach: table1_sq_sen_200.gif]]
[[Attach: table1_sq_sen_390.gif]]
[[Attach: electrical_chars.gif]]
[[Attach: pull-up_circuit.gif]]
[[Attach: bread_1.JPG]]
[[Attach: bread_2.JPG]]
[[Attach: bread_1_thumb.jpg]]
[[Attach: bread_2_thumb.jpg]]
Changed lines 9-11 from:
PDF format, right click to download.
[[Attach
:SQ-SEN-200_Datasheet.pdf]]
to:

[[ ThisWiki
:/uploads/Reports/SQ-SEN-200_Datasheet.pdf | PDF format, right click to download.]]
Changed lines 10-11 from:
to:
[[Attach:SQ-SEN-200_Datasheet.pdf]]
Changed lines 8-10 from:
!!!DATASHEET - PDF format, right click to download.
to:
!!!DATASHEET
PDF format, right click to download.
Added line 3:
Added line 5:
Changed lines 2-8 from:
!!!!Model: SQ-SEN-200
!!!!Manufacturer: [[http://signalquest.com | SignalQuest]]
!!!!Report by Amit Pitaru

!!!!DATASHEET - PDF format, right click to download.
to:
Model: SQ-SEN-200
Manufacturer: [[http://signalquest.com | SignalQuest]]
Report by Amit Pitaru

!!!DATASHEET - PDF format, right click to download.
Changed lines 2-8 from:
!!!Model: SQ-SEN-200
!!!Manufacturer: [[http://signalquest.com | SignalQuest]]
Report by Amit Pitaru

!!!DATASHEET - PDF format, right click to download.
to:
!!!!Model: SQ-SEN-200
!!!!Manufacturer: [[http://signalquest.com | SignalQuest]]
!!!!Report by Amit Pitaru

!!!!DATASHEET - PDF format, right click to download.
Changed lines 1-3 from:
!Omnidirectional Tilt and Vibration Sensor
!Model: SQ-SEN-200
!Manufacturer: [[http://signalquest.com | SignalQuest]]
to:
!!!Omnidirectional Tilt and Vibration Sensor
!!!Model: SQ-SEN-200
!!!Manufacturer: [[http://signalquest.com | SignalQuest]]
Changed lines 6-9 from:
!DATASHEET - PDF format, right click to download.


!!DESCRIPTION
to:
!!!DATASHEET - PDF format, right click to download.


!!!DESCRIPTION
Changed line 13 from:
!!AVAILABILITY AND PRICINGS:
to:
!!!AVAILABILITY AND PRICINGS:
Changed line 24 from:
!!THEORY OF OPERATION
to:
!!!THEORY OF OPERATION
Changed lines 2-3 from:
!!Model: SQ-SEN-200
!!Manufacturer: [[http://signalquest.com | SignalQuest]]
to:
!Model: SQ-SEN-200
!Manufacturer: [[http://signalquest.com | SignalQuest]]
Changed lines 6-8 from:
!!DATASHEET - PDF format, right click to download.
to:
!DATASHEET - PDF format, right click to download.
Changed line 1 from:
!!Omnidirectional Tilt and Vibration Sensor
to:
!Omnidirectional Tilt and Vibration Sensor
Added lines 1-29:
!!Omnidirectional Tilt and Vibration Sensor
!!Model: SQ-SEN-200
!!Manufacturer: [[http://signalquest.com | SignalQuest]]
Report by Amit Pitaru

!!DATASHEET - PDF format, right click to download.


!!DESCRIPTION
The SQ-SEN-200 series sensor acts like a normally closed switch which chatters open and closed as it is tilted or vibrated. Unlike other ball-tube devices, the 200 is truly an omnidirectional motion sensor. The sensor will produce continuous on-off contact closures when in motion. When at rest, it normally settles in a closed state. It is sensitive to both tilt (static acceleration) and vibration (dynamic acceleration). This signal can be used to interrupt (wake up) a microcontroller or can be counted to estimate the amount and duration of activity. The sensor is fully passive, requires no signal conditioning, and can be used in a microcontroller interrupt circuit that draws as little as 0.25uA of continuous current. {From datasheet}


!!AVAILABILITY AND PRICINGS:
You may request samples by email, altough at the time of publication this model is not listed on the manufacturer's site. This surfance-mount sensor will soon replace thier current products: SQ-SEN-003 / 001.

Predicted pricings by manufacturer:
1 Ė 249: $4.53
1K: $1.76
10K: $0.86
50K: $0.72
100K: $0.65


!!THEORY OF OPERATION
The SQ-SEN-200 series sensor acts like a normally closed switch which chatters open and closed as it is tilted or vibrated. The SQ-SEN-200 is not guaranteed to be closedóeven when the sensing mechanism is at rest. However, a good rule of thumb is that 75% - 95% of the time (depending on orientation) when the sensor is at rest it will be closed. The engineer should design his or her software to look for high-to-low and low-to-high edge transitions rather than an open of closed state of the switch. {From datasheet}

In other words: when working with this sensor, you can expect it to be closed unless its moving. But in reality it will sometimes remains open even when rested. Because of this, the fail-safe way to detect motion is to look for changes on the input-pin rather than a distinct state.

Signalquest has a twin model - the SQ-SEN-390. The two models are almost identical, except tht the 390 will sometimes remain open and sometimes closed when rested - depending on its orientation. This could be helpful if you wish to detect vibration and overal oreintation (think digital-cameras and how their LCD flips direction when the camera is tilted). Following are two schematics that show the difecence between the two sensors when at rest: