The main goal of this project was to develop a system that could control the movement of a solenoid lock using a microcontroller. The system enables the motor to extend and retract based on values the user would input through their mobile device. Additionally, the project incorporates Bluetooth functionality for wireless control and configuration. The system allows the users to establish new bondings, erase existing bondings, and enable secure connections.
General view |
Main components I used to achieve the project goals is listed below along with DigiKey part numbers:
Schematic | Assembly | |
The software implementation focuses on two main aspects. Solenoid control and Bluetooth functionality. For solenoid control the software enables the microcontroller to control the solenoid's movement based on user commands received via Bluetooth. It processes the commands and translates them into appropriate solenoid control signals.
For Bluetooth stack initialization the software initialized the Bluetooth stack, enabling communication and interaction with other devices. It establishes the required protocols and services for seamless Bluetooth operation. It was also programmed for button handling and user interaction so that the software responds to responds to button inputs. For instance, if a specific button is pressed during the boot process, it prompts the user with a message to enable new bondings. This interaction provides users with control over the Bluetooth bonding process. If the user chooses to enable new bondings, the software configures the Bluetooth bonding settings. It sets the appropriate input/output (I/O) capabilities for passkey authentication, such as display-only mode or keyboard-only mode, depending on system requirements.
Additionally, the software generates a random passkey, which is then displayed to the user for authentication purposes during the bonding process. It sets the passkey to be displayed using the configured I/O capabilities. To initiate device discovery and connection, the software enables Bluetooth advertisements. It creates an advertisement series and generates the required advertisement data to make the system discoverable and connectable.
In conclusion, this project successfully achieved its goal of developing a motor control system using a microcontroller and incorporating Bluetooth functionality. The hardware peripherals, including the motor driver, DC power jack, and capacitors, were carefully selected and configured to ensure optimal performance. The software implementation, particularly the Bluetooth stack initialization and bonding configuration, played a crucial role in enabling secure and user-friendly interaction with the system. Overall, the project demonstrates the successful integration of hardware and software components to achieve the desired functionality.
If I were to repeat this project, I would consider improving the user interface, error handling, and extended functionality. I would implement a more intuitive user interface to streamline the process of enabling new bondings and erasing existing bondings. As well as implement a robust error-handling mechanism to provide informative feedback to users in case of failures or issues during the bonding process. Finally, I would explore additional features, such as remote control capabilities or solenoid speed control to enhance the versatility of the system.