ESP32, Arduino and EEPROM memory

ESP32 MCUs can be a great replacement for popular ATmega328 Arduino boards, but they are somewhat different. Even if ESP32 Espressif Arduino core is used, some of the libraries will not work out of the box.

Just like EEPROM will not work without changes. Mainly because ESP32 does not have EEPROM memory. An external flash is used instead.

Good thing, ESP32 EEPROM library distributed together with Espressif ESP32 Arduino core solves this problem in a quite nice way. All you have to do is to call EEPROM.begin with a size of emulated storage size in bytes as an argument. From there, everything goes as before.

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

Arduino, ESP32 and 3 hardware serial ports

When working with ESP32 WiFi/Bluetooth MCU under Arduino SDK for ESP32, you will notice that Serial work just fine. But Serial1 and Serial2 do not. ESP32 has 3 hardware UARTs that can be mapped to almost any pin. But, Serial1 and Serial2 will not work. In case of ESP32 this just has to be done in a slightly different way:

The trick is to use HardwareSerial library to access UART 1 and 2 instead of Serial1 and Serial2

ESP32 WiFi bluetooth development board

  • Class HardwareSerial accepts one parameter in constructor, it is a number of UART. Values from 0 (UART 1) to 2 (UART 3)
  • HardwareSerial(0) is the same as Serial so be aware
  • begin method accepts 4 parameters
    • baud speed
    • UART mode
    • RX pin
    • TX pin
      The real beauty of this solution is that almost any pin can be used as TX or RX pin for any UART. Most ESP32 dev boards have labels like TX2 or RX2, but you really do not have to exactly those pins. Every other GPIO pin can act as Serial RX, but only the ones between GPIO0 and GPIO31 can be used as TX. Still, that gives plenty of pins to choose from…

More about ESP32 can be read in Getting Started With ESP32 and Arduino post.

QuadMeUp Crossbow LRS: introduction

Few days ago I mentioned that I'm working on my own DIY long range radio system (LRS) that I named QuadMeUp Crossbow LRS. Today I will share some more details about it.

First of all, I'm not creating anything new or "amazing". There are plenty of "DIY" or OpenSource LRS systems. OpenLRS for example. Or QCZEK LRS that is made from almost nothing at all. And amazing commercial systems like TBS Crossfire.

Is there a place for something else? I think there is. For example, I was so pissed of by complexity of OpenLRS. So many options, so hard to understand. Or do you know how much micro RX for Crossfire costs? And that you do not need 2W of power to fly up to 5km? And most of pilots owning Crossfire never flied > 2km?

This is why, my idea for DIY LRS is:

Continue reading QuadMeUp Crossbow LRS: introduction