This connected mirror is based on three main functions :
- Print several informations on the screen, which are measured by sensors for some of them (temperature, humidity).
- Facial recognition : if the user of the mirror isn’t recognised, pictures of him are taken and a new profile is created with them.
- Vocal recognition : some questions appear on the screen, the user responds and the answers are stocked in a database.
Components of the mirror
- Jetson Xavier
- DHT22 Temperature Sensor
- Infrared Detector
- Camera with micro
- Wood Planks
- Plexiglas Plate
- One-way film
- Screws
- Plastic Brackets
- Multi-Socket
- HDMI Screen
- The screen
To make a one-way mirror with the screen, we put a plexiglas plate on it, which was first covered with a one-way film (see picture below) :
At first, you have to put soapy water on the plate. Then, during the setting up of the film, it necessitates to act slowly, and also to apply a pression with a scraper in order to avoid the creation of air bubbles.
After that, we placed the plate on our screen, the last step was to add black tape between the plate and the sides of the screen to avoid the creation of dust under it.
- The frame
The frame of the mirror is entirely made of wood.
on the front side, the hole we made on the plank is thought to be the exact dimension of the screen without the sides. There are also two holes at the top for the camera and the infrared detector. They are the only things visible for the user of the mirror.
We mainly used the drill and jigsaw to do works on the wood.
We calculated the dimensions of the frame so that we could fix all our equipments on the bottom side :
- the jetson Xavier (we run our code on it, it allows to have very good performances)
- The screen
- One multi socket to plug our hardware which need 220V.
- One WIFI device for the jetson.
- The sensors and the camera
We used wood planks, plastic brackets and screws in order to block sideways movements. We also put some on top of the equipments so that they don’t fall if the mirror is upside down.
We had to pay attention of several details during the implementation of the hardware :
- Three holes to pass respectively : - the power supply of the multi-socket, - the wire of the DHT22 (connected to PIN 37 of the jetson), - wires of the camera and infrared detector.
- A cut to access the buttons of the screen
- Several holes next to the jetson Xavier to allow a good aeration.
All our code has been developed in Python, the algorithm works as follows :
When the mirror is plugged, the temperature, humidity and hour are printed on the screen (initial state). The DHT22 sensor is doing those measures, The graphical interface is made with GODOT.
If the infrared detector detects something, the camera is turned on and the person in front of the mirror is analysed :
- if the person is already in the database, there is just a welcoming message for him with his name.
- Otherwise the questionnaire begins, At first you have to tell your name (saved in a SQL database), every time the person gives an answer, the camera takes a picture of him before showing the following question on the screen.
Every answer is saved in our database. When questions are over, we come back to the initial state
To speak more about the facial recognition part, we used the library face_recognition. For one picture taken, the data corresponding to the face details are saved under the form of 128 float in the database.
At the end of the questionnaire, 8 pictures of the same person have been taken which is enough to avoid mistakes during the recognition of someone.
For the vocal recognition part, we used the API of google. The results weren’t always satisfactory,.it could be because the micro on the camera isn’t very good or that we didn’t use the paid version of the API.
However, to fix this problem, we choose to put very closed questions where possible answers are defined in advance, for example : “What’s your favorite fruit ? 1) Apple, 2) Strawberry, 3) Raspberry”.
Our code is articulated around three different threads, the following schematic gives all the steps.


Comments