Radio modules FS1000A and XY-MK-5V – pros and cons

When looking for radio modules for your next Arduino project, you might have come across the couple named: FS1000A and XY-MK-5V. At first glance, they might look like the next best thing, but it’s not that simple.

FS1000A and XY-MK-5V

Before you start hacking anything with FS1000A and XY-MK-5V, read the following pros and cons:

Pros:

  • simple – to send a signal you do not need much. Only to power them up and set LOW or HIGH on the data pin
  • cheap – true, they are not expensive

Cons:

  • pretty much everything else, including the same things that are their pros…
  • too simple – they are just too simple and offer no other functions than transmitting a wave through the void. No CRC, no packets, so SPI or serial, no bidirectional communication
    everything has to be done in the software, including encoding and CRC.
  • transmitting and receiving devices have to use the same libraries and support on some platforms like Raspberry Pi might be problematic at best
  • the frequency can not be changed!
  • no frequency hopping or spread spectrum
  • you have to get your own antennas
  • range is poor at best and depends on things like voltage of the transmitter
  • build quality varies a lot and you can not be sure that TX and RX are really tuned to the same frequency

Verdict? At leat be very careful when choosing hardware for your next Arduino RF project…

How to connect GPS to ESP32

Thanks to a very versatile Input/Output matrix, it is quite simple to connect NMEA GPS modules to ESP32 MCUs. Not only ESP32 boards have 3 serial ports you can choose from, they can be assigned to almost any pin you want.

ESP32 with GPS and OLED display

In this example we will connect a popular Ublox NEO-M8N like Beitian BN-880 or BN-220 to a ESP32 development board and output current position on a USB serial port using Arduino IDE and TinyGPS++ library. Let’s begin

Continue reading “How to connect GPS to ESP32” »

Espressif ESP32

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.

Espressif ESP32

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” »

Crossbow LRS: ready for next tests

Looks like I was able to solve all major known problems with my DIY long range radio system Crossbow. I'm writing known, since no idea what lies beneath… Anyhow… What changed? Quite a lot:

  • I've extended Arduino-LoRa library with ability to transfer full packet in single SPI transaction. Right now, each read of write to SX1276 uses single transaction. Previously, there were 2 transactions per byte…
  • The same library now has ability to send packets in async mode. Previously it was blocking code execution until LoRa packet was transmitted. Huge waste on processing time
  • With OpenTX 2.2.1 on the loose, I was finally able to drop PPM input from Taranis to TX module and replace it with S.BUS. But not without problems. According to specification, S.Bus should be SERIAL_8E2. But my Taranis clearly outputs it as SERIAL_8N2
  • For now, OLED display is disabled. It was taking too much time to update it using I2C and TX module was loosing S.Bus packets
  • I've improved RC channels processing time, time required for encoding/decoding went down by 1ms
  • It is still LoRa32u4 II 868MHz based but I'm considering different hardware. For example ESP32 with LoRa. Time will show

Crossbow LRS development with LoRa32u4 and SX1276

Next test hopefully this weekend. If weather allows, of course. We have very wet autumn this winter in central Europe this year…

Crossbow LRS: first live test that is almost a success

Finally, much later than I originally expected, Crossbow LRS, my DIY medium range RC radio link was used to control something that flies. Not much, and not far. It was only my experimental 6″ GPS Racer quadcopter. And I reached only 350m. Small steps, I had no intention to beat and records after all.

Just as reminder, by RC link is as follows:

Next test, this time without twitching, in a few weeks.

Crossbow LRS, I’m still doing this wrong…

Only two weeks ago I thought I solved all my major problems with DIY LoRa RC link. I was wrong. I was able to solve one problem (link unstable due to rouge packets messing up with protocol decoding), but an old problem came up again: PPM input from Taranis is no longer stable. At least I know why since this is a second time this is happening.

Current code read bytes from SX1276 buffer inside interrupt callback procedure (ISR). PPM decoding is also done in ISR. How many threads ATmega has? What happens when one ISR is triggered while second is still executed? Problems. The solution is to keep ISRs as simple and fast as possible. My code was not simple and fast enough.

On top of that, it turned out that Arduino LoRa library I’m using is not efficient. It performs 2 SPI transactions to read one byte from SX1276 FIFO buffer. So, 12 bytes of typical data packet equals 24 SPI transaction… Looks like I will have to do some low-level coding I wanted to avoid in the beginning… Oh well…

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.

Visual Studio Code as Arduino IDE replacement

I can say a lot of good things about Arduino ecosystem. List will quite long, trust me on that. But Arduino ecosystem has one thing that sucks a lot: Arduino IDE. Programming environment for Arduino is crap. Period. I would not call it the worse development environment ever, but it's pretty close to that title. C'mon, Turbo Pascal from the early nineties of previous century was a better IDE!

There were few project to fix that problem. Somehow none of those really worked until Microsoft did not decided to do something about it and created

Visual Studio Code extension for Arduino

Arduino for Visual Studio Code
Continue reading “Visual Studio Code as Arduino IDE replacement” »