Reports.Break-beamSensor History

Hide minor edits - Show changes to output

Changed lines 57-62 from:
'code written for twin beam lasers to detect directionality.
'timing needs tweaking. debugging.
'not "for security purposes"
'next user test specific doorways for timing.
'for two sets of tandem breakbeams
'add
totalpopcounter events:
to:

'totalpopcounter
events:
Changed lines 60-69 from:
to:
'all sounds ramped for volume (cross fade)
''midi to MaxMSP? buffer size as lone as track for1,2,3; fades to end
'if popsize constistant to end to track
'if totalpopcounter = 0 do nothing
'if totalpopcounter = 1 or totalpopcounter < 4 do (1)whisper prayer
'is 1 but less then 4
'if totalpopcounter =4 or totalpopcounter < 8 do(2) tibetian horn '
'is 4 but less then 7
'if totalpopcounter= 8 or totalpopcounter < 15 do (3)byzantine chant
'if totalpopcounter > 15 do nothing
Changed lines 80-81 from:
' ABPopCounter var byte
' CDPopCounter var byte
to:
Changed lines 82-85 from:
'PopCountVar VAR byte '=0, =3 or <4, =4 or < 8, =8 or > 15, >15
'LostPopCounts var byte 'log these events

TRISC = %00000000
'for visual aid
to:
PreviousPopCounter var byte
TRISC
= %00000000 'for visual aid check to pair correctly
Changed lines 88-93 from:
'portb.7 VAR A
'portb.6 var B
'portb.4 var C
'portb.5 var D
to:
Deleted lines 104-106:

Deleted line 107:
LostTotalPopCounter = 0
Changed line 109 from:
totalpopcounter = 0
to:
PreviousPopCounter = 0
Changed line 111 from:
portb = portb
to:
Changed lines 114-115 from:
to:
Changed line 151 from:
to:
Changed line 155 from:
to:
Changed lines 158-159 from:
to:
Changed line 162 from:
to:
Changed line 165 from:
to:
Changed lines 168-169 from:
to:
Changed lines 172-174 from:
to:
Changed lines 177-178 from:
to:
Changed lines 181-182 from:
serout2 tx,inv9600,[dec totalpopCounter]
to:
serout2 tx,inv9600,[dec totalpopCounter,13,10]
Changed lines 184-188 from:
'all are high or all are low

if state = 2 then GOTO ABEnterSet
'A went low before B
to:
if state = 2 then GOTO ABEnterSet
Deleted lines 185-186:
'B went low before A
Deleted lines 186-187:
'C went low before D
Changed lines 188-190 from:
'D went low before C
to:
Changed lines 193-195 from:
while portb.6 = 1 'while B not triggered
state = state
if portb.6 = 0 then goto MyOneEnter
to:
WHILE state = 2
if portb.6 =0 then goto MyOneEnter
wend
state = state
goto main

BAExitSet:
while state = 3
if portb.7 = 0 then goto MyOneExit
Changed lines 204-228 from:

'this bit is in attempt allowance for alt timing and record errors
PAUSE 500
portb = portb
if state <> 111 or state <> 10 then goto MyWait
'give more time
if portb.6 = 1 and portb.7 =1 then goto main
'if all or AB resets to high



BAExitSet:
while portb.7 = 1 'while A not triggered
state = state
if portb.7 = 0 then goto MYOneExit
wend

PAUSE 500
portb = portb
if state <> 111 or state <> 10 then goto MyWait
'give more time
if portb.6 = 1 and portb.7 =1 then goto main
'if all or AB resets to high
to:
state = state
goto main
Changed lines 209-222 from:
portb = portb
while portb.5 = 1 'while D not triggered
if portb.5 = 0 then goto MyOneEnter
state = state
wend

PAUSE 500
if state <> 111 or state <> 1 then goto MyWait
'give more time

if portb.5 = 1 and portb.4 =1 then goto
main
'if all or AB resets to high
to:
while state = 12
if portb.5 = 0 then goto MyOneEnter
wend
state = state
goto main
Changed lines 217-236 from:
portb = portb
while portb.4 = 1 'while C not triggered
if portb.4 = 0 then goto MyOneExit
wend

PAUSE 500
portb = portb


if state <> 111 or state <>
1 then goto MyWait
'give more time


if portb.5 = 1 and portb.4 =1 then goto main
'if all or AB resets to high


MyWait:
'reset all and give more time
pause 500
to:
while state = 13
if portb.4 = 0 then goto MyOneExit
wend
state = state
goto main


MyOneEnter:

totalpopcounter = totalpopcounter + 1
Changed lines 228-229 from:
portb = portb
'check states again
to:
goto main


MyOneExit:
Changed lines 233-273 from:
if state = 111 or state = 0 or state = 1 or state = 10 then goto main
if state = 2 then goto CancelOneEnter
if state = 3 then GOTO CancelOneExit
if state = 12 then GOTO CancelOneEnter
if state = 13 then GOTO CancelOneExit



''print debug messages:time,event


MyOneEnter:
TotalPopCounter = TotalPopCounter + 1

'if state = 111 or state = 10 or state = 1 then goto main
' if state = 0 then
' pause 200
' endif

' if state <> 111 or state <> 10 or state <> 1 THEN
'print error message: LostTotalPopCounter = LostTotalPopCounter + 1
' portb = portb
' ENDIF

goto main


