Posts | Comments

Planet Arduino

Archive for the ‘MPU-6050’ Category

We enjoy access to cheap stuff because of the mass market for things like mice, keyboards, and cell phones. But if you need a device that doesn’t have mass appeal, you will have to pay a lot more if you can find it at all. However, with modern techniques like 3D printing and Arduino-like microcontrollers being cheap and simple to use, you now have the option to build that special one-of-a-kind device. Case in point: [Davy’s] mouse for people who have brain or nervous system disorders. This particular device is helping a 6-year-old who can’t manipulate a normal mouse.

The device uses an Arduino Pro and an MPU-6050 accelerometer and gyroscope. The original design uses machined aluminum, but 3D printing should work, too. There’s something wrong with the link to the design files in the post, but it is easy to find the correct link.

If you do 3D print a similar enclosure, you might consider using heat-set threaded inserts instead of tapping the holes. They work great, are easy to install, and seem to be a bit more robust than trying to thread plastic. Then again, threaded plastic isn’t as bad as you might think.

There are, of course, many ways you could make this work, and besides, every special user will be a little different. But what a great feeling to help someone be able to do what most people take for granted.

A self-balancing robot isn’t a new idea, but we liked the aesthetics of [Maker ATOM’s] build. The use of a breadboard and a printed bracket looks good, as you can see in the video, below.

Like most first-time projects, though, there were some lessons learned. The power supply needs a little work and the range of balance compliance didn’t meet expectations. But those problems are soluble and, as usual, you often learn more from working through issues like these.

The heart of the system is an MPU6050 which provides a gyroscope and accelerometer along with fusion capability onboard. The availability of libraries for the sensor and the PID controller makes the project pretty simple to finish.

In particular, a PID control loop looks at the desired state of the system and the current state. It then computes an output based on the difference in state at the current time and over time in different ways. In other words, part of the output forms because of the raw difference but other parts of the output form due to accumulated error over time or from sudden perturbations. Adjusting the gains so that these parts stay in balance can be a bit tricky.

However, in the end, the two batteries were not sufficient to power the device adequately. Temporarily, a bench supply did the trick, but the batteries still needed to be there to provide some counterweights for balance. Experimenting wth some PID loop gains might also improve operations.

There are plenty of similar projects to draw inspiration from. The design doesn’t have to be difficult.

Stecchino demo by the creator

Self-described “Inventor Dad” [pepelepoisson]’s project is called Stecchino (English translation link here) and it’s an Arduino-based physical balancing game that aims to be intuitive to use and play for all ages. Using the Stecchino (‘toothpick’ in Italian) consists of balancing the device on your hand and trying to keep it upright for as long as possible. The LED strip fills up as time passes, and it keeps records of high scores. It was specifically designed to be instantly understood and simple to use by people of all ages, and we think it has succeeded in this brilliantly.

To sense orientation and movement, Stecchino uses an MPU-6050 gyro and accelerometer board. An RGB LED strip gives feedback, and it includes a small li-po cell and charger board for easy recharging via USB. The enclosure is made from a few layers of laser-cut and laser-engraved material that also holds the components in place. The WS2828B LED strip used is technically a 5 V unit, but [pepelepoisson] found that feeding them direct from the 3.7 V cell works just fine; it’s not until the cell drops to about three volts that things start to glitch out. All source code and design files are on GitHub.

Games are great, and the wonderful options available to people today allow for all kinds of interesting experimentation like a blind version of tag, or putting new twists on old classics like testing speed instead of strength.

A delightful version of a clever one-dimensional game has been made by [Critters] which he calls TWANG! because the joystick is made from a spring doorstop with an accelerometer in the tip. The game itself is played out on an RGB LED strip. As a result, the game world, the player, goal, and enemies are all represented on a single line of LEDs.

How can a dungeon crawler game be represented in 1D, and how is this unusual game played? The goal is for the player (a green dot) to reach the goal (a blue dot) to advance to the next level. Making this more difficult are enemies (red dots) which move in different ways. The joystick is moved left or right to advance the player’s blue dot left or right, and the player can attack with a “twang” motion of the joystick, which eliminates nearby enemies. By playing with brightness and color, a surprising amount of gameplay can be jammed into a one-dimensional display!

Code for TWANG! is on github and models for 3D printing the physical pieces are on Thingiverse. The video (embedded below) focuses mainly on the development process, but does have the gameplay elements explained as well and demonstrates some slick animations and sharp feedback.

Using a spring doorstop as a controller is neat as heck as well as intuitive, but possibly not quite as intuitive as using an actual car as a video game controller.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook