Notifications
Clear all

Emergency Fire Door - Intruder Alarm - HELP!

13 Posts
5 Users
9 Likes
1,108 Views
Tigs62
(@tigs62)
Member
Joined: 3 years ago
Posts: 20
Topic starter  

Hi,

I need some ideas for a specific problem.  I have four Emergency Fire exits in a Factory.  In the hot weather, the lads in the factory wish to keep the doors open.  To do this, we have to ensure that the factory is still secure in case someone "wanders in" and steals something.

PIR detectors are too affected by staff walking past.
I was thinking of some sort of distance measuring circuit that could be mounted on one side of the door.
I have been looking at either an Ultrasonic Sensor, like the HC-SR04, or a Laser, like the TOF10120.

My "plan" would be to put the circuit in a box and beam it across the doorway.  If someone walked through the doorway the "distance" measurement would go down significantly and an alarm would be tripped.

There are a number of videos online, including Bills own "Laser vs Ultrasonic - TOF10120 vs. HC-SR04".
The problem with most of these videos is that they concentrate a lot on short distances, up to 50cm.
To mount the detector to one side of the doorway, would mean a total width measurement of about 90cm, although a human walking through the door will undoubtedly reduce the "distance" measurement to about 50cm.

One "good" requirement is that the distance measurement does not have to be accurate, because the distance is going to change dramatically from the whole width of the doorway to the distance to the human.  As long as the circuit can see this change, it will be fine.  I don't care if the circuit is accurate to the nearest 10cm as long as it sees the change.

Ultrasonic sensors have a relatively slow response time, so i am not sure of a human stepping through the door would set it off.

Laser TOF sensors are much faster, so would not have this problem.

A lot of circuits seem to be based upon Arduino boards, but i would prefer to use an ESP32 so that i could utilise the built-in WiFi.  I am not sure if the Arduino code that i have seen would still work with the ESP32.
I would also need to work out which pins to use.

Can any of your guys give me your ideas, or even some links to good videos or websites?

Thanks

You are never too old to learn.
You are never too old to teach.


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6906
 

@tigs62 Why not a simple light beam across the opening, use infra-red so it isn't visible. IR transmitters and receivers are standard fare in most hobby kit's with sample code etc. I suspect googling it will get you what you need. However remember small animals will walk under and an observant bad guy might learn from that so a few sensors placed horizontally and vertically might be needed. OR get a door with a big fan mounted in the middle.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Tigs62 reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @zander

@tigs62 Why not a simple light beam across the opening, use infra-red so it isn't visible. IR transmitters and receivers are standard fare in most hobby kit's with sample code etc. I suspect googling it will get you what you need. However remember small animals will walk under and an observant bad guy might learn from that so a few sensors placed horizontally and vertically might be needed. OR get a door with a big fan mounted in the middle.

@zander this sounds like a great idea if @tigs62 doesn't have any issues running wiring to both sides of the door.  

Of your ideas, I think the HC-SR04 is the better choice.  The range is good out to 4 meters.  They are a lot slower than ToF sensors, but restricting to 1 meter, you should be able to get near 150 Hz.  I doubt someone could run through it and not be detected.

As far as ToF sensors, the one's I'm using seems to be sensitive to the sun, incandescent and halogen lighting.  If you only have LED lighting in the shop, it should work fine.  Although this sensor is an 8x8, the single beam one is a lot cheaper and has a 2 meter range.  See my video on this post here for more details: https://forum.dronebotworkshop.com/user-robot-projects/inqling-junior-robot-mapping-vision-autonomy/paged/3/#post-31051

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Tigs62 reacted
ReplyQuote
revver11
(@revver11)
Member
Joined: 5 years ago
Posts: 16
 

The simple light beam ones I have seen have the transmitter and the receiver on the same side of the door and mounted in the one enclosure at about knee height. On the far side of the door is a reflector.

The alarm is usually audible but I don't see why it couldn't be designed to trigger a remote device(s). Seems to me that it would be possible to create multiple triggers, vertical, horizontal and diagonal if that was needed.

They seem to work quite well as shop-minders from what I've seen.

 


   
Tigs62 and Ron reacted
ReplyQuote
Tigs62
(@tigs62)
Member
Joined: 3 years ago
Posts: 20
Topic starter  

Hi Everyone,

Thanks for the input.  I am going to experiment with HC-SR04 sensors this Friday.  Hopefully they are fast enough to catch a "nimble" human.

As the doorway is not hugely wide, I thought that I would experiment with mounting the sensor above the door, pointing down.

