Visualizing Rotation Sensor via WebGL on a Raspberry Pi

MPU-6050 rotation sensor

There is a great article over at Raspberry Pi Tutorials. You may have to translate the language to read it if you cannot read German. Here is a link to the article on how to visualize the rotation of a sensor. I can imagine a lot of future applications being able to read the orientation of their equipment in situations where that could be crucial.

Visualize the MPU-6050 rotation sensor with WebGL on the Raspberry Pi

The Raspberry Pi is capable of many things, so rotation and acceleration values can easily be read out using a sensor such as the MPU-6050. The result, however, is simple numbers, which you will normally not imagine too much. However, it is very easy to visualize these numbers. This is easily done in modern browsers using WebGL, which can be used to render 2D and 3D objects in the browser.

To do this, we run a Node.JS web server on the Raspberry Pi, which both retrieves and visualizes the data. The sample code for this is attached at the end of the tutorial.

Visualize the MPU-6050 rotation sensor with WebGL on the Raspberry Pi

New version of Raspbian is now available

New distribution images for the Raspberry Pi operating system, Raspbian, are available. The latest version includes bug fixes, security updates, and new features.

Raspbian-only version.




NOOBS (Raspbian and More) version.




I have listed the patch notes below, and BOLDED the ones  found of interest:

  • In startup wizard, assign keyboard to a country as per Debian installer recommendations
  • In startup wizard, add an option to use US keyboard in preference to country-specific option
  • In startup wizard, show IP address on the first page
  • In startup wizard, check for existing wifi network connection and show it if there is one
  • In startup wizard, install language support packages for LibreOffice and other applications
  • In startup wizard, improve operation with keyboard only and no mouse
  • Password change in Raspberry Pi Configuration and startup wizard now works properly if passwords contain shell characters
  • Battery indicator plugin modified to cope with Pi-top hardware monitor crashing
  • Networking plugin hides wifi password characters by default
  • In Scratch 2 GPIO plugin, set pin from a dropdown list rather than free text
  • In Scratch 2 SenseHAT plugin, swap x and y-axis values for the LED array
  • Include the latest Adobe Flash player (
  • Include latest RealVNC Server (6.3.1)
  • Include libav-tools
  • Include ssh-import-id
  • Removed Mathematica¬†(made the download image smaller and can be installed later if the user needs it)
  • Merge in the latest third-party code for Bluetooth ALSA interface
  • Add ability to prevent software update changing configuration files, by creating ~/.config/.lock file
  • Various other small bug fixes, tweaks, and changes to text
  • Make dhcpcd work with 3G devices
  • Add hw acceleration to ffmpeg
  • Improved WiFi-BT coexistence parameters
  • Run fake-hwclock before systemd-fsck-root
  • Raspberry Pi PoE HAT support
  • Linux kernel 4.14.71
  • Raspberry Pi firmware 5b49caa17e91d0e64024380119ad739bb201c674

I installed the latest version of NOOBS today on my Raspberry Pi Zero WH with fantastic results. I will be installing everything on it like I have shown you in past videos and posts and expect one here very soon.