

- DIY PROTRACTOR INSTALL
- DIY PROTRACTOR DRIVER
- DIY PROTRACTOR FULL
- DIY PROTRACTOR CODE
- DIY PROTRACTOR DOWNLOAD
Put your compass on reference plane and move it to the target plane to measure the angle between two surfaces.A customer from distillery cooperage contacted me. You can move the Gyro sensor and get the angles of X,Y and Z coordinates. Connection.Ĭongrats! We have completed our project. Let’s start Connection: ConnectionĬonnect all the components as illustrated in Fig 10.
DIY PROTRACTOR DOWNLOAD
To download this code, refer the link given at the bottom this page You can make it display on the OLED screen, use keyword “oled.print(text to print)” (Refer Fig. Fig 8 Arduino codeĪfter this, we will now create a loop function and try to get the angle movement of MPU 6050 using keyword “getAngleX”. In the first part of coding, we will add MPU6050 and OLED Library and then create a setup function as in Fig 8. ComponentsĪs we have collected the components, we can now start coding. To make the digital compass with MPU6050, we need to gather the following components. How about making another one with MPU 6050? This one may be more interesting because it tells the angle of all 3 coordinates (X,Y,Z) at the same time. We just made a digital compass with stepper motor. Digital angle measuring Compass with MPU 6050 gyro sensor

You can also use it to draw arc and angle on any Engineering drawing sheets. You just press one switch and match the stepper arrow with reference to the surface of the structure and the OLED display will show you the angle measurement. You can measure the angle of any structure with this digital tool.

If you press the other switch, the stepper will start moving in other direction and the OLED will show the angle moved in that direction. When we press the switch, the stepper motor arrow will start moving and at the same the OLED display will show the angle moved by the stepper motor.
DIY PROTRACTOR DRIVER
7 Connection TestingĬrosscheck every connection, as any mistake might fry your costly components.Īfter checking all connections, power the Arduino and motor driver module. Connection:Ĭonnect all the components as stated below or Refer Fig. Here in this demonstration, my stepper motor takes nearly 510 steps to complete one rotation.
DIY PROTRACTOR FULL
In order to map the value of stepper motor, we need to know the max number of steps it takes to complete one full rotation, this depend on the resolution of our stepper motor.
DIY PROTRACTOR CODE
The magic happens here! When we put this above part of code in loop function, the steps automatically get converted into angle. Map (min steps, max step, min angle, max angle) This is how the steps of motor are calculated.Īfter this, we need to convert the steps of motor into angle by using a map. In this way, each time the motor moves a step, the number of steps automatically get added. This value is assigned to another variable named “previous”, so the previous value is now 1 and when the motor moves another step the new value becomes previous value + 1. When the motor moves one step, then its value will change to 0+1. Suppose the initial value of the step variable is zero. Are you still confused? Let me explain it in simple words. To do so, I have created a step variable that will store the previous value of stepper motor and go on adding one by one as the motor moves. To measure the angle, we have to calculate the steps moved by the motor. When if () condition in code says true, stepper motor moves one step and stays there until the condition turns false (which happens when the switch is not pressed). Next, we will create a loop function, where we will include ‘if () condition’ to check the state of the push button. Arduino CodeĪfter this we will create a setup () function as described in Fig.5. Installing Mpu6050 LibraryĪs the required library has been installed now, we can start coding.įirst, we will add the required library and declare the variables needed to store different values according to code snippet below (Fig. You can download the whole code from the link given at the end of this page.
DIY PROTRACTOR INSTALL
After successful installation, search for Stepper Motor and then install the “28BYJ stepper motor “library as in (Fig. For this, go to library manager and search “MPU6050 Tocken” and install the library. Now, I’m going to show you both the methods here.įirst method – Digital Compass Using Stepper Motor:įor this DIY project, we need the following components: Components:įirst, we will set up libraries to Arduino IDE. When this idea struck my mind, I came up with two different methods to make the digital compass – first converting the MPU6050 gyro sensor data into angle, and second by converting stepper motor rotation into angle. Here I will demonstrate the making of a DIY prototype. So, I thought of developing a digital compass to make the work a bit easier.