MyOneExit:
TotalPopCounter = TotalPopCounter - 1


' if state = 111 or state = 10 or state = 1 then goto main
' if state = 0 then
pause 200
'endif

if state <> 111 or state <> 10 or state <> 1 THEN
'print error message: LostTotalPopCounter = LostTotalPopCounter - 1

' portb = portb
'ENDIF
to:
totalpopcounter = totalpopcounter - 1
state = state
Changed lines 236-238 from:
to:

Changed line 54 from:
[[#Psuedo-code]]'''Psuedo-code'''
to:
[[code for AB and CD sets]]'''code for AB and CD sets'''
Changed lines 56-71 from:
'use edge detection to compare laststate/ current state
'count must define the order that the lasers have been tripped
'count must add and subtract

'set defines
ALaserStateVar var byte 'variables for edge detection--laserA
AlastLaserStateVar var byte
BLaserStateVar var byte ' 'variables for edge detection--laserB
BlaserLaserStateVar var byte
InByte var byte(3) 'set a flag 'store 0 or 1 to test which beam has tripped 1st
LaserCountVar var byte 'store the running total
input portb.7 'diode on digital input
input portb.6 'diode on digital input
TRISC = %00000000
LaserA var portc.3 '"A"redLED 'visual aid
LaserB var portc.4 '"B"redLED
to:
'code written for twin beam lasers to detect directionality.
'timing needs tweaking. debugging.
'not "for security purposes"
'next user test specific doorways for timing.
'for two sets of tandem breakbeams
'add totalpopcounter events:
'evaluate popcountvar

define clock 3
define bits 10
define sampleus 20
define osc 4
inv9600 con 16468
Changed lines 72-125 from:
Rx var portc.7
high lasera 'testblink
pause 500
low lasera
pause 400
high laserb
pause 500
low laserb
pause 400

LaserCountVar =0

main:
inbyte = 0

ALaserStateVar = portb.7 'A laser
bLaserStateVar = portb.6 'B laser

' if the beam is connected, ...the same as it was last time through keep reading
' if not, then you want to do something:

if portb.7=1 then 'visual evidence that beam is hitting diode
high LaserA
else
low LaserA
endif

if portb.6=1 then 'visual evidence that beam is hitting diode
high LaserB
else
low LaserB
endif


if ALaserStateVar <> AlastLaserStateVar then 'there is a change of state
if ALaserStateVar = 0 then
inbyte = inbyte +1 'set flag
endif

'while portb.6 != 0 'wait until Bdiode has been broken then continue
wend 'can a while statement work here?

if BLaserStateVar <> BlastLaserStateVar AND inbtye = 1 then [[<<]]
'A has triggered 1st
LaserCountVar = LaserCountVar + 1 'someone has entered[[<<]] endif
endif




AlastLaserStateVar = ALaserStateVar ' store state of the laser for next check:
'BlastLaserStateVar = BLaserStateVar
to:
TRISB = %11111111
AllSwitches var byte
State var byte
'
ABPopCounter var byte
'
CDPopCounter var byte
TotalPopCounter var byte
'PopCountVar VAR byte '=0, =3 or <4, =4 or < 8, =8 or > 15, >15
'LostPopCounts var byte 'log these events

TRISC = %00000000
'for visual aid
ALaserShow var portc.3 '"A"redLED
BLaserShow var portc.4 '"B"redLED
CLaserShow var portc.2 '"C"YellLED
DLaserShow var portc.5 '"D"YellLED
'portb.7 VAR A
'portb.6 var B
'portb.4 var C
'portb.5 var D


'test chip
high alasershow
pause 200
high blasershow
pause 200
high clasershow
pause 200
high dlasershow
pause 200

low alasershow
low blasershow
low clasershow
low dlasershow
pause 1000



i var byte
for i = 0 to 1
totalpopcounter = 0
LostTotalPopCounter = 0
next i
totalpopcounter = 0
main:
portb = portb
state = state
totalpopcounter = totalpopcounter


'check laser targets
if portb.7=1 then 'visual evidence that beam is hitting diode
high aLasershow
else
low aLasershow
endif

if portb.6=1
then 'visual evidence that beam is hitting diode
high bLasershow
else
low bLasershow
Changed lines 135-148 from:

if BLaserStateVar <> BlastLaserStateVar then 'there is a change of state for B
if Blaserstatevar = 0 then
inbyte = inbyte + 1
endif

if inbyte = 1 then
' ALaser hasn't tripped (making inbyte "2" ) 'B must have broken before A
LaserCountVar = LaserCountVar - 1 'someone has left
endif


BlastLaserStateVar = BLaserStateVar
AlastLaserStateVar = ALaserStateVar
to:
'check laser targets
if portb.4=1 then 'visual evidence that beam is hitting diode
high cLasershow
else
low cLasershow
endif

if portb.5=1 then 'visual evidence that beam is hitting diode
high dLasershow
else
low dLasershow
endif


'now readout and evalute the switch states
pause 500

AllSwitches = PORTB & %11110000 'pins b.6, b.7
select case AllSwitches

case %11110000 ' (all are high)
state = 111

case %00000000 ' (all are low)
'both triggered
state = 0

case %01110000 '(if b.7 is low = Atriggered)
state = 2


case %10110000 '(if b.6 is low= Btriggered)
state = 3

case %00110000 'b.6, b.7 (AB low, CD high)
state = 1

case %11000000 ' (AB are high, CD low)
state = 10


case %11100000 '(only C is low)
state = 12



case %11010000 ' (only D is low)
state = 13

end select

serout2 tx,inv9600,[dec totalpopCounter]

if state = 111 or state = 0 then goto main
'all are high or all are low

if state = 2 then GOTO ABEnterSet
'A went low before B

if state = 3 then GOTO BAExitSet
'B went low before A

if state = 12 then GOTO CDEnterSet
'C went low before D

if state = 13 then GOTO DCExitSet
'D went low before C


goto main


ABEnterSet:
while portb.6 = 1 'while B not triggered
state = state
if portb.6 = 0 then goto MyOneEnter
wend

'this bit is in attempt allowance for alt timing and record errors
PAUSE 500
portb = portb
if state <> 111 or state <> 10 then goto MyWait
'give more time
if portb.6 = 1 and portb.7 =1 then goto main
'if all or AB resets to high



BAExitSet:
while portb.7 = 1 'while A not triggered
state = state
if portb.7 = 0 then goto MYOneExit
wend

PAUSE 500
portb = portb
if state <> 111 or state <> 10 then goto MyWait
'give more time
if portb.6 = 1 and portb.7 =1 then goto main
'if all or AB resets to high


CDEnterSet:
portb = portb
while portb.5 = 1 'while D not triggered
if portb.5 = 0 then goto MyOneEnter
state = state
wend

PAUSE 500
if state <> 111 or state <> 1 then goto MyWait
'give more time

if portb.5 = 1 and portb.4 =1 then goto main
'if all or AB resets to high


DCExitSet:
portb = portb
while portb.4 = 1 'while C not triggered
if portb.4 = 0 then goto MyOneExit
wend

PAUSE 500
portb = portb


if state <> 111 or state <> 1 then goto MyWait
'give more time


if portb.5 = 1 and portb.4 =1 then goto main
'if all or AB resets to high


MyWait:
'reset all and give more time
pause 500
state = state
portb = portb
'check states again
Changed lines 277-288 from:
endif
serout2 tx, 16468, [ "count= ", DEC LaserCountVar, 10, 13, "inbyte= ", DEC inbyte, 10, 13]
goto main


'next block deals with 3 events for 3 population counts:
'if LaserCountVar >0 and < 4 then gosub sub1
'if LaserCountVar =>4 and < 8 then gosub subsub
'if LaserCountVar = 8 < 15 then gosub subthree

to:
if state = 111 or state = 0 or state = 1 or state = 10 then goto main
if state = 2 then goto CancelOneEnter
if state = 3 then GOTO CancelOneExit
if state = 12 then GOTO CancelOneEnter
if state = 13 then GOTO CancelOneExit



''print debug messages:time,event


MyOneEnter:
TotalPopCounter = TotalPopCounter + 1

'if state = 111 or state = 10 or state = 1 then goto main
' if state = 0 then
' pause 200
' endif

' if state <> 111 or state <> 10 or state <> 1 THEN
'print error message: LostTotalPopCounter = LostTotalPopCounter + 1
' portb = portb
' ENDIF

goto main


MyOneExit:
TotalPopCounter = TotalPopCounter - 1


' if state = 111 or state = 10 or state = 1 then goto main
' if state = 0 then
pause 200
'endif

if state <> 111 or state <> 10 or state <> 1 THEN
'print error message: LostTotalPopCounter = LostTotalPopCounter - 1

' portb = portb
'ENDIF
goto main
Changed lines 1-2 from:
Initial report by [[~dct231]]
to:
Initial report by [[~dct231|Diane Thomas]]
Changed lines 1-2 from:
Initial report by [[]]
to:
Initial report by [[~dct231]]
Changed lines 1-3 from:
!!Break-Beam Sensor
to:
Initial report by [[]]
'''Description:''' a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value [[<<]]of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.
Deleted lines 5-6:
'''Description:''' a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value [[<<]]of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.
Changed lines 28-30 from:
||%width=300px% http://dcthomas.net/Photodiode.jpg||http://dcthomas.net/BJT.jpg||
to:
||%width=300px% http://dcthomas.net/Photodiode.jpg||%width=136% http://dcthomas.net/BJT.jpg||
Changed lines 28-30 from:
||%width=150px%http://dcthomas.net/Photodiode.jpg||http://dcthomas.net/BJT.jpg||
to:
||%width=300px% http://dcthomas.net/Photodiode.jpg||http://dcthomas.net/BJT.jpg||
Changed lines 28-30 from:
||http://dcthomas.net/Photodiode.jpg||http://dcthomas.net/BJT.jpg||
to:
||%width=150px%http://dcthomas.net/Photodiode.jpg||http://dcthomas.net/BJT.jpg||
Changed lines 43-47 from:
Ultimately, the series should describe a 4 enter/ exit space. The tandem lasers are called in sequential alphabet pairs, [[<<]]with the earliest letter letter noting the out-most laser/diode and the inner-most the second in the pair, ie, AB = enter. [[<<]]BA = exit. The outer beam must be tripped first when a body enters the site; a count of 1 is added when the A beam [[<<]]is tripped before B.
A count of -1 is added (1 is subtracted) when B is tripped before A.

http://dcthomas.net/A-H.jpg
to:
||http://dcthomas.net/A-H.jpg||Ultimately, the series should describe a 4 enter/ exit space. The tandem lasers are called in sequential alphabet pairs, [[<<]]with the earliest letter letter noting the out-most laser/diode and the inner-most the second in the pair, ie, AB = enter. [[<<]]BA = exit. The outer beam must be tripped first when a body enters the site; a count of 1 is added when the A beam [[<<]]is tripped before B.
A count of -1 is added (1 is subtracted) when B is tripped before A.||
Changed lines 28-30 from:
|| http://dcthomas.net/Photodiode.jpg || http://dcthomas.net/BJT.jpg ||
to:
||http://dcthomas.net/Photodiode.jpg||http://dcthomas.net/BJT.jpg||
Changed lines 46-47 from:
Image goes here[[<<]]
to:
http://dcthomas.net/A-H.jpg
Changed lines 28-31 from:
(linked image)
to:
|| http://dcthomas.net/Photodiode.jpg || http://dcthomas.net/BJT.jpg ||
Changed lines 116-118 from:
if BLaserStateVar <> BlastLaserStateVar AND inbtye = 1 then 'A has triggered 1st LaserCountVar = LaserCountVar + 1 'someone has entered[[<<]] endif
to:
if BLaserStateVar <> BlastLaserStateVar AND inbtye = 1 then [[<<]]
'A has triggered 1st
LaserCountVar = LaserCountVar + 1 'someone has entered[[<<]] endif
Changed line 116 from:
if BLaserStateVar <> BlastLaserStateVar AND inbye = 1 then 'A has triggered 1st LaserCountVar = LaserCountVar + 1 'someone has entered endif
to:
if BLaserStateVar <> BlastLaserStateVar AND inbtye = 1 then 'A has triggered 1st LaserCountVar = LaserCountVar + 1 'someone has entered[[<<]] endif
Added lines 57-61:
'use edge detection to compare laststate/ current state
'count must define the order that the lasers have been tripped
'count must add and subtract

'set defines
Changed lines 52-54 from:
->The population report is "casual" because there is a fairly wide margin for error. A person may stand blocking [[<<]]->a beam while others pass through returning a false count. Many people may pass through at one time, also returning [[<<]]->a false count. A measure of "single person pass time" might be added to debug[[<<]] ->these 2 possible instances.
to:
->The population report is "casual" because there is a fairly wide margin for error. A person may stand blocking [[<<]]a beam while others pass through returning a false count. Many people may pass through at one time, also returning [[<<]]a false count. A measure of "single person pass time" might be added to debug[[<<]]these 2 possible instances.
Changed lines 4-8 from:
"Description: a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value [[<<]]of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.

"Components:

Laser beam source - pen light, Chinatown ($5)[[<<]]
to:
'''Description:''' a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value [[<<]]of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.

'''Components:'''

'''
Laser beam source''' - pen light, Chinatown ($5)[[<<]]
Changed line 11 from:
Phototransistor
to:
'''Phototransistor'''[[<<]]
Changed lines 19-20 from:
"Notes selected from Wikipedia''[[<<]]
A "photodiode" is an electronic component and a type of photodetector. It is a p-n junction designed[[<<]] to be responsive to optical input. Photodiodes are provided with either a window or optical fibre connection, in order[[<<]] to let in the light to the sensitive part of the device.
to:
'''Notes selected from Wikipedia'''[[<<]]
A '''photodiode''' is an electronic component and a type of photodetector. It is a p-n junction designed[[<<]] to be responsive to optical input. Photodiodes are provided with either a window or optical fibre connection, in order[[<<]] to let in the light to the sensitive part of the device.
Changed lines 24-28 from:
A "phototransistor'' is a bipolar transistor that is encased in a transparent case so that light can reach [[<<]]the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher [[<<]]sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. [[<<]]A phototransistor has a slower response time than a photodiode.
A bipolar junction transistor (BJT) is a type of transistor, [[<<]]an amplifying or switching device constructed of doped semiconductors. Bipolar transistors are so named[[<<]] because the main conduction channel employs both electrons and holes to carry the main electric current.
to:
A '''phototransistor''' is a bipolar transistor that is encased in a transparent case so that light can reach [[<<]]the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher [[<<]]sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. [[<<]]A phototransistor has a slower response time than a photodiode.
A '''bipolar junction transistor''' (BJT) is a type of transistor, [[<<]]an amplifying or switching device constructed of doped semiconductors. Bipolar transistors are so named[[<<]] because the main conduction channel employs both electrons and holes to carry the main electric current.
Changed line 40 from:
Break-beams in tandem to deliver "casual" population count.[[<<]]
to:
Break-beams in tandem to deliver '''casual''' population count.[[<<]]
Changed lines 52-54 from:
to:
->The population report is "casual" because there is a fairly wide margin for error. A person may stand blocking [[<<]]->a beam while others pass through returning a false count. Many people may pass through at one time, also returning [[<<]]->a false count. A measure of "single person pass time" might be added to debug[[<<]] ->these 2 possible instances.
Changed line 53 from:
Psuedo-code
to:
[[#Psuedo-code]]'''Psuedo-code'''
Changed line 12 from:
links:
to:
links:[[<<]]
Changed lines 32-33 from:
[[Semiconductors and N-type/ P-type doping for Semiconductors| http://en.wikipedia.org/wiki/Semiconductor]]
to:
[[http://en.wikipedia.org/wiki/Semiconductor | Semiconductors and N-type/ P-type doping for Semiconductors]]
Changed lines 36-37 from:
Consumer items such as camera light meters, clock radios (the ones that dim the display when it's dark) [[<<]]and street lights usually seem to use photoconductors rather than photodiodes, although in principle either could be used.[[<<]]
Receivers
for remote controls in VCRs and televisions often use photodiodes.[[<<]]
to:
Consumer items such as camera light meters, clock radios (the ones that dim the display when it's dark) [[<<]]and street lights usually seem to use photoconductors rather than photodiodes, although in principle either could be used.http://en.wikipedia.org/wiki/SemiconductorReceivers for remote controls in VCRs and televisions often use photodiodes.[[<<]]
Changed lines 42-43 from:
Beginning with using this as a tool to detect when a person has entered a specific area (installation space). And it would,[[<<]] obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain [[<<]]in the area at any given time.
to:
Beginning with using this as a tool to detect when a person has entered [[<<]]a specific area (installation space). And it would,[[<<]] obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain [[<<]]in the area at any given time.
Changed line 49 from:
To begin, a pair of AB laser/ diodes is prepared. A proto-type that houses 2 laser pen lights aimed at a separate box that [[<<]]house 2 phototransistors. This second box is divided into 2 parts and lined with reflective tape with a hole cut in the center of each half. [[<<]]The phototransistor is mounted across each hole, the reflected light bounces off the back of the box and hits the front of the [[<<]]transistor. When the transistor receives the light source, enough electrons are excited to allow the current to pass; [[<<]]resistance is lowered.
to:
To begin, a pair of AB laser/ diodes is prepared. A proto-type that houses 2 laser pen lights aimed at a separate box that [[<<]]house 2 phototransistors. This second box is divided into 2 parts and lined with reflective tape with a hole cut in the center [[<<]]of each half. [[<<]]The phototransistor is mounted across each hole, the reflected light bounces off the back of the box and hits the front of the [[<<]]transistor. When the transistor receives the light source, enough electrons are excited to allow the current to pass; [[<<]]resistance is lowered.
Changed line 8 from:
Laser beam source - pen light, Chinatown ($5)
to:
Laser beam source - pen light, Chinatown ($5)[[<<]]
Changed line 19 from:
"Notes selected from Wikipedia''
to:
"Notes selected from Wikipedia''[[<<]]
Changed lines 34-35 from:
!!!Applications for Photodiodes / Phototransistors:
P-N photodiodes are used in applications similar to photoconductor family:
to:
!!!Applications for Photodiodes / Phototransistors:[[<<]]
P-N photodiodes are used in applications similar to photoconductor family: [[<<]]
Changed line 41 from:
Break-beams in tandem to deliver "casual" population count.
to:
Break-beams in tandem to deliver "casual" population count.[[<<]]
Changed lines 48-49 from:
Image goes here
to:
Image goes here[[<<]]
Changed lines 2-5 from:
[[http://dcthomas.net/break-beam.html | see stie w/ images]]

"Description: a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.
to:
[[http://dcthomas.net/break-beam.html | see site w/ images]]

"Description: a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value [[<<]]of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.
Changed lines 9-10 from:
Batteries removed and + / - leads soldered for connection to electric power. In this case, the spring is ground and encasing body positive.
to:
Batteries removed and + / - leads soldered for connection to electric power. In this case, the spring is ground and[[<<]] encasing body positive.
Changed lines 42-45 from:
The break-beam sensor can easily be used to trigger an event when a beam is broken; a state change from 1 to 0 (or when an obstacle is removed; a state change to 0 to 1).
Beginning with using this as a tool to detect when a person has entered a specific area (installation space). it would, obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain in the area at any given time.

Ultimately, the series should describe a 4 enter/ exit space. The tandem lasers are called in sequential alphabet pairs, with the earliest letter letter noting the out-most laser/diode and the inner-most the second in the pair, ie, AB = enter. BA = exit. The outer beam must be tripped first when a body enters the site; a count of 1 is added when the A beam is tripped before B.
to:
The break-beam sensor can easily be used to trigger an event when a beam is broken; a state change from 1 to 0[[<<]] (or when an obstacle is removed; a state change to 0 to 1).
Beginning with using this as a tool to detect when a person has entered a specific area (installation space). And it would,[[<<]] obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain [[<<]]in the area at any given time.

Ultimately, the series should describe a 4 enter/ exit space. The tandem lasers are called in sequential alphabet pairs, [[<<]]with the earliest letter letter noting the out-most laser/diode and the inner-most the second in the pair, ie, AB = enter. [[<<]]BA = exit. The outer beam must be tripped first when a body enters the site; a count of 1 is added when the A beam [[<<]]is tripped before B.
Changed line 50 from:
To begin, a pair of AB laser/ diodes is prepared. A proto-type that houses 2 laser pen lights aimed at a separate box that house 2 phototransistors. This second box is divided into 2 parts and lined with reflective tape with a hole cut in the center of each half. The phototransistor is mounted across each hole, the reflected light bounces off the back of the box and hits the front of the transistor. When the transistor receives the light source, enough electrons are excited to allow the current to pass; resistance is lowered.
to:
To begin, a pair of AB laser/ diodes is prepared. A proto-type that houses 2 laser pen lights aimed at a separate box that [[<<]]house 2 phototransistors. This second box is divided into 2 parts and lined with reflective tape with a hole cut in the center of each half. [[<<]]The phototransistor is mounted across each hole, the reflected light bounces off the back of the box and hits the front of the [[<<]]transistor. When the transistor receives the light source, enough electrons are excited to allow the current to pass; [[<<]]resistance is lowered.
Changed lines 14-15 from:
(purchase here, slim on data)
to:
(purchased here, slim on data)
Changed lines 20-28 from:
A "photodiode" is an electronic component and a type of photodetector. It is a p-n junction designed\\ to be responsive to optical input. Photodiodes are provided with either a window or optical fibre connection, in orde\\ to let in the light to the sensitive part of the device.
Photodiodes can be used in either zero bias or reverse bias.\\ In zero bias, light falling on the diode causes a voltage to develop across the device, leading to a current\\ in the forward bias direction. This is called the photovoltaic effect, and is the basis for solar cells - in fact a solar \\cell is just a large number of big, cheap photodiodes.
Diodes usually have extremely high resistance when reverse biased. \\This resistance is reduced when light of an appropriate frequency shines on the junction. Hence, a reverse biased diode can\\ be used as a detector by monitoring the current running through it. Circuits based on this effect are \\more sensitive to light than ones based on the photovoltaic effect.\\\\

A "phototransistor'' is a bipolar transistor that is encased in a transparent case so that light can reach \\the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher \\sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. \\A phototransistor has a slower response time than a photodiode.
A bipolar junction transistor (BJT) is a type of transistor, \\an amplifying or switching device constructed of doped semiconductors. Bipolar transistors are so named\\ because the main conduction channel employs both electrons and holes to carry the main electric current.
to:
A "photodiode" is an electronic component and a type of photodetector. It is a p-n junction designed[[<<]] to be responsive to optical input. Photodiodes are provided with either a window or optical fibre connection, in order[[<<]] to let in the light to the sensitive part of the device.
Photodiodes can be used in either zero bias or reverse bias.[[<<]] In zero bias, light falling on the diode causes a voltage to develop across the device, leading to a current[[<<]] in the forward bias direction. This is called the photovoltaic effect, and is the basis for solar cells - in fact a solar [[<<]]cell is just a large number of big, cheap photodiodes.
Diodes usually have extremely high resistance when reverse biased. [[<<]]This resistance is reduced when light of an appropriate frequency shines on the junction. Hence, a reverse biased diode can[[<<]] be used as a detector by monitoring the current running through it. Circuits based on this effect are [[<<]]more sensitive to light than ones based on the photovoltaic effect.[[<<]]

A "phototransistor'' is a bipolar transistor that is encased in a transparent case so that light can reach [[<<]]the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher [[<<]]sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. [[<<]]A phototransistor has a slower response time than a photodiode.
A bipolar junction transistor (BJT) is a type of transistor, [[<<]]an amplifying or switching device constructed of doped semiconductors. Bipolar transistors are so named[[<<]] because the main conduction channel employs both electrons and holes to carry the main electric current.
Changed lines 31-35 from:
A ''semiconductor'' is a material with an electrical conductivity that is intermediate between that of an insulator and a conductor. A semiconductor behaves as an insulator at very low temperature, and has an appreciable electrical conductivity at room temperature although much lower conductivity than a conductor. Commonly used semiconducting materials are silicon, germanium, and gallium arsenide.
A semiconductor can be distinguished from a conductor by the fact that, at absolute zero, the uppermost filled electron energy band is fully filled in a semiconductor, but only partially filled in a conductor.
The distinction between a semiconductor and an insulator is slightly more arbitrary. A semiconductor has a band gap which is small enough such that its conduction band is appreciably thermally populated with electrons at room temperature, whilst an insulator has a band gap which is too wide for there to be appreciable thermal electrons in its conduction band at room temperature.
N-type P-type doping for Semiconductors http:
//en.wikipedia.org/wiki/Semiconductor
to:

[[Semiconductors and N-type/ P-type doping for Semiconductors| http://en
.wikipedia.org/wiki/Semiconductor]]
Changed lines 36-38 from:
Consumer items such as camera light meters, clock radios (the ones that dim the display when it's dark) and street lights usually seem to use photoconductors rather than photodiodes, although in principle either could be used.
Receivers for remote controls in VCRs and televisions often use photodiodes.
to:
Consumer items such as camera light meters, clock radios (the ones that dim the display when it's dark) [[<<]]and street lights usually seem to use photoconductors rather than photodiodes, although in principle either could be used.[[<<]]
Receivers for remote controls in VCRs and televisions often use photodiodes.[[<<]]
Laser mouse action
.
Changed lines 42-44 from:
The break-beam sensor can easily be used to trigger an event when a beam is broken; a state change to 0 (or when an obstacle is removed; a state change to 1).
Beginning with using this as a tool to detect when a person has entered a specific area (installation space). it would obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain in the area at any given time.
to:
The break-beam sensor can easily be used to trigger an event when a beam is broken; a state change from 1 to 0 (or when an obstacle is removed; a state change to 0 to 1).
Beginning with using this as a tool to detect when a person has entered a specific area (installation space). it would, obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain in the area at any given time.
Changed lines 2-3 from:
[[dcthomas.net/break-beam.html | see stie w/ images]]
to:
[[http://dcthomas.net/break-beam.html | see stie w/ images]]
Changed lines 2-3 from:
to:
[[dcthomas.net/break-beam.html | see stie w/ images]]
Added lines 56-150:
[@
ALaserStateVar var byte 'variables for edge detection--laserA
AlastLaserStateVar var byte
BLaserStateVar var byte ' 'variables for edge detection--laserB
BlaserLaserStateVar var byte
InByte var byte(3) 'set a flag 'store 0 or 1 to test which beam has tripped 1st
LaserCountVar var byte 'store the running total
input portb.7 'diode on digital input
input portb.6 'diode on digital input
TRISC = %00000000
LaserA var portc.3 '"A"redLED 'visual aid
LaserB var portc.4 '"B"redLED
Tx var portc.6
Rx var portc.7
high lasera 'testblink
pause 500
low lasera
pause 400
high laserb
pause 500
low laserb
pause 400

LaserCountVar =0

main:
inbyte = 0

ALaserStateVar = portb.7 'A laser
bLaserStateVar = portb.6 'B laser

' if the beam is connected, ...the same as it was last time through keep reading
' if not, then you want to do something:

if portb.7=1 then 'visual evidence that beam is hitting diode
high LaserA
else
low LaserA
endif

if portb.6=1 then 'visual evidence that beam is hitting diode
high LaserB
else
low LaserB
endif


if ALaserStateVar <> AlastLaserStateVar then 'there is a change of state
if ALaserStateVar = 0 then
inbyte = inbyte +1 'set flag
endif

'while portb.6 != 0 'wait until Bdiode has been broken then continue
wend 'can a while statement work here?

if BLaserStateVar <> BlastLaserStateVar AND inbye = 1 then 'A has triggered 1st LaserCountVar = LaserCountVar + 1 'someone has entered endif
endif




AlastLaserStateVar = ALaserStateVar ' store state of the laser for next check:
'BlastLaserStateVar = BLaserStateVar


endif


if BLaserStateVar <> BlastLaserStateVar then 'there is a change of state for B
if Blaserstatevar = 0 then
inbyte = inbyte + 1
endif

if inbyte = 1 then
' ALaser hasn't tripped (making inbyte "2" ) 'B must have broken before A
LaserCountVar = LaserCountVar - 1 'someone has left
endif


BlastLaserStateVar = BLaserStateVar
AlastLaserStateVar = ALaserStateVar

endif
serout2 tx, 16468, [ "count= ", DEC LaserCountVar, 10, 13, "inbyte= ", DEC inbyte, 10, 13]
goto main


'next block deals with 3 events for 3 population counts:
'if LaserCountVar >0 and < 4 then gosub sub1
'if LaserCountVar =>4 and < 8 then gosub subsub
'if LaserCountVar = 8 < 15 then gosub subthree



@]
Changed line 12 from:
[[http://www.radioshack.com/product/index.jsp?parentPage=search&cp=&productId=2049724&kw=phototransistor&tab=techSpecs Radio Shack]]
to:
[[http://www.radioshack.com/product/index.jsp?parentPage=search&cp=&productId=2049724&kw=phototransistor&tab=techSpecs |Radio Shack]]
Changed lines 15-18 from:
[[http://jameco.com/wcsstore/Jameco/Products/ProdDS/112168.pdf Jameco Data-sheet ]]


"Notes selected from Wikipedia
to:
[[http://jameco.com/wcsstore/Jameco/Products/ProdDS/112168.pdf | Jameco Data-sheet ]]


"Notes selected from Wikipedia''
Changed line 35 from:
!!Applications for Photodiodes / Phototransistors:
to:
!!!Applications for Photodiodes / Phototransistors:
Changed line 40 from:
!!Proposed Application:
to:
!!!Proposed Application:
Changed lines 1-6 from:
!!Break-Beam Sensor!!

"Description:" a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.

"Components:"
to:
!!Break-Beam Sensor

"Description: a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.

"Components:
Changed line 12 from:
[[Radio Shack | http://www.radioshack.com/product/index.jsp?parentPage=search&cp=&productId=2049724&kw=phototransistor&tab=techSpecs]]
to:
[[http://www.radioshack.com/product/index.jsp?parentPage=search&cp=&productId=2049724&kw=phototransistor&tab=techSpecs Radio Shack]]
Changed lines 15-18 from:
[[Jameco Data-sheet | http://jameco.com/wcsstore/Jameco/Products/ProdDS/112168.pdf]]


"Notes selected from Wikipedia
"
to:
[[http://jameco.com/wcsstore/Jameco/Products/ProdDS/112168.pdf Jameco Data-sheet ]]


"Notes selected from Wikipedia
Changed line 23 from:
A "phototransistor" is a bipolar transistor that is encased in a transparent case so that light can reach \\the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher \\sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. \\A phototransistor has a slower response time than a photodiode.
to:
A "phototransistor'' is a bipolar transistor that is encased in a transparent case so that light can reach \\the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher \\sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. \\A phototransistor has a slower response time than a photodiode.
Changed line 35 from:
!!Applications for Photodiodes / Phototransistors:!!
to:
!!Applications for Photodiodes / Phototransistors:
Changed line 40 from:
!!Proposed Application: !!
to:
!!Proposed Application:
Changed line 35 from:
Applications for Photodiodes / Phototransistors:
to:
!!Applications for Photodiodes / Phototransistors:!!
Changed line 40 from:
Proposed Application:
to:
!!Proposed Application: !!
Changed lines 28-35 from:
PNP

NPN
The schematic symbols
for PNP- and NPN-
type BJTs.

A semiconductor
is a material with an electrical conductivity that is intermediate between that of an insulator and a conductor. A semiconductor behaves as an insulator at very low temperature, and has an appreciable electrical conductivity at room temperature although much lower conductivity than a conductor. Commonly used semiconducting materials are silicon, germanium, and gallium arsenide.
to:
(linked image)

A ''semiconductor''
is a material with an electrical conductivity that is intermediate between that of an insulator and a conductor. A semiconductor behaves as an insulator at very low temperature, and has an appreciable electrical conductivity at room temperature although much lower conductivity than a conductor. Commonly used semiconducting materials are silicon, germanium, and gallium arsenide.
Added lines 1-59:
!!Break-Beam Sensor!!

"Description:" a laser light source focused onto a photo-variable resistor; when laser beam is broken, the resistance value of the photo-variable-resistor rises, causing a change of state of the digital input pin on the micro-controller from 1 to 0.

"Components:"

Laser beam source - pen light, Chinatown ($5)
Batteries removed and + / - leads soldered for connection to electric power. In this case, the spring is ground and encasing body positive.

Phototransistor
links:
[[Radio Shack | http://www.radioshack.com/product/index.jsp?parentPage=search&cp=&productId=2049724&kw=phototransistor&tab=techSpecs]]
(purchase here, slim on data)

[[Jameco Data-sheet | http://jameco.com/wcsstore/Jameco/Products/ProdDS/112168.pdf]]


"Notes selected from Wikipedia"
A "photodiode" is an electronic component and a type of photodetector. It is a p-n junction designed\\ to be responsive to optical input. Photodiodes are provided with either a window or optical fibre connection, in orde\\ to let in the light to the sensitive part of the device.
Photodiodes can be used in either zero bias or reverse bias.\\ In zero bias, light falling on the diode causes a voltage to develop across the device, leading to a current\\ in the forward bias direction. This is called the photovoltaic effect, and is the basis for solar cells - in fact a solar \\cell is just a large number of big, cheap photodiodes.
Diodes usually have extremely high resistance when reverse biased. \\This resistance is reduced when light of an appropriate frequency shines on the junction. Hence, a reverse biased diode can\\ be used as a detector by monitoring the current running through it. Circuits based on this effect are \\more sensitive to light than ones based on the photovoltaic effect.\\\\

A "phototransistor" is a bipolar transistor that is encased in a transparent case so that light can reach \\the Base-Collector diode. The phototransistor works like a photodiode, but with a much higher \\sensitivity for light, because the electrons that tunnel through the Base-Collector diode are amplified by the transistor function. \\A phototransistor has a slower response time than a photodiode.
A bipolar junction transistor (BJT) is a type of transistor, \\an amplifying or switching device constructed of doped semiconductors. Bipolar transistors are so named\\ because the main conduction channel employs both electrons and holes to carry the main electric current.



PNP

NPN
The schematic symbols
for PNP- and NPN-
type BJTs.

A semiconductor is a material with an electrical conductivity that is intermediate between that of an insulator and a conductor. A semiconductor behaves as an insulator at very low temperature, and has an appreciable electrical conductivity at room temperature although much lower conductivity than a conductor. Commonly used semiconducting materials are silicon, germanium, and gallium arsenide.
A semiconductor can be distinguished from a conductor by the fact that, at absolute zero, the uppermost filled electron energy band is fully filled in a semiconductor, but only partially filled in a conductor.
The distinction between a semiconductor and an insulator is slightly more arbitrary. A semiconductor has a band gap which is small enough such that its conduction band is appreciably thermally populated with electrons at room temperature, whilst an insulator has a band gap which is too wide for there to be appreciable thermal electrons in its conduction band at room temperature.
N-type P-type doping for Semiconductors http://en.wikipedia.org/wiki/Semiconductor

Applications for Photodiodes / Phototransistors:
P-N photodiodes are used in applications similar to photoconductor family:
Consumer items such as camera light meters, clock radios (the ones that dim the display when it's dark) and street lights usually seem to use photoconductors rather than photodiodes, although in principle either could be used.
Receivers for remote controls in VCRs and televisions often use photodiodes.

Proposed Application:
Break-beams in tandem to deliver "casual" population count.
The break-beam sensor can easily be used to trigger an event when a beam is broken; a state change to 0 (or when an obstacle is removed; a state change to 1).
Beginning with using this as a tool to detect when a person has entered a specific area (installation space). it would obviously, also be useful to know when a person has left. Also, it would be useful to know how many people remain in the area at any given time.

Ultimately, the series should describe a 4 enter/ exit space. The tandem lasers are called in sequential alphabet pairs, with the earliest letter letter noting the out-most laser/diode and the inner-most the second in the pair, ie, AB = enter. BA = exit. The outer beam must be tripped first when a body enters the site; a count of 1 is added when the A beam is tripped before B.
A count of -1 is added (1 is subtracted) when B is tripped before A.

Image goes here

To begin, a pair of AB laser/ diodes is prepared. A proto-type that houses 2 laser pen lights aimed at a separate box that house 2 phototransistors. This second box is divided into 2 parts and lined with reflective tape with a hole cut in the center of each half. The phototransistor is mounted across each hole, the reflected light bounces off the back of the box and hits the front of the transistor. When the transistor receives the light source, enough electrons are excited to allow the current to pass; resistance is lowered.
add box photo images 1,2


Psuedo-code