This would mean that the sensor could trigger on anything near that half a metre.

I though that I might have to experiment with putting a cover over the transmitter and receiver elements to keep the detection more "focused" on only the doorway.

I will also try the Knee height option.

If the ultrasound sensor is too "flaky" then I will have a stab at the TOF10120.

Tigs

You are never too old to learn.
You are never too old to teach.


   
ReplyQuote
Tigs62
(@tigs62)
Member
Joined: 3 years ago
Posts: 20
Topic starter  
Posted by: @inq

As far as ToF sensors, the one's I'm using seems to be sensitive to the sun, incandescent and halogen lighting.  If you only have LED lighting in the shop, it should work fine.  Although this sensor is an 8x8, the single beam one is a lot cheaper and has a 2 meter range.  See my video on this post here for more details: https://forum.dronebotworkshop.com/user-robot-projects/inqling-junior-robot-mapping-vision-autonomy/paged/3/#post-31051

Thanks @inq.  The workshop only has LED lighting, but there is sunlight coming through the doors.
However, the intention was to mount the sensor one the inside wall about 15cm away from the door, so i am not sure how much external sunlight will affect it.  Trial and error i think.

I took a look at the link you gave.  I assume that you are talking about the VL53L5CX sensor?
Taking a look around, it seems to be a lot more expensive than the TOF10120.  Did you find this to be true?
In your opinion, do you think that it will be worth spending so much more on the VL53L5CX?
Have you seen many comparisons between the two?
You said "the single beam one is a lot cheaper and has a 2 meter range".
Which sensor is this?

Thanks
Tigs

You are never too old to learn.
You are never too old to teach.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1664
 

Hi @tigs62,

  A random thought, not tested in the field!

  The '37 sensors' type kits for Arduino from Elegoo and Banggood include devices normally found in TV remotes and the like, so the devices are very cheap and you can buy the boards separately from the usual bazaars, probably less than £1, direct from China, though I haven't checked. Elegoo has the 'manual' online, which you may find worth downloading for a quick overview.

The point being, these systems are infra red, and the light is modulated at about 38kHz. As neither room lights or sunlight are 'usually' modulated at this frequency, the electronics can filter out a lot of the 'background' from the required signal, provided the detector is not (say) saturated with direct sunlight. Also the detector usually has an IR filter to help.

With any optical system, I think you will need to shade the detector by recessing it into a tube or similar.

As I say, only a random thought, not a solution and it maybe a rabbit hole!

Best wishes, Dave


   
Tigs62 reacted
ReplyQuote
Tigs62
(@tigs62)
Member
Joined: 3 years ago
Posts: 20
Topic starter  

@davee Hi Dave,  There are no bad ideas on my posts.  Any thoughts are worth mentioning and i appreciate your time.  Even if an idea doesn't "pan out", there is experience to be gained.

I have got a sensor kit at home.  I routed around in it to find the HC-SR04 module, but hadn't thought to look at whether the other ones might be a good idea.  The kit came with a tiny CD-ROM that i might chuck into my PC (fingers crossed) and see whether there is much additional information on the sensors.

Thanks for the input.

Tigs

You are never too old to learn.
You are never too old to teach.


   
DaveE reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @tigs62

I took a look at the link you gave.  I assume that you are talking about the VL53L5CX sensor?
Taking a look around, it seems to be a lot more expensive than the TOF10120.  Did you find this to be true?
In your opinion, do you think that it will be worth spending so much more on the VL53L5CX?
Have you seen many comparisons between the two?
You said "the single beam one is a lot cheaper and has a 2 meter range".
Which sensor is this?

Laser ToF

I have both the single laser version (VL53L0X) and the (VL53L5CX) from the same manufacturer.  I believe I recall getting the three of the VL53L0X for around $12 total.  The single VL53L5CX was $25.  All here in the US.  YMMV back there in the mother country!  🤣 😉 

For my purposes, I think the VL53L5CX is well worth the price.  Getting 64 readings at one time allows for some interesting benefits for measuring a room and sensing things coming into a robot's FOV without having to employing a pitch and yaw "neck" movements of the sensor.  I can look at something round and tell the difference between say a plate and ball in one shot versus having to scan around.

For your purposes, I can't see how the 64 beams will catch someone that the 1 beam won't.  Remember - these things are not beams like a laser pointer, they are more like flashlight with radiating beam.  The FOV on the 1 beam is 25 degrees and 45 degrees for the 64 beams.  Also, these are actually slower rate than the ultrasonic.  64 beams = 15 Hz, 16 beam = 60 Hz.  I couldn't find a max rate on the 1 beam.

