Simple Home Domotics

Feb 13, 2022 2 min read

In this project the goal was to open a door with a PC through a Bluetooth connection. The basic components are:

Then, I migrated the code from Arduino to STM32F4 using libraries and functions realised previously in other projects. The basic working operation is that with the OPEN_PACKET the door has to stay/become open the opposite for the CLOSE_PACKET. The packets were thought so that in a possible extension, the same protocol can be used for controlling the number of steps that we want to make.

For opening the door, resuming, there’ll be the Bluetooth way or also the pressing of the blue button present on the STM32F4 Discovery board. The status of the door is displayed on a LCD display, that can be seen in the figures below.

Tested the program I had to realise the mechanical system. I used a bipolar stepper motor, realised the transmission with gears of factor (0.3:1 with a pulley of diameter 2 cm) so that I could have more torque. I connected the pulley to a screw so that the screw will rotate with the motor. After this I realised a 3D model of a door and printed it with a 3D printer. Some images are available here below:

Figure 1) Door image seen from Catia.

Figure 2) Door image seen from Catia.

Figure 3) Door image seen from Catia.

Figure 4) LCD display used in the project with its setting board I realised for easy usage of it.

The system of the stepper motor and its driver are the same used in another project, presented in the website. Here below I put anyways some images that show the used components.

Figure 5) Board for controlling the stepper motor.

Figure 6) Board for controlling the stepper motor.

Figure 7) Board for controlling the stepper motor.

Figure 8) System of stepper motor and its driver connected.

Figure 9) Modification of the stepper motor driver.

Some images of the system the makes the door rotate are presented here below.

Figure 10) Door system based on a bipolar stepper motor.

Figure 11) Door system based on a bipolar stepper motor.

Figure 12) Detail of the gears and the belt for connecting the stepper motor to the door.

A example of the prototype of the system is below in the video. There’s the Python application that controls the MacBook Air Bluetooth card and communicates via Bluetooth with a HC05 module connected to a Arduino Uno through a Serial UART communication. Instead of opening the door, the Arduino is switching on and off the LED present in the breadboard.

Here below I present the videos of the two systems working.

The first is the video that shows the system controlled with a button.

The second one is the video showing the Bluetooth-based system.