🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
#3D MODELING #ACCELEROMETER #FUSION MODE #GYROSCOPE #HARDWARE #LSM6DS3 #OPEN-SOURCE #PCB

You can watch a full video version with more details here.

In my latest hardware test, I’ve been putting the LSM6DS3 accelerometer and gyroscope through their paces on my custom board. If you spotted the small LED fix in the corner, that’s from my previous ninja repair—go check that video out if you missed it. The blue LED now proudly indicates our BLE connection to the web interface I built.

Ninja repair and working LED!

The accelerometer mode works well for detecting pitch and roll, but not yaw, due to its reliance on gravity. Rotating around the Z-axis yields no change, and certain orientations can confuse the readings.

Accelerometer axis

Switching to gyroscope mode gives smooth, real-time rotational data. We take the angular velocities reported by the device and integrate them over time to get the absolute rotation.

Gyroscope axis

The downside? Over time, small errors accumulate, so the orientation can drift.

The board is flat - but we’ve accumulated errors…

That’s where fusion mode comes in—combining accelerometer and gyroscope data to deliver more stable results. It’s not perfect, but drift is greatly reduced, and the board consistently returns to a flat reading after movement.

Fusion - combine the accelerometer and gyroscope readins

I’m using this library in my code. It seems to work pretty well.

Interestingly, the sensor readings are sensitive to temperature changes, which can introduce minor drift. Adding a magnetometer could improve accuracy even further, so that’s on my future to-do list.

3D Model Fun

The web app lets you load and manipulate any 3D model—yes, including a teapot!

I'm a teapot

To load your own PCB model, export a .glb file from KiCad, upload it, and watch your PCB spin in real time.

Open Source Firmware

All the code is on GitHub and easy to adapt—just set your I²C pins and sensor address, and you’re good to go.

// Hardware constants  
#define I2C_SDA 7  
#define I2C_SCL 15  
// LSM6DS3 I2C address - choose between 0x6A and 0x6B - most boards use 0x6A  
#define LSM6DS3_I2C_ADDR 0x6B

It works over BLE or Web Serial, streaming JSON data with accelerometer, gyro, temperature, and fused values.

Check it out, try it with your own boards, and feel free to contribute improvements.

#3D MODELING #ACCELEROMETER #FUSION MODE #GYROSCOPE #HARDWARE #LSM6DS3 #OPEN-SOURCE #PCB

Related Posts

Vibing a PCB - surprisingly good - In my latest adventure, I challenged AI to design a working ESP32-S3 development board from scratch using Atopile and Claude. The idea was as simple as vibe-coding actual hardware without diving into the code. It was a chaotic yet fascinating journey, with some misses like unwired components and a forgotten capacitor. After a few prompts, the AI delivered a surprisingly functional board featuring USB-C, an AMS1117 regulator, and status LEDs. While not yet perfect, vibe-coding feels like a glimpse into the future of hardware design.

Related Videos

I Made a Digital Twin for my PCB - IMU Visualiser - Hey everyone! In this video, I’m diving into testing the cool functionality of my new board that I designed, and demonstrating how to use both an accelerometer and gyroscope with my favorite little tool. The board is rocking an LSM 6DS3 sensor, which works like a charm, despite the tiny LED snafu from before (watch my 'ninja repair' in the previous video, haha). I walk through the different modes, including a fusion mode that magically blends sensor data for accuracy. Also, there's some cool 3D modeling in play where you can bring any model to life on my public website – yes, even a teapot! Plus, it's all open source on GitHub, ready for you to get hands-on and maybe even add your enhancements. Enjoy!
High-Res AS5048 Magnetic Rotary Encoder DIY - Learn how to create a custom magnetic rotary encoder using an AS5048 sensor and a 3D printed enclosure, greatly improving the accuracy and gameplay of an Asteroids game controller.
ESP32-S3 - Which Pins Are Safe To Use? - In this video, I've decided to dive deep into the ESP32-S3, a module ruling my lab recently due to its plug-in-and-play functionality, and the flexibility offered by its GPIO matrix. However, working with it requires vigilance, especially with regard to the strapping pins and USB data pins, among others. Discovering such quirks, I've encountered unexpected values, short glitches and the occasional code crash. To help you avoid these bumps, I've documented everything I've learned on my GitHub repo, where I'm inviting you, my fellow makers and engineers, to contribute your valuable experiences and findings. After a minor hiccup with my ESP32-TV, expect an updated PCB design, courtesy of PCBWay. Explore the ESP32-S3 with me, and let's unravel its secrets together, one pull request at a time.
Lovely High Res E-Paper Display - Just when we thought we'd done with our mailbag, some exciting new stuff tips up. This time, we've got a soldering kit, a fun-looking Dash, and extra bonus, an ink plate 10, which is a cool e-paper display from Soldered. We've unboxed it, pulling out a board with an esp32 module, an SD card, and a battery connector. One of the major selling points is its open-source nature, you can download all the schematics from GitHub, and for those inclined, learn about how to build pcbs. Also showcased a Simon Says game soldering kit, despite my modest soldering skills (we all need practice, eh?), it turned out to be good fun. Plus, we've got a Dev board fitted with an at Mega 328p and an ultra-bright ws2812 RGB LED. Let's see if I can turn this e-paper display into a weather display or maybe you have more exciting ideas, drop them down in the comments!
We weren't really going for speed - but this gets quite fast... - Discover the process of sorting out issues with open loop mode and vibrations in 3D printers, while learning how to make the most out of leftover proof of concepts.
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening


Published

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts