My name is Lambros , and I joined Balena two weeks ago.
The goal of my project is to use the Raspberry Pi to make an automated door.
I have no technical background, so I tried to come up with some ideas on how an employee may gain access to the office without having to manually create and register an account with the door control application.
The following was my first simplified approach.
1.When an employee approaches the door, his phone automatically connects to the office’s Wi-Fi.
2.Every “some” seconds, Raspberry checks local Wi-Fi devices.
3.If the Mac-address of the registered cellphone is found in the Local Wi-Fi list, Raspberry sends a signal to open the door.
There are a number of pain points to the current approach:
1.Employees must register their Mac addresses with an online document before visiting the workplace.
2. Numerus concerns about security.
3. The employer will still be connected to the office’s Wi-Fi, and Raspberry will continue to send out signal to open the door.
I’m thinking of choosing this method after considering the pain points. The steps are as follows:
1.When an employee approaches the door, his cellphone automatically connects to the office’s wireless network.
2. Employee accesses a local page by typing Raspberry local IP into his web browser.
3. Enter the employee’s credentials into the local page (Raspberry connected to an API with the company’s employee credentials, Google credentials?)
4. When the employee presses the open button on the local page , the door opens.
The most important issues to consider.
1.It will take too long to enter the office.
2. It will be difficult to type while carrying bags and other items.
I’ll be using the following hardware:
1.A raspberry pie 4
2.A solenoid lock
3.A relay module
4. 12V 3A power supply
5. 12 V to 5V converter
I’m starting with Python( baby steps) and would like to balenify it with Docker.?
I welcome suggestions and ideas for how to make this project work
I added a pi camera for QR code scanning to solve a part of the “how to open the door quickly problem.”
My first step was to scan a QR code (Hello World) to unlock the door, which was then locked after 5 seconds.
import RPi.GPIO as GPIO
relay = 17;
GPIO.setup(relay , GPIO.OUT)
GPIO.output(relay , 0)
GPIO.output(relay , 1)
# set up camera object
cap = cv2.VideoCapture(0)
# QR code detection object
detector = cv2.QRCodeDetector()
# get the image
_, img = cap.read()
# get bounding box coords and data
data, bbox, _ = detector.detectAndDecode(img)
# if there is a bounding box, draw one, along with the data
if(bbox is not None):
for i in range(len(bbox)):
cv2.line(img, tuple(bbox[i]), tuple(bbox[(i+1) % len(bbox)]), color=(255,
0, 255), thickness=2)
cv2.putText(img, data, (int(bbox), int(bbox) - 10), cv2.FONT_HERSHEY_SIMPLEX,
0.5, (0, 255, 0), 2)
print("data found: ", data)
if data == 'Hello World':
GPIO.output(17 , 0)
prevTime = time.time()
doorUnlock = True
print('Door Open ')
if doorUnlock == True and time.time() - prevTime > 5:
doorUnlock = False
GPIO.output(17 , 1)
print('Door Locked ')
cv2.imshow("code detector", img)
if(cv2.waitKey(1) == ord("q")):
The following step would be to create a local page with Flask (python) to register the users.(http://0.0.0.0:8000/)
The final step would be to automatically generate and send a new QR code to each user’s email based on NAME SURNAME RANDOMNUMBER every day, as well as keep a log of who entered the building and when.
As a proof of concept, I’m doing it with one raspberry for one door.
Any suggestions would be greatly appreciated.
awesome! this is what our product doing~~~
It’s a IoT door lock with QR scan as well. We use raspberry zero as the main controller.
I finished the project.
The steps would be as follows:
Admin logs in to the local web page and registers a user account.
A QR code is sent to the user’s email address.( uuid random generated QR code )
User is registered in a Database.
By scanning his QR code, the user unlocks the door.(After 5 seconds, the door locks again.)
The office’s access log is accessible to the administrator.
A new QR code will be sent to all registered users every day at 00:00.
Code : GitHub - LPapapo/IoTDoorLockManagement
Next step to Balenafy it!!
Did you try this in a real door @LPapapo ?
No, I didn’t try it in a real door. Whether or not the project works in a real door is more a matter of finding the right solenoid lock that can fit in the right door.
Improvements can be made (many) . Perhaps an IR sensor that detects whether the door is still open so that the solenoid lock is not locked while the door is not closed but ye ,it will work in a real door . @mpous
Nice! thank you for the clarification @LPapapo