ESP32 and GPS with a help of TinyGPS++ library

One of the first projects I did with ESP32 development boards is a simple GPS tracker. OK, it's not really a tracker since it does not store the position anywhere, more like distance meter with a UBLOX Neo-8M Beitian BN-880 GPS unit and small SSD1306 OLED display.

This ESP32 GPS Thingy as I call it uses one button to store current position and then report straight line distance, speed and altitude compared to "Home Point". GPS communication is handled by TinyGPS++ library.

Oh, one the best things about ESP32 is that you can map ports to almost any pin you want. It's not like on ATmega328 where UART and I2C are always the same pins. Here you can choose them. How nice is that?

Code is available on GitHub.

Getting started with ESP32 development boards and Arduino

However fond of good old Arduinos based on ATmega328 and ATmega32u4 we might be, no one can now say they are state of the art. Sure, they might be the first choice to do something cheap and simple, but compared to most more modern designs, they are just too old and too weak. Slow, little flash memory, little RAM, no built-in connectivity: no Bluetooth or WiFi.

When a few years ago ESP8266 started to appear, everything changed. The tinkers finally got something small and cheap with WiFi. And then, the world has changed, since ESP32 it the market.

Geekcreit ESP32 development board

Continue reading Getting started with ESP32 development boards and Arduino

Soldering, rosin, flux and a Stannol x32-10i flux pen

If you really really want, you can solder without flux. But it is a painful experience. Almost all modern solders have flux integrated into its core. And as long as you do not try to solder anything big, it's enough. Of course, sometimes it is not enough and you have to help yourself with additional flux.

My favorite solution lately is a flux pen. Like Stannol x32-10i

Troubleshoothing INAV: magnetometer/compass is not working

Your magnetometer/compass is not working with INAV? Is the sensor red in Configurator? You are not the only one… Not only most popular compass HMC5883l is discontinued and what you get are Chinese clones, chip labeled 5883 might not be HMC5883l but something completely different. And I2C bus is very very picky and likes to give up on you….

This is how you might fix your problems: add pullup resistors for I2C SCL and SDA lines and/or lower i2c_speed

Arduino hygrometer with DHT11 and SSD1306 OLED display

One of the things I like about Arduino ecosystem is that you can prototype pretty decent device in very short time. It might not be pretty, but will work. Just like my DIY hygrometer built with DHT11 and SS1306 OLED display I've built few weeks ago:

Simple, efficient and runs on 4 AA batteries. The best part is that it can be powered all the time. Arduino does humidity measurement, display the result and then powers itself down to conserve power. Cool, right?

Arduino DHT11 hygrometer with OLED SSD1306 display

Code is available in GitHub repository.

Crossbow LRS, hardware

Weather outside is bitchy. Period. It rains, then it's windy and then maybe there is some direct sunlight for 15 minutes. No way to fly or test my DIY RC radio link.

Weather is bitchy

But, there is some progress after all. My latest changes seems to be working just fine. On a bench link was stable for almost 3 hours. Later I too it for a standard range test: 2.8km LOS. It also worked, I still had around 5dB of link budget left on a ground level.

Back to the topic. Crossbow LRS is open source and open hardware. Maybe open hardware is too much, since there is almost no hardware to build. After all, first iteration is based on LoRa32u4 II development boards and running good old Arduino.

RX module requires no additional hardware:

Crossbow LRS receiver module

TX module is slightly more complex. It required voltage stabilizer and inverter/level shifter made with single 2N7000 FET transistor. I2C OLED display is an option:

Crossbow LRS transmitter module

Hands on: LoRa32u4 II 868MHz LoRa development board

Idea for Crossbow, DIY LRS system did not appearned in my mind out of nowhere. All my previous LoRa attempts were aimed at telemetry purposes only. E45-TTL-100 are cool, but bulky. If I would want to use them, I would either have to attach Arduino to it or hack it open and reprogram onboard CPU (like Qczek LRS does). Somehow it was not something what suited me very much.

But then I came across Adafruit Feather LoRa32u4 RFM95. Awesome idea. ATmega32u4 and HopeRF RFM95 LoRa module on one PCB, Arduino compatible, reasonably small and light. As a bonus, can be LiPo battery operated and has own 1S LiPo chanrger. The only thing I did not liked (OK, not the only one, but that was the biggest one) was price tag: $34.95 is somehow slightly more than I'm willing to pay for ATmega32u4. Even with radio module. So, after some digging on eBay I've found something that looked like a clone of Adafruit Feather LoRa32u4 RFM95: BSFrance LoRa32u4 II.

LoRa32u4 II 868MHz LoRa development board

BSFrance LoRa32u4 II 868MHz LoRa development board

Continue reading Hands on: LoRa32u4 II 868MHz LoRa development board

Testing 868MHz LoRa range, part 3: round trip

After determining that range of 868MHz LoRa wireless modules E45-TTL-100 have, at least, quite impressive range (5,7km and I was out of line-of-sight to test further) I’ve decided to test something else.

In the beginning I was planning to use those radio modules for telemetry only, but then another thought crossed my mind: why not to build DIY TBS Crossfire for the poor? After all, TBS Crossfire also uses 868MHz LoRa (SX1272 vs SX1276), so it should be possible to build DIY radio link for medium range (up to 5km) for RC planes, right?

First of all, I will need to know how fast data can be transferred and how much delay can I expect in real life. So I’ve modified Arduino code and E45-TTL-100 configuration:

  • UART speed bumped from 9600bps to 57600bps
  • air speed bumped from 2400bps to 19200bps
  • output power lowered from 100mW to 50mW (17dBm)
  • transmitter sends 5 bytes of data (current microseconds and prefix)
  • relay receives packet and resends it to transmitter
  • current received number is deducted from current microseconds and round trip time is showed on OLED display

LoRa E45-TTL-100 round trip test

Results:

  • Round trip time is 82ms on average and it does not changes with distance
  • at lower output power (50mW vs 100mW) reception at 2.8km is worse. 100% of packets are received only then antenna alignment is not worse than 45 degrees
  • with slightly bigger payload size (up to 7 bytes) it should be possible to archive at least 20Hz update rate

Quick note on SEMTECH SX1276 100mW output mode

Few facts about SEMTECH SX1276 LoRa modem and 20dBm (100mW) mode:

  1. +20dBm (100mW) is possible only on PA_BOOST pin
  2. Pins RFO_LF and RFO_HF allows only up to +17dBm (50mW)
  3. Maximum allowed duty cycle while using +20dBm mode is 1%
  4. Maximum allowed VSWR while using +20dBm mode is 3:1

The biggest problem with +20dBm on PA_BOOST is allowed 1% duty cycle. On the other hand, +17dBm mode (50mW) does not have such a limitation and maximum range should be only 1.42 times shorter than in 100mW mode.

Hands on: Tiny Frsky 8CH Receiver from Banggood

I have a nasty habit of buying things and then forgetting about them. Something like that happened to Tiny Frsky 8CH Receiver (Wolfbox F802 software compatible) from Banggood I’ve purchased last year. For some time I used it in JJPro P175 quadcopter, but then it landed in a box and I forgot about until last week.

Tiny FrSky 8CH DIY Receiver Pinout

So, let’s do overdue “hands on” on Tiny Frsky 8CH Receiver from Banggood… Continue reading Hands on: Tiny Frsky 8CH Receiver from Banggood