Pi Gurus required (or something like that)
Discussion
Here is a software and hardware challenge that I can t quite resolve.
The problem definition is as follows:
There is an automatic gate across the entry / exit to a car park.
Outside the carpark is a numerical keypad that will open the gate, but from where this is you cant see inside the car park.
Inside the carpark is a green button switch that will open the gate
The standard gate automation takes care of closing the gate automatically 1 minute after it reaches the open position.
What I want to do is
1) allow the first user of the day to enter the car park using the keypad, then stop anyone else coming in for 50 minutes by turning the keypad off. There may be more than 1 car going in at this time, and the first user can always let another car in during the 50 minutes by using the green button.
2) at the end of the 50 minutes, the first user and anyone else inside at the time have to leave, so the car park is empty for the next user.
and so on and so on throughout the day.
3) If the car park isn't empty, the keypad needs to be disabled so the next user cant come in.
How would you solve this?
I've thought about a raspberry pi with simple relay and timer to power off the keypad, and then a camera and "image recognition" to look at the carpark and determine if its empty, but I dont know enough about image recognition to know if this is easy to do or a hiding to nothing. What other solutions could there be ??
The problem definition is as follows:
There is an automatic gate across the entry / exit to a car park.
Outside the carpark is a numerical keypad that will open the gate, but from where this is you cant see inside the car park.
Inside the carpark is a green button switch that will open the gate
The standard gate automation takes care of closing the gate automatically 1 minute after it reaches the open position.
What I want to do is
1) allow the first user of the day to enter the car park using the keypad, then stop anyone else coming in for 50 minutes by turning the keypad off. There may be more than 1 car going in at this time, and the first user can always let another car in during the 50 minutes by using the green button.
2) at the end of the 50 minutes, the first user and anyone else inside at the time have to leave, so the car park is empty for the next user.
and so on and so on throughout the day.
3) If the car park isn't empty, the keypad needs to be disabled so the next user cant come in.
How would you solve this?
I've thought about a raspberry pi with simple relay and timer to power off the keypad, and then a camera and "image recognition" to look at the carpark and determine if its empty, but I dont know enough about image recognition to know if this is easy to do or a hiding to nothing. What other solutions could there be ??
I'm fascinated by the specifics of this and why on earth you'd want to implement it as described, but that's not what you are asking! 
It's fairly easily doable with a Pi I think.
Rather than trying to count cars, or check in spaces etc, I'd approach it being tracking who goes in and out. Have the system 'reset' overnight so that cars left long term in the carpark don't mess things up.
Then just use number place recognition as cars come and go. First result from google is: https://randomnerdtutorials.com/car-plate-recognit... Seems quite doable.
Just add and remove cars from a local list on the Pi, so you always know who is or isn't in the carpark. Then "if empty' of "if >50 mins" you can apply your gate logic however you like.
It's trivial to have the Pi control a relay to enable/disable power to the keypad.

