Our L293 based motor shield has some problems! How do we diagnose what the problem is and create a better design? Our first article in this series described how we designed our prototype UNO motor shield (Figure 1).

The second article explained how we wrote an Arduino library to use the shield.

This final tutorial (hopefully), will explain how we went about troubleshooting the issues and creating a better circuit to be used in version 2 of our design.

Figure 1. The Nexgen UNO Motor Shield (version 1.0)

The Problem

The issue we have with the current design, is that with the battery and motors connected, the Arduino 5V regulator switches…


At some stage you are going to write some code that you want to package up as a library. This makes it easy for you and others to use the software, hides complexity and is a way to participate in the global maker community. There are a few exisiting guides about how to do this, we have focussed on material not covered by these beginner tutorials. A library is a collection of header (.h) and optional program (.cpp) files located in a single directory.

Sketch First

Start with a working sketch, don’t write the library until you know that your code works…


The Nexgen Rover

The Nexgen Rover is an Arduino based robot designed wholly by Nexgen Codecamp Pty Ltd. It is used in our technology related STEM courses aimed at high schools. The robot is based on Arduino technology and runs an Arduino UNO with a motor controller shield on top. This article explains how we designed and manufactured our own motor shield to suit the requirements of our rover.

The Motors

To drive the tracks on the robot we are using two 12V DC motors. To be more specific, we are using the model 33GB-520–18.7 from DOIT.AM (Figure 1).


The evolution of open-source flight control firmware is fascinating and involves everything from years of committed development with no reward, to convoluted betrayal from previous partners and friends. In this article, we will review the most popular open-source projects, explain their antecedents and highlight the survivors.

  1. The Flight Control Ecosystem

These days the hardest challenge in designing your own drone is the flight control firmware. For those who can’t be bothered spending the months and years crafting this code, there are other options, albeit not much targeting the Arduino platform. Most available flight controller firmware tends to target a niche…


Why is it so hard to upgrade a sticker app that has literally no code?

In December 2019 I wrote an article about Unnecessary Forced “App” Updates. TLDR — around this time, Apple started deleting apps which didn’t conform to App Store Review Guidelines, in other words apps that hadn’t been recently updated.

I don’t have a problem with this policy but I do have a big problem with things changing outside my control and making the upgrade process a nightmare.

There are normally two things that go wrong. The first is the arcane code signing process. …


The Importance of Motor Direction

In order to stop our drone spinning like a top, it is important that the four motors turn in a particular direction. As shown in figure 1, we want the motors to alternate spinning clock wise and counter clockwise. This arrangement causes the torque from the spinning motors to cancel out and the quad only yaws when we want it to.

Figure 1. Required Motor Directions for the Magpie Drone.

We wired up all our motors to the RacerStar Quad ESC in the same way as we assumed that the default arrangement would give us the correct spin direction. It doesn’t. Two diagonally opposed motors are spinning in the…


What’s Next?

In Part 3 of our series on writing your own flight controller software, we looked at PID control and what that consists of. When writing complex software, it is usually easier to break it down into smaller parts which you can test independantly. Our path to functioning flight control firmware on an Arduino looks like this:

  1. Pilot input (i.e. decoding SBUS);
  2. Gyroscope output;
  3. PID control loops; and
  4. Motor mixing and motor output.

Our next challenge is part 3, feeding the error signal e(t) for roll and pitch into our PID loop and then outputting a corresponding PWM control signal to…


The PID Loop

In Part 1 of our series we spoke about the flight controller PID Loop. It is worth revisting that now (see Figure 1). In previous parts we have spoken about how we decode the remote control input, r(t), and how we generate our PWM control for the ESC, u(t). In Part 3, we will look at the roll, pitch and yaw inputs from the IMU and combining that with r(t) to get our error signal , e(t), which is fed into our PID loop. …


For the Arduino Portenta H7.

The Story So Far…

Figure 1. The initial prototype of the Nexgen Drone.

As described in Part 1 of our series, we are designing a drone using the new Arduino Portenta H7 as a flight controller. Our intention is to port BetaFlight across to the STM32H747 microprocessor as the flight controller firmware.

We have modified the BetaFlight firmware so that it compiles for the H7. The next step is to load the firmware into memory and tell the processor where the first instruction is located.

David Such

Reefwing Software · Engineer · iOS & Android Development · Robotics · Drones #Arduino #RaspberryPi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store