Category Archives: Electronics

Balancing robot part 3 – Remote control

I made a new version of the mainboard in the balancing robot, fixing all the problems with the previous one. I also got the prototype of the remote controller working. It is sending the X and Y values of the control stick to the robot. The robot is then adjusting its speed setpoint and turning variable based on those values.

The RC input probably needs some filtering. Now I just use the values directly, and if the user does to fast movements there is a risk that the robot falls over.

I am not satisfied with the remote yet. The biggest problem is the controls sticks I chose to use. They are really bad since only a small part around the center of each axis can be used as shown in the video. This makes it hard to control the robot with precision. I will probably redesign the remote to use a real control stick from an RC controller instead.

I have also planned to make the user interface on the remote for adjusting PID values and other parameters in the robot. This is the main reason why it has a display. More about that in a future video.

I have also installed two ultrasonic rangefinder sensors. They will be used for obstacle avoidance in the future, but I will finish the remote controller first.

Prototyping and testing of the balancing robot

Made some progress on the balancing robot project. In this video, I made the first version of the PCB. It had a few problems but I still got the robot to balance. Some of the problems included:

  • Design error with the voltage divider and filter capacitor for the battery voltage measuring. Capacitor blew up 🙂
  • I forgot to connect the MISO, MOSI and SCK lines for the SPI bus.
  • Problem with the fotprint for the wireless module.
  • And a few more minior things…

Apparently, I need to check everything more carefully. Especially with the schematic, before I start to design the PCB itself. I hade also learned from many previous PCB projects that I have made, including this one, that you always need to create important/special component footprints yourself. Comunity-made footprints always have some errors, or something just decisions that I don’t like/want. Enev official footprints for components can have major problems.

In this video, I also show some of my planning of the remote controller for this robot. It will be a custom remote controller with an LCD and two analog control sticks. The controller should be able to control the robot, maybe in different ways. It will also have some kind of menu system for making adjustments to PID values and other settings.

Robot balancing by itself. The battery is just laying there on top. The robot will of course have a top plate for the battery when it is done.
Detailed shot of the first version of the PCB. Here you can also see the wires I had to solder on the connect the PIS bus for the IMU sensor.

Happy New Year!

Here is a compilation of some of my videos/projects from the past year. Plans for 2022 are to continue to make projects I find interesting. Everything from electronics to RC stuff. I will probably start the year by working on and finishing the new balancing robot.

I want to experiment more with ArduPilot also, making a multicopter platform for some experiments, and also ground rovers or maybe a boat.

Maybe I will also experiment with some new content on my YouTube channel. New video formats/video ideas etc.

Maybe I will also post some game-development-related stuff in the coming year. It was a few years since last I posted such things. But a have actually made some stuff that I have not shared. Including a DIY Unity-based RC plane simulator.

DIY FrSky telemetry multi-sensor

I made my own “multi-sensor” for the FrSky radio system. An Arduino Nano reads a few different sensors and sends all the data to the Smart-Port connector on the RC receiver. This way I can get information such as battery voltage, speed, altitude, GPS position, and temperatures on my RC Radio when I fly my RC planes. This is perfect for planes that don’t have a flight controller onboard.

My design and hardware is based on the FrSky library from Pawelsky: https://www.rcgroups.com/forums/showthread.php?2245978-FrSky-S-Port-telemetry-library-easy-to-use-and-configurable

I actually started experimenting with making my own telemetry sensors a few years ago. Therefore my code is actually quite old. Back then, this was the only library available. I still think it works well, but today there are also other alternatives available.

At first, I just soldered a GPS and a servo connector to an Arduino NANO. But later I made a few PCBs to make them easier to assemble. My first versions had voltage monitoring of the individual cells in the flight battery, but I found that it was annoying having to plug in the balance connector of the battery in the plane.

This is my third iteration of the board. It has a single input for LiPo battery voltage monitoring with a voltage divider and filter capacitor, a BMP280 barometer for altitude and variometer measurements, a connection for a Beitian BN-220 GPS or any other NEMA capable GPS for speed and position data, and two Dallas DS18B20 temperature sensors, one onboard and one attached with cables.

Update 2022-01-07: I fixed an error in the PCB design and made a few small adjustments in the code. The links are now the updated versions.

Link to my schematic and PCB: https://oshwlab.com/Axbri/frsky-telemetry-v3

Download link for my code, schematic and PCB gerber-files:
Axels FrSky tememetry sensor V4.zip

I built a CNC machine

Mostly designed to make parts for RC planes from balsa wood and thin plywood. But of course, the machine can be used for other stuff as well.

Here is a page with more info about the machine: DIY mini CNC router

Here is an overview video that also shows the machining of some test parts.