It's fairly easily doable with a Pi I think.
Rather than trying to count cars, or check in spaces etc, I'd approach it being tracking who goes in and out. Have the system 'reset' overnight so that cars left long term in the carpark don't mess things up.
Then just use number place recognition as cars come and go. First result from google is: https://randomnerdtutorials.com/car-plate-recognit... Seems quite doable.
Just add and remove cars from a local list on the Pi, so you always know who is or isn't in the carpark. Then "if empty' of "if >50 mins" you can apply your gate logic however you like.
It's trivial to have the Pi control a relay to enable/disable power to the keypad.
walamai said:
I'm fascinated by the specifics of this and why on earth you'd want to implement it as described, but that's not what you are asking! 
It's fairly easily doable with a Pi I think.
Rather than trying to count cars, or check in spaces etc, I'd approach it being tracking who goes in and out. Have the system 'reset' overnight so that cars left long term in the carpark don't mess things up.
Then just use number place recognition as cars come and go. First result from google is: https://randomnerdtutorials.com/car-plate-recognit... Seems quite doable.
Just add and remove cars from a local list on the Pi, so you always know who is or isn't in the carpark. Then "if empty' of "if >50 mins" you can apply your gate logic however you like.
It's trivial to have the Pi control a relay to enable/disable power to the keypad.
oooh now thats getting really fancy!!
It's fairly easily doable with a Pi I think.
Rather than trying to count cars, or check in spaces etc, I'd approach it being tracking who goes in and out. Have the system 'reset' overnight so that cars left long term in the carpark don't mess things up.
Then just use number place recognition as cars come and go. First result from google is: https://randomnerdtutorials.com/car-plate-recognit... Seems quite doable.
Just add and remove cars from a local list on the Pi, so you always know who is or isn't in the carpark. Then "if empty' of "if >50 mins" you can apply your gate logic however you like.
It's trivial to have the Pi control a relay to enable/disable power to the keypad.
The best bit is I know that the car-park will be empty overnight, and, the best bit, I "know" who should be using the car-park, and when they should arrive, so I could probably generate a daily list of allowed number plates, certainly for the first car of each group.
Number Plate recognition could be the way forward, would you need 1 camera on the way in (by the keypad) and one to make sure everyone leaves, or is it all done by just 1 camera reading front and rear numberplates??
Counting seems the easiest.
Could even make it easier and avoid sensors by just counting how many times the entry keypad has been used vs. the exit button? So entry is +1 to the count, exit button is -1, so as long as the count is 0 then someone can enter. Possible variations as you need to allow the person inside to open the gate manually, but doable.
Could even make it easier and avoid sensors by just counting how many times the entry keypad has been used vs. the exit button? So entry is +1 to the count, exit button is -1, so as long as the count is 0 then someone can enter. Possible variations as you need to allow the person inside to open the gate manually, but doable.
You could use a fairly basic image recognition setup - use a camera and some method that compares the current view with a picture of the empty car park. That way you don't need complex ANPR, or image recognition, just basic, how much does one thing look like the other. Might need some calibration if there's other stuff in there that moves, but could work fairly well and should be more within the range of Raspberry Pi or Arduino.
Isn't the real problem here that people cannot see if the car park is full or not?
Is there any way of doing this without a high-tech solution which at some point may fail in the next few years?
Otherwise I think a simple counter at the entrance which tries to count up/down daily, and is then reset at night would make sense. This shouldn't need a Pi, and is probably available off the shelf from someone, maybe your gate supplier.
Is there any way of doing this without a high-tech solution which at some point may fail in the next few years?
Otherwise I think a simple counter at the entrance which tries to count up/down daily, and is then reset at night would make sense. This shouldn't need a Pi, and is probably available off the shelf from someone, maybe your gate supplier.
biggiles said:
Isn't the real problem here that people cannot see if the car park is full or not?
Not sure, to me it sounds like some sort of venue where people turn up for a short period of time, leave, then the next lot come in. Everyone out before more people come in. If you've booked the venue, you turn up, enter the code, then your guests can get in, and everyone leaves together.No idea if that's what it is, but what's described isn't as simple as if there's a space oyu can come in.
paulrockliffe said:
biggiles said:
Isn't the real problem here that people cannot see if the car park is full or not?
Not sure, to me it sounds like some sort of venue where people turn up for a short period of time, leave, then the next lot come in. Everyone out before more people come in. If you've booked the venue, you turn up, enter the code, then your guests can get in, and everyone leaves together.No idea if that's what it is, but what's described isn't as simple as if there's a space oyu can come in.
Cant rely on customers to do anything for themselves/others, so it has to be automatic. There is also the desire for us to make this as easy as possible for disabled users, hence the move away from a padlock and swing gate to an automatic gate.
julian64 said:
I could be wrong but isn't that number plate recognition cloud based computing?
I did a similar thing with a front door face recognition thing a few years ago, the problem was that if you lost the internet connection it stopped working
Ah, that was a bad example that I linked sorry and you're right, that one was cloud based. It can definitely be done locally though, a Pi 4 has enough power to do the recognition comfortably. Training the dataset requires some grunt, but once you have a trained dataset a low powered device can do image recognition.I did a similar thing with a front door face recognition thing a few years ago, the problem was that if you lost the internet connection it stopped working
https://platerecognizer.com/anpr-on-raspberry-pi/
paulrockliffe said:
You could use a fairly basic image recognition setup - use a camera and some method that compares the current view with a picture of the empty car park. That way you don't need complex ANPR, or image recognition, just basic, how much does one thing look like the other. Might need some calibration if there's other stuff in there that moves, but could work fairly well and should be more within the range of Raspberry Pi or Arduino.
I don't think this really works in the real world unfortunately due to lighting changes. A basic image comparison to a computer looks completely different depending on lighting. It's why motion detection on cheap security cams is terrible!mondeoman said:
paulrockliffe said:
biggiles said:
Isn't the real problem here that people cannot see if the car park is full or not?
Not sure, to me it sounds like some sort of venue where people turn up for a short period of time, leave, then the next lot come in. Everyone out before more people come in. If you've booked the venue, you turn up, enter the code, then your guests can get in, and everyone leaves together.No idea if that's what it is, but what's described isn't as simple as if there's a space oyu can come in.
Cant rely on customers to do anything for themselves/others, so it has to be automatic. There is also the desire for us to make this as easy as possible for disabled users, hence the move away from a padlock and swing gate to an automatic gate.
Another option:
1. Allow users to leave at all times
2. Fit timer control box with SMS over-ride
3. Allow the gates to open for any incoming users from x:00 to x:15 for every hour it's booked. If they are late, you have the option for HQ to SMS the gate, but you might not advertise this fact. You may even be able to set it up for a computer to SMS the gate every hour booked to say "allow entry for 15 minutes from now".
4. Communicate to users they must arrive within 15 mins of their slot start-time. And if they find anyone there from before, notify you to deal with them.
You will probably have this problem of people over-staying for good/bad reasons (whereupon "chaos will ensue") whatever technical solution you put in place! Personally, if I were a paying customer and the previous user over-ran, I'd be even more annoyed if the gate didn't let me enter at all until the previous user has gone.
biggiles said:
mondeoman said:
paulrockliffe said:
biggiles said:
Isn't the real problem here that people cannot see if the car park is full or not?
Not sure, to me it sounds like some sort of venue where people turn up for a short period of time, leave, then the next lot come in. Everyone out before more people come in. If you've booked the venue, you turn up, enter the code, then your guests can get in, and everyone leaves together.No idea if that's what it is, but what's described isn't as simple as if there's a space oyu can come in.
Cant rely on customers to do anything for themselves/others, so it has to be automatic. There is also the desire for us to make this as easy as possible for disabled users, hence the move away from a padlock and swing gate to an automatic gate.
Another option:
1. Allow users to leave at all times
2. Fit timer control box with SMS over-ride
3. Allow the gates to open for any incoming users from x:00 to x:15 for every hour it's booked. If they are late, you have the option for HQ to SMS the gate, but you might not advertise this fact. You may even be able to set it up for a computer to SMS the gate every hour booked to say "allow entry for 15 minutes from now".
4. Communicate to users they must arrive within 15 mins of their slot start-time. And if they find anyone there from before, notify you to deal with them.
You will probably have this problem of people over-staying for good/bad reasons (whereupon "chaos will ensue") whatever technical solution you put in place! Personally, if I were a paying customer and the previous user over-ran, I'd be even more annoyed if the gate didn't let me enter at all until the previous user has gone.
Would simple light beams on either side of the gate work? Count in and count out?
julian64 said:
You could have a small arduino bases GPRS.
When the last person texts you , then you could close/lock the gate by text. That way each team going in and out would be monitored by simple text commands from your phone
Interesting - When the last person texts you , then you could close/lock the gate by text. That way each team going in and out would be monitored by simple text commands from your phone
I was looking at using NFC on the phone, linked into our app, and linked to the gates, but our app developer wanted £10k, and thats way outside our budget.
Maybe multiple ultrasonic sensors built into posts around the carpark would give me a wide enough field to determine if a car is still in - any positive signal and the keypad stays off.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



and 3-4 for a BMW?