Category Archives: Arduino

9-Axis IMU LESSON 11: Install Python

This is a quick lesson where we show you how to install Python on a Windows 10 machine. We have gone about as far as we can go on our 9-axis IMU project using only the arduino. What we want to do now is to pass the data we are taking from arduino to Python, and then use python to do animations and 3D renderings. So, to move forward, we will need to install Python, which is explained in the video.

Arduino Tutorial 33: Understanding How to Control Servos with a Joystick

In this lesson we show you how to precisely control the position of two servos using a joystick. We derive the math equations which will allow you to get smooth and precise control of the servo. We also add a buzzer to the project to create an audible alarm when the button the joystick is pressed.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. If you want a more stable and better quality servo, this is the one I user in more of my projects: HiTEC

Below is the code we developed in this project.

 

9-Axis IMU LESSON 10: Making a Tilt Compensated Compass with Arduino

In this lesson we show you how to build a demo tilt compensated compass using the BNO055 9-axis sensor.  We go through some trigonometry to help you understand conceptually how the device works.

To play along at home, you will need an Arduino Nano, and an Adafruit BNO055 Inertial Measurement Sensor.

The code below is provided for your convenience. It is intended only for bench top demos, and should not be used in real applications. Just for fun, not for drones, or other actual control applications.

 

Arduino Tutorial 32: Understanding and Using Joysticks in a Project

In this lesson we will explain how to hook up a Joystick. The easiest way to think of a joystick is to think of it as two independent potentiometer. Moving the joystick left and right changes one potentiometer, and moving the joystick up and down changes the other potentiometer. Also, pressing the knob on the joystick will activate a simple on/off switch. In this video we show you how to hook the joystick up, and then show you code that will allow you to read from the potentiometers and the switch.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. Heads up that in Lesson 33 we will be using a joystick to control two servos.  If you want to get ready for that lesson, go ahead and order your  HiTEC Servos.

This is the code that we developed in the video above.

 

9-Axis IMU LESSON 9: Accurate and Stable Tilt Using Accelerometers, Gyros and a Complimentary Filter

In this lesson we show how a complimentary filter can be used to create the best of both worlds in approximating tilt from data coming from the accelerometers and gyros. The goal of our complimentary filter is to weight our overall result to take advantage the short term accuracy of the gyro measurement, and combine it with the long term stability of the accelerometer. In effect the combination is applying a high pass filter to the gyro and a low pass filter to the accelerometer. Remember that the angles are approximate, and were developed assuming roll and pitch stay under 45 degrees. The trigonometry becomes more difficult when considering higher tilt angles.

To play along at home, you will need an Arduino Nano, and an Adafruit BNO055 Inertial Measurement Sensor.

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how a complimentary filter works. Of course, any real systems need to go into much more depth than the simple demo project below.