In this video, I am making a few simple parts that will be used in the wing of an RC plane.

DIY 5 volt regulator for RC models

I made my own redundant BEC module for RC models. It takes full battery voltage (usually 4 or 6 lithium cells in my case) and regulates it down to around 5 volts to power servos and other electronics.

My design uses two separate LM2576 switching regulators that power the output through diodes to isolate them. I also have an extra output filter to minimize ripple and voltage spikes. My goal with this project was to create something that is more heavy-duty and reliable than most cheap BEC modules for RC models you can buy.

EasyEDA Schematic and PCB design: https://easyeda.com/Axbri/rc-model-redundant-bec-v2

Making LED light systems for RC planes

I have been experimenting with making my own LED light systems for RC planes for a while now. I first made my “RC plane hub” for one of my planes in 2019. It was a combination of a LED light system and gyro stabilization. More about that here: https://axelsdiy.brinkeby.se/?m=201911

Later I wanted a small simple standalone system that could easily be installed in any plane. I first made some experiments by just connecting a couple of transistors and LEDs to an Arduino Nano. After a bit of prototyping I made a custom PCB with a ATmega328 processor and some MOSFETs for controlling the LEDs.

V1.0 of my LED controlled board.

The idea is that this board is connected to the full battery voltage of the RC plane, and the outputs are connected to the LEDs. The LEDs themselves are connected on groups of three in series with a current limiting resistor adjusted to the LED type used and the battery voltage. The ATmega328 processor (same as Arduino Uno and Nano) reads a standard servo signal and controls and flashes the LED outputs in different ways depending on the input. This alows the pilot to control the LED from the RC radio.

I usually fly my RC planes on 4 cell Li-ion batteries. They are just over 16 volts fully charged and 12 volts when discharged. This causes the LEDs to be bright at the beginning of the flight and pretty dim at the end. Therefore I usually connected one of those small switching adjustable DC-DC converter boards between the flight battery and my LED board to convert the input voltage to 12 volts. When also adjusting the current limiting resistors for the LEDs to 12 volts this works quite well.

For the LEDs themself I use cold white surface mount LEDs for landing lights and strobe lights. I have made my own custom PCBs for them, as can be seen in the video above. For the colored navigation lights, I use standard 5 mm LEDs, of the brightest type I can find.

cold white surface mount LEDs for landing lights and strobe lights.

Later I made a new version of my custom LED controller board with a built-in fixed 12V switching regulator. Otherwise, it is the same processor, MOSFETs, and software as the first. I also skipped the indicator LEDs for each channel to save space on the PCB.

The new board is 60 x 25 mm. The 12V regulator can supply up to 3A to the LEDs. The MOSFETs can handle up to 3A each. Whish is a lot more than needed. The input voltage to the board can be up to 40V, or 10 li-ion cells in series. If the input voltage is lower than 12V the LEDs and the board will still work, but the LEDs will no be as bright.

Here is a link to my Arduino code: http://brinkeby.se/downloads/RCplaneLightSystemV2.zip

Feel free to use and modify the code as you like. This code can also be used an any standard Arduino Uno or Nano, not just my custom board

Here is my EasyEDA project with the PCB design: https://easyeda.com/editor#id=|d7bd0d7576e04ff88b89458a67529799|d44eedf4a12541269b71d3d20c136a3d

Lidar Robot

This is a video of my DIY Lidar robot. Here it is using a spinning laser distance sensor (Xiaomi robot vacuum spare part) to drive around and avoid obstacles. The sensor is connected to a Raspberry Pi running a Python script that is the main behavior program. There is no mapping going on, the robot is just going forward and turning away from things that are to close. The Raspberry Pi then sends serial data to an Arduino that controls stepper motors driving the robot.

The Xiaomi laser distance sensor is connected to a Teensy 3.2 running code from this project: https://github.com/getSurreal/XV_Lidar_Controller

The Teensy 3.2 is running PID speed control for the DC motor that spins the sensor. It is also reading the binary sensor data and sends it in easy to understand ASCII-messages over serial to the Raspberry Pi. The sensor spins at 5 revolutions per second and makes a distance measurement for every degree. Resulting in 360*5 = 1800 measurements per second. The accuracy is within a few centimeters. This sensor trigonometry to measure distance, in that way it is not a real Lidar sensor.


Bush Beast 3 electronics

Here is a video of me assembling the main electronics board used in my Bush Beast 3 RC airplane.

A Teensy microcontroller is used to read a decode an S-bus signal from the receiver and make all the servo signals. It manages servo mixing and gyro stabilization, as well as controlling LED lights on the plane.

More info about this, including schematics and code can be found on the Bush Beast 3 page here: Bush Beast 3 page

There you can also find some build-images