In this section, we will review the PCB (Printed Circuit Board) used in our STM32 brushed drone project. The PCB is the main component that holds all the necessary circuitry for the drone to function.
In the beginning of the video, you saw some prototyping pieces that have been damaged. These solder blocks will be set aside for now, and we will focus on the main drone and the Discovery Board. The Discovery Board is where the STM32 C86 chip is installed and will be used to program the drone.
Let’s take a closer look at our PCB. As a disclaimer, I must mention that I am new to SMD (Surface Mount Device) and not an expert in soldering. Therefore, there may be traces that have been ripped off during the soldering process. For example, the traces for the MPU650 chip had some issues, so I decided to use the NPUVISE safety module instead.
Mpu6050 Gyro Implementation
The MPU6050 Gyro is an important component in our drone project as it helps with the stabilization and control of the drone. However, in this particular PCB, there were some issues with the initialization of the MPU6050 chip via the I2C addresses. As a result, we have set it aside for now and will be using a different module.
Drain Connection Issue
Another issue we encountered during the PCB review was related to the drain connection of the gold mosfets. It was found that the drain of both mosfets was internally connected. This means that even if one gate of a mosfet is turned on, the other mosfet will source its current due to the drain connection. This issue needs to be resolved in order for the drone to function properly.
In this article, we will be discussing the process of building our own STM32 brushed drone. Specifically, we will be focusing on the PCB review and the implementation of the MPU6050 gyro with the STM32 microcontroller.
Mosfet and TP 4056 Charging Board
Let’s start by taking a look at the mosfet used in our project. It is a small component commonly found on the TP 4056 charging board, which we will be using to charge our drone’s batteries. The size of the mosfet is incredibly small and requires precise handling using tweezers.
Motor Control Solution
During the development process, I encountered a challenge with motor control. When I turned on one channel of the STM32’s PWM channel, both motors started spinning simultaneously. This was not the desired outcome for our project.
To address this issue, I came up with a solution. I designed a setup using two small 82, 05 mosfets, stacked on top of each other. This design allows for individual control of the motors. I snipped off the train and gate pin from the mosfet on the bottom layer of this stacked configuration to ensure proper functionality.
While this solution worked, it wasn’t ideal as I had exhausted my stock of mosfets and needed to order more compatible with our desired voltage levels. Unfortunately, this would take some time.
MPU6250 and User Interface
In addition to the mosfet challenge, I also discovered that the MPU6250 had an interrupt pin that I wasn’t utilizing. However, I found a new module that would work better for our needs and implemented it into our design. To enhance user interface capabilities, I decided to stack and solder a push button onto our PCB, providing users with a convenient control option.
This concludes Part 1 of our STM32 brushed drone project. In the next installment, we will delve further into the implementation process and explore additional components and functionalities.
The PCB for the STM32 brushed drone is under review. The software development for driving the MPU6050 and Elora module is still in progress. Once the MP6 is complete, the team will start working on this module and connect it with the PCB. The software being used is not built from scratch, but rather, the team is utilizing existing software.
MPU6050 Gyro Implementation
The back side of the PCB is fairly simple. It consists of the STM32 C8 T6 and F103 C86 microcontrollers. For wireless connectivity, the team is using a specific RF chip. Even though other RF chips can be used, the team decided to use the one they had available. The programming part of the software development is still in progress.
The stealing circuitry on the PCB is quite substantial. The team has disconnected the header, which means the chip is no longer connected to the testing process. Instead, they have designated a specific address for programming and flight control. The team is eagerly awaiting the arrival of the mosfets, which will be connected to the MPU650 and demonstrate how the software works. The I2C connections are also being established.
The team has carefully designed the mosfets for their drone. The drains of the two mosfets inside the same chip are connected to each other. This design choice was made to ensure optimal functionality and performance. The team believes that this design is unique and will contribute to the success of their drone project.
By continuously working on the software development and refining the PCB design, the team is confident in creating a functional and efficient STM32 brushed drone. Part 2 of this article series will delve into the software implementation and provide further details on the MPU6050 gyro usage with the STM32 microcontroller. Stay tuned for more updates on this exciting project!
Make Your Own STM32 Brushed Drone (Part 1) – PCB Review, MPU6050 Gyro Implementation with STM32
I recently discovered a mistake in my design that I hadn’t noticed before, but fortunately, it can be easily fixed. The issue was related to the compatibility of a certain component called si2302 CDs from Vicious Siliconics. This component has a lower gate to source voltage, which is crucial for my project. In the early stages, I attempted to use some beefier mosfets as a workaround, but I realized that ordering and soldering this specific component onto the PCB would be the ideal solution.
The PCB I will be using is a piece of board with a dotted pattern. I will solder two of these si2302 CDs components on either side of the motors, with the positive connection located on this PCB board. Thankfully, the compatibility issue has been resolved as these components are compatible with my project.
Once all the components are soldered onto the PCB, our drone starts to take shape. The wiring on the board is done using enamel copper wire, which you can see as small strands over the PCB. I apologize for not being able to record the entire process due to a glitch with my phone. Unfortunately, the recording was not saved properly. However, I assure you that I will try my best to document the whole process in a timely manner.
MPU6050 Gyro Implementation
The MPU6050 gyro module is placed on top of the PCB. Its footprint corresponds directly to one of our blank PCBs, making it easy to attach. The connections for the SCL and SDA are located near pins 13 and R12, respectively. Additionally, there is a CNSJA connection on this module, which is secured using double-sided adhesive.
The first step in making your own STM32 brushed drone is to review the printed circuit board (PCB). This is an essential component that ensures the proper functioning of the drone. By thoroughly examining the PCB, you can identify any potential issues or improvements that need to be made.
Mpu6050 Gyro Implementation
One of the key features of the drone is the implementation of the MPU6050 gyro. This gyro is responsible for measuring the drone’s orientation and tilt. By accurately measuring these parameters, the drone can maintain stability and navigate in the intended direction.
The STM32 microcontroller is the heart of the brushed drone. It controls and coordinates all the different components, ensuring smooth operation and responsiveness. With the STM32 in place, you can program and customize the drone to meet your specific requirements.
Connecting the Drone to a PC
To interface with the drone, a UART serial converter is used to establish a connection between the drone and a PC. This allows for data transfer and monitoring of the drone’s performance. By connecting the drone to a PC, you can analyze and control its movements more effectively.
Once the drone is connected and powered up, it enters the calibration process. This is an important step to ensure accurate readings from the MPU6050 gyro. It is crucial not to move the drone excessively during calibration, as this can affect the calibration results. The calibration process is indicated by the blinking LED, which changes to a solid white light once the calibration is complete.
After the drone is connected and calibrated, it’s time to analyze the data using the software on the PC. The software displays various graphs that represent the drone’s orientation, tilt, and other relevant parameters. By analyzing these graphs, you can gain valuable insights into the drone’s performance and make any necessary adjustments.
The PCB review, Mpu6050 gyro implementation, and Stm32 integration are crucial steps in the process of making your own STM32 brushed drone. By carefully examining and optimizing these components, you can ensure the drone’s smooth operation and maximize its performance. In the next part of this series, we will dive deeper into the software side and explore more functionalities and possibilities with the drone. Stay tuned!
The first step in making your own STM32 brushed drone is to review the printed circuit board (PCB). The PCB is a crucial component of any electronic device, as it provides the necessary connections and pathways for the various components to communicate with each other.
Mpu6050 Gyro Implementation with Stm32
Next, we will focus on the implementation of the MPU6050 gyro with the STM32 microcontroller. The MPU6050 gyro is a motion sensor that is commonly used in drones for measuring acceleration and rotation. It is a critical component that allows the drone to maintain stability and control.
Serial Oscilloscope Application
To demonstrate the functionality of the MPU6050 gyro, we will be using a serial oscilloscope application. Although this application may not be stable at the moment, it provides a visual representation of the accelerometer and gyroscope readings.
Accelerometer and Gyroscope Readings
In the serial oscilloscope application, we can observe the accelerometer and gyroscope readings on different channels. Channel one, two, three, and four to six are dedicated to displaying various accelerometer and gyroscope data.
The accelerometer readings indicate the movement and acceleration of the drone. By analyzing the accelerometer data on the blue line, we can observe the yaw movement. When the drone is moved in the yaw direction, the blue line shows the corresponding changes in acceleration.
On the other hand, the gyroscope readings provide information about the rotation and angular velocity of the drone. The red line represents the roll angle or the X value of the gyroscope on the X-axis. When the drone is rolled, the red line moves up and down, indicating the rate of change in angle.
Lastly, the pitch readings display the pitch angle or the Y value of the gyroscope. When the drone is pitched, the pitch readings show the changes in angle.
To test the stability of the drone, we can observe the values displayed on the serial oscilloscope. If the drone is kept stable, all the values should be close to zero, indicating that there is minimal movement or acceleration.
In order to begin building our own STM32 brushed drone, we first need to review the PCB (Printed Circuit Board) design. The PCB is an essential component that houses all the necessary electronics to control the drone and ensure its proper functioning.
The PCB design consists of various modules and circuits, including the MPU6050 Gyro implementation with STM32. This specific module is responsible for the measurement of yaw, pitch, and roll angles of the drone, which are crucial for its stability and control.
Upon inspection of the PCB, we can identify the different components and their placements. The MPU6050 Gyro, a vital sensor for measuring the drone’s orientation, is clearly visible on the board. It is essential to ensure that the placement of this sensor is accurate and secure to avoid any disturbances during flight.
MPU6050 Gyro Implementation with STM32
The MPU6050 Gyro plays a central role in the calibration and communication of the drone’s orientation data. The calibration process is necessary to ensure that the gyroscope provides accurate measurements and operates within an acceptable range.
Starting with the self-test of the TM2650, although not mandatory, it is recommended to ensure the integrity of the gyroscope chip during production. This step involves extracting the self-test values from the relevant register and shifting them to obtain precise accelerometer and gyroscope data.
Once the self-test values are obtained, we can proceed to find the factory calibrated values using a specific formula. By subtracting the self-test values from the factory test values and dividing them by the appropriate factors, we can determine the deviation from the calibrated values.
This calibration process is crucial to ensure the accuracy and reliability of the MPU6050 Gyro. It guarantees that the measured angles correspond closely to the actual yaw, pitch, and roll angles of the drone, allowing for precise control and stable flight.
In terms of communication, the STM32 microcontroller uses IC (Inter-Integrated Circuit) protocol to exchange data with the MPU6050 Gyro. This protocol ensures a reliable and efficient transfer of information between the microcontroller and the sensor.
By implementing the MPU6050 Gyro with the STM32 microcontroller and utilizing the IC communication protocol, we can achieve a robust and accurate drone control system.
When it comes to creating your own STM32 brushed drone, one of the most important aspects to consider is the design and layout of the printed circuit board (PCB). The PCB acts as the central hub where all the electronic components are connected, ensuring proper functionality and communication between different parts of the drone.
In order to ensure the quality and reliability of the PCB, it is crucial to review and analyze its design before proceeding with the manufacturing process. This includes checking for any deviations from the factory calibrated values, as well as identifying any potential faults or issues. By thoroughly reviewing the PCB, we can determine if it meets our requirements and if any modifications or adjustments are necessary.
Mpu6050 Gyro Implementation with Stm32
One of the key components in the STM32 brushed drone is the MPU6050 gyroscope. This sensor is responsible for detecting and measuring the drone’s orientation and movement, providing crucial data for stabilization and control purposes.
Before we can utilize the MPU6050 gyroscope, we need to initialize it properly. This is achieved by configuring the registers that control the power management and configuration settings of the gyroscope.
The first step is to set the clock select bit in the power management register. This determines the reference for the gyroscope and influences its accuracy and performance. By setting the appropriate value, we ensure that the gyroscope operates effectively.
The next step involves configuring the low pass filter settings in the configuration register. A low pass filter is a mechanism that allows signals with low frequencies to pass through while attenuating or blocking signals with higher frequencies. In the context of the accelerometer and gyroscope readings, implementing a low pass filter helps to smooth out any sudden or rapid changes in the data. This is important for ensuring that the drone’s movements are consistent and smooth.
By adjusting the DLP (Digital Low Pass) values in the configuration register, we can select the desired bandwidth and determine the amount of delay it introduces in the gyroscope output. This enables us to fine-tune the drone’s responsiveness and stability, aligning it with our desired flight characteristics.
Gyroscope and Accelerometer Configurations
Now let’s delve into the gyroscope and accelerometer configurations. We will take a look at the registers and how we can customize the settings. Starting with the accelerometer configuration, we can decide the full-scale range for the accelerometer. For now, we are setting it to zero. Moving on to the gyroscope, we are setting the full-scale range to eight, which corresponds to plus minus 2G or 500 degrees per second.
Signal Path Reset
The signal path reset register is responsible for resetting the output of the gyroscope and accelerometer resistors.
Calibration is the most crucial part of the process. Firstly, we need to calibrate our gyroscope. In order to do that, we start by reading the gyroscope measurements from a specific register called Gyroscope X, Out H. We then divide the readings to get the degrees per second value. After obtaining the value, we add it four thousand times to ensure accuracy. Once the values have been added, we take an average. This average value represents the net zero value or calibration value when the drone is not in motion. We store this calibration value in a data structure.
Using Calibration Data
In the functions that require gyroscope or accelerometer data, we subtract the calibration value from the readings. This adjustment ensures that our gyroscope code works effectively.
That concludes the discussion on the gyroscope and accelerometer configurations for the STM32 brushed drone. Thank you for watching and make sure to subscribe to our channel for more updates.
Although we have faced some challenges with the PCB, it is important to keep in mind that this is a learning experience. As we continue with the project, we will address these issues and find solutions to ensure the drone operates smoothly. In the next part of our series, we will delve further into the PCB design and explore other components that are crucial for our STM32 brushed drone.
In this article, we reviewed the PCB and discussed the implementation of the MPU6050 gyro with the STM32 microcontroller. We also explored the serial oscilloscope application and analyzed the accelerometer and gyroscope readings. Stay tuned for the next part of this series, where we will delve deeper into the construction of the brushed drone using STM32.
This first part of building our own STM32 brushed drone focused on reviewing the PCB design and understanding the implementation of the MPU6050 Gyro with STM32. The PCB serves as the foundation for the drone, housing all the necessary components and circuits.
The calibration of the MPU6050 Gyro is crucial for accurate measurement of yaw, pitch, and roll angles, ensuring stable flight and precise control. Additionally, the use of the IC communication protocol facilitates efficient data exchange between the microcontroller and the gyroscope.
In the next part of this series, we will delve deeper into the construction and assembly of the drone, exploring the integration of other essential components and subsystems.
In this first part of the “Make Your Own STM32 Brushed Drone” series, we focused on reviewing the PCB design and understanding the implementation of the MPU6050 gyroscope with the STM32 microcontroller. By ensuring the quality of the PCB design and properly initializing the gyroscope, we set the foundation for building a reliable and efficient brushed drone. In the next part of this series, we will delve deeper into the software aspects of the drone’s control system and explore the programming techniques used for flight control and maneuverability.