Interesting... I couldn't find a datasheet for your TOF10120 either, but they basically sound about the same as my VL53L0X for range.  The VL53L0X uses an infrared wavelength of 940 nm.  If yours is different, it may have different behavior in various lighting conditions.

Ultrasonic ToF

I guess that is why I'm suggesting the HC-SR04 might be a better choice.  I think I got them for about $1 a piece some time back, they aren't susceptible to different light and they have a higher sample rate if used right.  The FOV is about the same at 21 degrees.

BUT Voltage - I just went back and saw you're using ESP32.  The regular HC-SR04 doesn't like 3.3V very well.  There is an HC-SR04P for 3.3V, but it's more expensive and extremely hard to find.  There is also a hack to convert a regular HC-SR04 to work with 3.3V:  https://www.instructables.com/Modify-Ultrasonic-Sensors-for-3-Volts-Logic-prepar/

BUT Fiddling Around - However, I think you'll need to work with them a bit to see how they behave in your conditions.  The laser ToF's just give you a number and you're done.  The ultrasonic, you control all aspects.  You fire the pulse and wait for the return.  If after so long (say 0.012 seconds) the range is further than 2 meters, you can fire another pulse.  But if the first arrives back from say 3 meters, you can't tell if the reflection is from the 1st pulse going 3 meters or the second pulse only going 1 meter.  You mentioned pointing it down from above the door... does a hard concrete floor bounce sound like a mirror?  Sure does!  It might be quite the nightmare of figuring out what your sensor is telling you.

Please let us know here how your testing goes.  Remember we all learn from your successes and miss-fires!

VBR,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Tigs62 reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6906
 

@inq Level shifter? Also I think some esp32 are 5v in and have a limited 5v out.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Tigs62 reacted
ReplyQuote
Tigs62
(@tigs62)
Member
Joined: 3 years ago
Posts: 20
Topic starter  

@inq It is sometimes interesting when someone uses an acronym that i have never seen before.  This seems to be happening more as i get older.  I had never seen "YMMV" before, so like all "oldies" I Googled it and got two hits from the urban dictionary.

I can only hope that you meant the first meaning, because the second one is not something i have been offered for a long time lol lol 😂

Thanks for all the extra info and insight into the sensors. As you said, given what i an trying to do, reducing the FoV and increasing the refresh rate by using a single beam is actually a good thing.  As you said, I am not interested in building up a picture from the sensor, just more of a Go/No Go situation.

Pointing the ultrasonic sensor at the concrete floor may sound like it could be an issue, but i am hoping that this is where playing with the Arduino code might actually help. 

If my primary loop does something like this:

Loop 1:

1.  Take measurement

2.  If measurement is greater than 50cm then goto 1.

( if measurement is less than 50cm )

3.  Set an output pin high

( this would be a light or more probably a relay for a loud buzzer/bell ) 

Go to Loop 2

Loop 2

5.  Wait for an input pin to go high

( this would be a simple Push To Make switch to silence the alarm ) 

6.  Set the earlier output pin low

Go back to Loop 1

This is my plan for my simple test program. If it works reliably, then i might add a WiFi section to send an email to warn a person or Distribution Group

A second addition would be to have another ESP32 take a picture of the doorway and send it somewhere.  A Web page or an email. 

Although we really need these sensors, it is fun to find solutions to real world problems. 

Thanks for all the help and support guys. 

Tigs

You are never too old to learn.
You are never too old to teach.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @tigs62

I can only hope that you meant the first meaning, because the second one is not something i have been offered for a long time lol lol 😂

 🤣  Didn't know about the second.  I had to look it up too.  The world is changing so fast.  What's common slang one day is politically incorrect the next... and vice versa.  Hard to keep up with it.  Fortunately, the older I get, the less I give a ...  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Tigs62 reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@zander - I've never had to hack it... I have more of the HC-SR04P 3.3V versions than I'll ever use.  With the laser ToF sensors around, I don't think I'd ever use an ultrasonic again.  Maybe for student projects.

But... the article seems to say to me, that the HC-SR04 can be triggered to send out the pulse with 3.3V, but needs the 5V to power the pulse (I guess) and as a result, the echo comes back with 5V to the ESP... blowing out the pin.  Their solution is a simple voltage divider soldered to the HC-SR04 board to supply 3.3V to the echo pin.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote