Monthly Archives: April 2021

Video from content creator Curio Res: How to control a DC motor with encoder

via Pololu Blog


Content creator Curio Res recently released a tutorial and accompanying video explaining how to control a DC motor with an encoder. The video and post cover how to set up a motor with encoder, a controller, and a motor driver and how to read encoder signals. They also address common questions we get from customers who want to add closed-loop feedback to their projects such as how to implement a PID algorithm to control the position of the motor shaft based on the encoder readings. The content is well explained, and the diagrams and motion graphics make everything easy to follow and understand.

The tutorial uses one of our 37D Metal Gearmotors and our TB67H420FTG Motor Driver Carrier. The tutorial also uses an Arduino Uno, but one of our A-Star 32U4 Primes could be used instead.

If you like Curio Res’s content, be sure to subscribe to their YouTube channel so you don’t miss their latest videos. We look forward to seeing more great tutorials from Curio Res!

Building a low-cost flow meter for river studies

via Arduino Blog

Scientific equipment is notoriously expensive, and for schools, there are often monopolies on which suppliers can provide it. Eben Farnworth wanted to do something about this problem. His design for an open flow meter only costs around $60 USD, which pales in comparison to the typical price tag of $1,000.  

Flow meters are great tools to measure how quickly a liquid (typically water or air) passes through a certain area. By using a propeller inside of an enclosure with a known diameter, the amount of liquid per unit of time can be calculated, along with how fast it is going. Farnworth’s design employs a DN80 water sensor, an Arduino Uno, and a 2.4″ TFT touchscreen.

The case houses all the electronics plus a battery for power. Then at the bottom of the device is a port for plugging in the flow sensor itself. After a bit of calibration, Farnworth was able to get the display to show the flow of a river with impressive accuracy.

To read more about how this flow meter was engineered, check out Farnworth’s project write-up.

The post Building a low-cost flow meter for river studies appeared first on Arduino Blog.

Arduino-controlled gas mixing device fills DIY laser tubes

via Arduino Blog

Lasers come in two varieties: solid-state and gas tube. As the name suggests, the latter types contain gas. That is a mixture of gas in precise proportions. To fill his DIY laser tube, Cranktown City built an Arduino-controlled gas mixer.

This device has an Arduino Uno board that drives three relay modules. The first relay switches power to a gas pump, the second relay controls an output valve, and the third relay controls an input valve. A push button starts the pumping process. The pump turns on and the input valve opens. Gas from a storage tank is pumped into an inflatable bag. Once the bag is full, as detected by a limit switch, the two valves flip and the gas pumps into the laser tube.

Cranktown City knows the exact volume of the inflatable bag, so he knows how much gas has been pumped into the laser tube each time the device runs. Like mixing a cocktail, this lets him “pour” each part of the gas mixture into the laser tube until he ends up with the correct proportions.

The gas pump, Arduino, relays, and inflatable bag are all enclosed within a heavy duty case made from steel sheet cut on a plasma table. The resulting mixer is portable and robust enough to stand up to abuse of a shop environment. With this device, Cranktown City can continue with developing his DIY laser tube — a project we can’t wait to see completed.

The post Arduino-controlled gas mixing device fills DIY laser tubes appeared first on Arduino Blog.

Playing Connect Four against a mini-golfing AI opponent

via Arduino Blog

Have you dreamed of combining the two incredible activities mini-golf and Connect Four together into the same game? Well one daring maker set out to do just that. Bithead’s innovative design involves a mini-golf surface with seven holes at the end corresponding to the columns. The system can keep track of where each golf ball is with an array of 42 color sensors that are each connected to one of seven I2C multiplexers, all leading to a single Arduino Uno

The player can select from six distinct levels of AI, all the way from random shots in the dark to Q Learning, which records previous game-winning moves to improve how it plays over time. It can putt by first loading a golf ball into a chamber and then spinning up a pair of high-RPM motors that launch it. For the human player, there is a pair of dispensers on the left that give the correct color of ball. 

The entire system runs on an Intel NUC that hosts the game which was written in C#. There’s a large 22″ touchscreen at the front that is mounted at eye-level for easy interactions. Although it took Bithead nearly 18 months and $3,500, the end result is spectacular.

Be sure to check out his great write-up, which has a couple of demonstration videos and a build log. 

The post Playing Connect Four against a mini-golfing AI opponent appeared first on Arduino Blog.

Arduino Mbed Core for RP2040 Boards

via Arduino Blog

Arduino support for the Raspberry Pi RP2040 chip is available now using the official Arduino Mbed Core. This is obviously very important, and exciting, for the upcoming Arduino Nano RP2040 Connect. But it goes beyond the Arduino device to also bring support to other boards built around the RP2040 chip.

Arduino Core and Mbed OS

Arduino is no stranger to Mbed OS. It’s a hugely important platform and operating system in the IoT space. This is due toits support for Cortex-M microcontrollers and its real-time operating system capabilities. So a lot of work was done when Mbed OS was adopted for the Nano 33 BLE and Nano 33 BLE Sense devices. Since all Mbed infrastructure and drivers were in place, we could easily support all new Arduino boards with minimal effort. Including new ones like the Portenta H7 and Nano RP2040 Connect.

Arduino Mbed Core for RP2040

This makes the Arduino Core plug-and-play, and an easy choice for getting your devices up and running quickly. We provide two cores; one for our Nano RP2040 Connect board, and one for other RP2040-based boards, including the Raspberry Pi Pico. As the core is based on Mbed OS you can choose between using the Arduino’s API or Mbed’s.

If you’d like to support any other RP2040 board with its custom features you can do so. It requires very little effort by cloning and tweaking the Arduino Mbed Core.

Ready for the Nano RP2040 Connect

All Arduino APIs are standardized, which means they can be used on all boards. If you have a sketch for your Nano 33 BLE, you can now upload it to a Nano RP2040 Connect and run it without making any changes.

In effect this means you can create sketches for the new Arduino board, even if you don’t have your hands on it yet. It also makes project upgrades very easy. Nor does the Arduino Core require a custom bootloader for RP2040 devices, as it uses the ROM-based bootloader from Raspberry Pi.

Check out the Arduino Core Mbed right here. And sign up to our Nano RP2040 Connect contact list for more news as it happens.

The post Arduino Mbed Core for RP2040 Boards appeared first on Arduino Blog.

Allen Pan’s Arduino-controlled microwave only works while gaming

via Arduino Blog

Microwave ovens have been the peak of convenient cooking since the 1960s, and nobody appreciates that convenience more than gamers. Normally you would microwave some pizza rolls between Call of Duty death matches, but Allen Pan decided to make gaming a more integral part of the cooking process for his most recent project.

This is a microwave oven that will only cook food while an attached game console is in use. That console is a generic all-in-one handheld with many built-in games, most of which are knock-offs or in the public domain. If a Hot Pocket requires three minutes of microwave cooking, then Pan has to play one of those games for a full three minutes or risk biting into an icy center.

Pan used an Arduino Uno board to monitor a microphone placed in front of the console’s speaker. The console only outputs audio while a game is in play, so this was a reliable way to determine if the user is actively playing or if they have walked away.

If the Arduino detects sound, then it will turn on a relay in the microwave oven. Pan hardwired the microwave oven so that any time it receives power, the microwave emitter will run. All Pan needs to do is pop some food in the microwave and start playing a game. So long as his thumbs don’t get tired, he can heat up whatever treat he craves.

The post Allen Pan’s Arduino-controlled microwave only works while gaming appeared first on Arduino Blog.