Setting up the BNO055 Absolute Orientation Sensor

Video Transcript

In this video, we’ll set up the Adafruit BNO055 Absolute Orientation Sensor from scratch, step-by-step.

The BNO055 is actually three sensors in one device. It includes an accelerometer to measure acceleration forces, a gyroscope that uses Earth’s gravity to help determine orientation, and a magnetometer that measures magnetism. Typical applications of this sensor include navigation, robotics, fitness, augmented reality, and tablet computers.

By the end of this video, you will have all of the hardware and software of the BNO055 sensor set up and ready to go so you can measure the roll, pitch, and yaw of an aerial electronic device, such as a drone.

Ok, let’s get started. Feel free to pause the video at any time as you follow along with me.

You will need:

To begin, get your BNO055 IMU board, the header strip, and the solderless breadboard. Lay them out on a table.

Prepare the header strip by cutting it to an appropriate length and placing it into the breadboard. You want a piece with 4 pins and a piece with 6 pins so that they can fit into the holes on the BNO055 board.
Place the long pins down into the solderless breadboard.

Next place the BNO055 board on top of the pins.

We will now solder all of the pins to the BNO055 in order to solidify electrical contact:

  • Gather all the materials presented earlier in the video, and lay them out on a table.
  • If you have safety glasses and latex gloves, put them on. Eyeglasses are fine.
  • Turn on the USB fan for ventilation, in order to avoid breathing in the soldering smoke.
  • Turn on the soldering iron to the 4 heat setting.
  • Lay your damp sponge in the center of the silicon mat.
  • Once the iron is hot, tin the tip by adding a little bit of solder to cover the tip.
  • Now wipe the tip off on the damp sponge to remove all but a thin layer of solder to help the tip last longer and to facilitate the transfer of heat from the soldering iron to the joint.
  • Place the tip of the soldering iron to the joint, where the header pin and board meet, to heat it up.
  • Feed a small amount of solder to the joint and remove the soldering iron after 2 seconds in order to not damage the board. Do this for all the pins in the BNO055.
  • OK, we are done soldering. With the soldering iron hot, wipe it off on a damp sponge.
  • Turn off the soldering iron and clean everything up.

With the BNO055 all cooled off, we need to wire the BNO055 to the Arduino Uno using the solderless breadboard. Here are the connections we need to make.

  • Connect Vin of the BNO055 to the power supply of 5V on the Arduino
  • Connect GND of the BNO055 to GND on the Arduino
  • Connect the SDA pin of the BNO055 to the SDA pin of the Arduino, which is A4.
  • Connect the SCL pin of the BNO055 to the SCL pin of the Arduino, which is A5.

Next, we attach the Arduino Uno to the USB port on our main desktop computer.

Now, on our desktop computer, we open Arduino.

We navigate to the Library manager and install two libraries:

  1. The Adafruit Unified Sensor system library to retrieve orientation data in a standard data format, and…
  2. The Adafruit_BNO055 driver, which supports reading raw sensor data.

Now, go to File -> Examples -> Adafruit BNO055, and click sensorapi. The Arduino sketch that pops up is a demo that will help us test the BNO055.

First double check the Arduino is properly connected to your desktop computer by going to Tools -> Port. Make sure the Arduino/Genuino Uno has a checkmark next to it.

Now, let’s run the demo. Save the sensorapi sketch, compile it by clicking the checkmark, and upload it to the Arduino by clicking the right arrow button.

Once it is finished uploading, open the Serial monitor by clicking the magnifying glass in the upper right corner. We see the x, y, and z orientation data flowing in real-time.

However, we want Roll, Pitch, Yaw data and not X, Y, Z. So we need to change X, Y, and Z to Roll, Pitch, Yaw.

I’m going to use this website to refresh myself what roll, pitch, and yaw are.

Yaw is movement from side to side. Like when you shake your head “no.”

Pitch is movement up and down. Like when you nod your head “yes.”

Roll is movement from left to right. Like when you tilt your head from side to side.

Ok, let’s start the sensorapi program up again and see what happens to the X, Y, and Z values when we move the BNO055 board around, in different orientations. The front of the BNO055 board is labeled BNO055. 

We rotate the BNO055 board around to 90 degrees yaw in the East direction. I see the X value changes. Then we roll the board to the right. The Z value changes. I then pitch the board by pointing the board straight up at the sky. The Y value changes.  So there we have it. Yaw is X, Roll is Z, and Pitch is Y.

We go to the sensorapi code and modify it accordingly so that we use the terms Yaw, Roll, and Pitch, instead of X, Z, and Y, respectively.

Let’s compile and upload the program again to make sure everything is working properly. Here is the output of the Serial monitor.

Ok. That completes this video. You are now ready to use your BNO055.

Setting up the Raspberry Pi 3 in 15 Minutes

Video Transcript

In this video, we’ll set up the Raspberry Pi 3 from scratch, step-by-step. By the end of this video, which will take no more than 15 minutes, you will have all of the hardware and software of the Raspberry Pi set up and ready to go, so you can begin building whatever you want: robots, a weather station, a smoke alarm, a home surveillance system, games and much more.

Ok, let’s get started. Feel free to pause the video at any time as you follow along with me.

You will need:

  • A USB keyboard and mouse. If all you have is a wireless keyboard and mouse that is OK.
  • You will also need a spare computer monitor or television with an HDMI port.
  • An HDMI cord.
  • A computer with Windows, Mac, or Linux.
  • And finally you will need a Raspberry Pi 3 starter kit. The one I’m using in this video is the Canakit Raspberry Pi 3 complete starter kit available from Amazon.

Step 1 – Open the Raspberry Pi Case

First, get your Raspberry Pi 3 kit and open it up. It should come in a small cardboard box. Take out all of the pieces and lay them out on the table.

Grab the plastic case for the Raspberry Pi. It should be inside the small white box that came with the kit. The case is made up of three separate plastic pieces. Stick your thumbs inside one of those notches and pull apart the pieces.

Step 2 – Add the Heat Sinks to the Development Board

Next, we are going to add the heat sinks to our development board. The development board is the green credit card sized board that comes inside the kit. This is your Raspberry Pi computer.

The heat sinks are those two silver square shaped pieces that also come with your kit. Heat sinks enable the Raspberry Pi to remain cool. Heat sinks also help extend the life of the Raspberry Pi by reducing the risk of hardware failure.

Peel off the sticky backing on the underside of the heat sinks. Place them on to the two black squares on your development board. After you do that, your board, should look like this.

Step 3 – Secure the Development Board Inside the Case

Now we are going to secure the Development Board inside the Case. Place your development board inside the bottom part of the black plastic Raspberry Pi case. It snaps into place. Get the middle portion of the case and snap it into place. Finally get the top part of the case and snap it into the middle portion of the case.

Step 4 – Insert the MicroSD card

Next, we need to insert the MicroSD card. Your MicroSD card comes preloaded with software to make the process of installing the operating system for Raspberry Pi much simpler.  

Find your MicroSD card. It should be inside a small plastic bag.

Slide the MicroSD card inside the small notch on the end of the case. Make sure it is in there nice and snug so that it doesn’t fall out.

Step 5 – Attach the Keyboard, Mouse, and Monitor

Next, we need to attach our USB keyboard and mouse as well as our spare computer monitor or television to the black case.

First, plug the keyboard into the USB port on the black case.

Next, plug in the mouse into the USB port on the black case. In this case I have a wireless mouse, so I will plug in the USB dongle to the back of the case.

Now get the HDMI cord. Plug it in to the back of the monitor, and then plug it in to the HDMI port of the board.

The mouse, keyboard, and monitor are now plugged in to the Raspberry Pi.

Step 6 – Power It Up

Next, we need to connect the Raspberry Pi to a power supply.

Get the power adapter and attach it to the back of the case and then plug it into the wall. Take a look at your monitor. Your Raspberry Pi should be powering up.

You will see a prompt to select Raspbian the recommended operating system for Raspberry Pi. Select it and then click “Install.”

Click “Yes” to confirm.

Wait a few minutes for the software to install.

Click OK at the prompt.

Your Raspberry Pi will now reboot to the desktop.

Step 7 – Configure the Settings

Next, we will configure the Raspberry Pi’s settings.

Go to the upper left part of the screen and click the Raspberry Pi icon. Go down to “Preferences” and then click “Raspberry Pi Configuration.” The Raspberry Pi Configuration window will pop up.

Go to the Localization tab. Click “Set Locale”, and select your language and your country. Then click OK.

Now we are going to set the time zone. Click “Set Timezone.” Set your Area and location. For example, I set my Area to America and set my location to Los Angeles. Then click OK.

Now, we are going to set the Wi-Fi country. Click “Set Wifi Country.” I am in the United States, so I will select United States. Click OK.

Now, we are going to change the password. Go to the System tab and click “Change Password.” Enter any password you would like. Confirm your new password. Click OK. Then click OK again.

Click “Yes” to reboot the Raspberry Pi so that all those changes you’ve just made take effect.

OK, we are at the Raspberry Pi desktop again. We now need to make sure that our Raspberry Pi is connected to the Wifi. In the upper right part of the screen, click the Wifi icon and find your Wifi network. Connect to it by typing in the Wifi password and clicking OK.

Step 8 – Get the Internal IP Address of Your Raspberry Pi

I would prefer to access my Raspberry Pi from my own laptop computer instead of the monitor setup I have currently. This way I can access my Raspberry Pi from anywhere in the world. In order to do that, I need to get the internal address of my Raspberry Pi and make some small changes to the settings. So let’s do that now.

Start a terminal session by clicking on the black terminal icon at the top left of the screen. Type the command hostname -I and press enter. You can see in my case, the IP address of my Raspberry Pi is 192.168.0.17. Write this number down on a piece of paper because you will need it later.

Now, close the terminal window and click on the Raspberry Pi icon in the upper left of the desktop. Go to Preferences and then Raspberry Pi Configuration.

Go over to Interfaces. We are now going to enable some of the common interfaces you are likely to use with your Raspberry Pi project. This includes SSH, SPI, I2C, and 1-Wire. Don’t worry about what those terms mean. Just click the enable button next to each and click OK. Click Yes to reboot.

Let’s start a terminal session again by clicking on the black terminal icon at the top left  of the screen. Type sudo raspi-config and press Enter. Go down to option 5 “Interfacing Options” and click Enter. Select VNC. Select Yes to enable the VNC Server. Click OK. Select Finish. Now in the terminal window, type sudo reboot and press Enter to restart the Raspberry Pi.

Step 9a – Connect From Your Personal Computer

Now, we need to download the software on our own personal computer so that we can connect to the Raspberry Pi remotely instead of using the mouse, HDMI monitor, and keyboard setup we have now.

For this step, you need to log on to your Windows, Mac, or Linux computer, open a web browser, and go to the website shown on the screen (https://www.realvnc.com/en/connect/download/viewer/).

Select your operating system and click “Download VNC Viewer.” Follow the instructions for downloading the software.

We’ve finished downloading the software and now need to open it up. On Windows, we can go to the Start Menu and click on “VNC Viewer.”

In the main VNC Viewer window, you need to enter the IP address of your Raspberry Pi so that you can connect to it. This was the number you wrote down on that piece of paper. The username will be pi and the password will be the password you chose for your Raspberry Pi back in Step 7.

If you see your Raspberry Pi’s desktop, congratulations. You can now connect to your Raspberry Pi from your own computer.

If your screen is a little fuzzy and hard to see, you can change the screen resolution. To do that, open the terminal window and type the command sudo raspi-config . Select “Advanced Options”. Select “Resolution” and choose your desired screen resolution. Select Finish to save the changes, and you can now close all the windows. You now have all you need to begin your desired Raspberry Pi projects.

Step 9b – Connect From Your Personal Computer

Some people prefer to control Raspberry Pi through a command line interface instead of the user friendly graphical interface we have now. If you want to do this, you need to download a software called PuTTY.  

Go to putty.org and download the installer for your machine. I am using a 64-bit Windows computer so that is what I will select.

Follow the instructions to download Putty. Once you’ve finished, open up Putty. If you’re using Windows, you can usually find it in the Start Menu.

The first thing you will do is type in the IP address of your Raspberry Pi. If you get a popup window, click “Yes” and then you will go to a black terminal window. Type in the username and password of your Raspberry Pi. The username will be pi and the password will be the password you chose in Step 7. That’s it. You’re logged in to your Raspberry Pi via the command line interface.

Step 10 – Congratulations

At this stage, you can go back to your USB keyboard, mouse, and HDMI monitor and shutdown your Raspberry Pi by clicking the Raspberry Pi icon in the top left of the desktop and clicking “Shutdown”.

Unplug the USB keyboard, mouse, and HDMI monitor and store them away somewhere if you like. You don’t need them anymore since you can connect to your Raspberry Pi from your own personal computer.

Plugging in your Raspberry Pi into any wall socket will restart it so that you can access it from your own personal computer.

Ok. That completes this video. You are now ready to use your Raspberry Pi to build projects. Thank you for watching and enjoy your Raspberry Pi!

Why I Love Robotics and Embedded Systems

“Joy for human beings lies in proper human work. And proper human work consists in acts of kindness to other human beings…” – Marcus Aurelius, Meditations, 8:26

I’ve spent the last 10 years on the business side of technology turning ideas into products that provide value to others. Last year, I began a Master’s degree in Computer Science in order to broaden my skill set. My focus is embedded software and robotics, and I love it.

I love it because I can help improve the lives of others by using modern technology to remove steps from common human activities. I love it because of the opportunities to help build the future, the products that will push the world forward and help us achieve what is currently not yet possible. I love it because of the opportunities to work with the technologies that will make the world a better place for this generation and future generations to come.

Robotics and embedded systems are the future, and I feel so fortunate to be alive right now. My goal is to help make the world a better place, one robot at a time.