Category Archives: Arduino

9-Axis IMU LESSON 6: Determine Tilt From 3-axis Accelerometer

BNO055
Adafruit BNO055 9-axis Sensor Connected to an Arduino Nano

This lesson shows you some of the simple math, that will allow you to approximate tilt angle from a three axis accelerometer. In this entire series of lessons, we are using the BNO055 9-axis sensor connected to an Arduino Nano. It is possible to approximate tilt along the x-axis and tilt along the y-axis. These could roughly be considered to be like the Euler Angles of Pitch and Roll. It should be noted that the approximations are reasonable for tilt angles less than 45 degrees. Also note, that in this simple demonstration, real acceleration will be interpreted as tilt, hence the system will incorrectly interpret motion as tilt. Because of this, this approach should not be used on things like drones or other moving systems. It is just for simple demonstration purposes.

The code developed in the video above is included below for your convenience.

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how to work with this sensor in benchtop presentations.

 

Arduino Tutorial 28: Using a Pushbutton as a Toggle Switch

In lesson 27 we learned how to incorporate a pushbutton into an arduino project. We learned how to utilize pull-up and pull-down resistors in order to incorporate a button into a circuit. The operation of the button in lesson 27 was pretty simple . . . if the button was held down, the LED would come on. When the button was released, the LED would turn back off. This is an interesting demonstration, but much more interesting is the case where we make a toggle switch. If you press and release the button, the LED comes on, and then if you press and release the button again, the LED goes off. While this sounds very similar to the previous case, it turns out to require a lot more thought. This video lesson explains how to think about this problem, and how to make it work.

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

Below is the code we used to achieve the toggle operation. The video gives details on how to connect up the circuit.

 

9-Axis IMU LESSON 5: Calibrating the BNO055 9-axis Inertial Measurement Sensor

BNO055 IMU
Our 9-axis BNO055 9-axis sensor connected to our Aurduino Nano

In this lesson we show you how to get a clean calibration on your BNO055 9-axis sensorIn the video below we take you through the coded needed to calibrate the sensor, and a simple technique to quickly get the system properly calibrated.

The code developed in this video will be used in future lessons, and is included below:

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how to work with this sensor in benchtop presentations.

 

Arduino Tutorial 27: Understanding Pushbuttons and Pull Up and Pull Down Resistors

Being able to add push buttons to your projects adds important new capabilities to your prototypes. It is a clever way you can get input from a user. You could imagine using push buttons to turn something on or off, or they could be used to set motor speed or direction. In order to incorporate buttons into a project, you need to understand the concept of pull up and pull down resistors. In this tutorial we show you how to include buttons in a project, by demonstrating a simple on/off function on an LED.

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

This is the code we used in this project to switch the LED on and off.

 

9-Axis IMU LESSON 4: Plotting Serial Data from Arduino with Control of Axis Scale

As this project continues it is very important for us to be able to quickly and easily plot data streaming from the sensor. The Arduino Serial Plotter has some real limitations, we recommend a simple “Serial Plotter” tool that can be downloaded. In this video we take you step by step through the download and installation process, and then an overview of how to use the tool.