FS1000A and XY-MK-5V, Arduino and VirtualWire

While FS1000A and XY-MK-5V 433MHz radio modules might not be the best choice in terms of quality, or reliability or distance (although few hundred meters in open space are doable), they have one very important trait: they are extremely easy to use. No complicated wiring, no advanced programming. If you want to send some data, just connect data lines, supply voltage and write few lines of code. Super simple!

In example below, we will be sending a single 8bit number over FS1000A->XY-MK-5V line with a help of VirtualWire library.

Please remember, without antennas and in radio-noise rich environment, range might be limited. Very, very limited. Even to just a few centimeters. So keep that in mind!

Transmitter

FS1000A transmitter Arduino

Receiver

XY-MK-5V receiver Arduino

Read More

FS1000A and XY-MK-5V range test

Very often, where you go cheap, there is a price to pay. Exactly like with cheap 433MHz transmitter-receiver pair of FS1000A and XY-MK-5V. You rather do not expect much for $1, right?

When playing with them in a middle of a big city (Berlin), few meters of range was all those modules were able to archive. Too much interferences form other devices. But what about open space in a middle of nowhere? I’ve decided to test that, and this is what I came up with:

If video was too long: 315m apart, no direct line of sight between transmitter and receiver and still stable data flow! It would be more, but nature was against me and I just was not able to go further. I did not expected that much range from those two…

Read More

FS1000A and XY-MK-5V 433MHz RF modules: overview

One of the cheapest (but not the best) solutions for DIY wireless data transmission between different devices (Arduino and other microcontrollers) is a pair of 433MHz modules: FS1000A and XY-MK-5V. A set of them (you will need one transmitter and one receiver) costs about $1. Pretty cheap, right?

FS1000A and XY-MK-5V

Of course, there is a price to pay. Those modules are as simple as possible. They do not offer anything like error correction, RSSI, frequency hopping, or even two directional transmission. They offer only basic functionality: receiver reports digital ONE when transmitter detects ONE on the input (if in range, of course). Everything above that has to be done in the software. Continue reading “FS1000A and XY-MK-5V 433MHz RF modules: overview” »

Read More

Using FET transistors as switches

When over a year ago I published this post about using transistors as switches, I described only how to do it with bipolar transistors. And bipolar (NPN and PNP) transistors have a small problem: they are current driven, so they consume current when they are switched on. They consume much less than they drive, but still…

Field Effect Transistors (FET), and especially the ones from MOSFET family, work in a slightly different way. Instead being current driven, they are voltage driven. Than means, to conduct between Source and Drain terminals, specific voltage has to be applied to Gate terminal. More than that, FET transistor consumes current only during switching. It works kind of like a capacitor. When Gate is charged, it stops conducting electricity.

And that, in case of low voltages and low currents (3.3V – 5V logic level and few hundred miliamps), removes the requirement of Gate resistor. Small MOSFETs like 2N7000, BS250 and other, can be directly connected to microcontroller outputs. Cool!

Switch with N-channel MOSFET

N-channel MOSFET is ON when positive voltage (comparing to Source) is applied to Gate. So, Load will be powered when HIGH state is applied.

N-channel MOSFET as switch

Switch with P-channel MOSFET

P-channel MOSFET is ON when negative voltage (comparing to Source) is applied to Gate. So, Load will be powered when LOW state is applied. It acts like an inverter.

N-channel MOSFET as switch

Gate resistor

In case of bigger currents and voltages, gate resistor might be required since FET gate acts like a capacitor and passes electricity until charged. Consult transistor data sheet.

Read More

STM32 F1 and F3 versus LRS 433MHz interference issue

This topic first appeared on my table few weeks ago. Can a flight controller interfere with long range system running on 433MHz band like openLRSng?

STM32 F1 and F3 based CPU running most flight controllers (Naze32, SPracingF3, Flip32, CC3D, etc.) run on 72MHz. Actually this is 8MHz of external clock and 9 multiplier. But still, CPU itself runs on 72MHz. Most LRS systems runs between 413MHz and 453MHz, with most channels grouped around 432 and 433MHz frequencies.

This might create a problem, since 432MHz is a 6th harmonic frequency of 72MHz. Theoretically, perfect square wave should have only odd-number harmonics, but in the real life, both even and odd harmonics are present.

Are those frequencies from flight controller "visible" in 433MHz band and can they affect LRS systems? I do not have LRS system yet, so I can not answer the second question. But I can answer the first one with the help of a small RTL-SDR radio dongle.

The test

Tests were performed with a RTL-SDR and FM frequency antenna (I know, far from perfect) placed 20cm, 10cm and 5cm from running Flip32 10DOF flight controller (STM32F1 CPU at 72MHz).

According to SDR software, exact clock frequency was 72,MHz which was caught nicely on the radio spectrum.

Continue reading “STM32 F1 and F3 versus LRS 433MHz interference issue” »

Read More

ESP8266 and DS18B20 – wireless ThingSpeak sensor

Here is another small project of mine: battery operated ESP8266 ESP-01 WiFi thermometer using DS18B20 and ThingSpeak API to collect data.

Before we proceed, you should:

esp8266 ds18b20 thingspeak sensor

Continue reading “ESP8266 and DS18B20 – wireless ThingSpeak sensor” »

Read More

ESP8266 ESP-01 Low Power Mode – run it for months

Amazing ESP8266 ESP-01 WiFi boards have pretty irritating problem: theirs power consumption is pretty high. Minimal power consumption of about 70mA when doing nothing and above 100mA when when transferring data makes it rather impossible to use it on battery power for a longer period of time. Set of 2 AA batteries would be drained in less than a day. Not good.

There is a way to make ESP-01 work for months using something called deep sleep mode. When in deep sleep, ESP8266 disables almost all of its functions and reboots after specified period of time. There is one catch: ESP-01 is capable to enter deep sleep, but unable to restart and resume operation. XPD_DCDC MCU pin in not connected to RESET pin. To fix it, you would have to solder thin wire between XPD_DCDC and RESET pin just like on a picture below:

ESP8266 ESP-01 Deep Sleep hack

Continue reading “ESP8266 ESP-01 Low Power Mode – run it for months” »

Read More

SmartPort inverter for F4 flight controllers

While STM32F4 family processors installed in newest flight controllers are superior to STM32F3 (and F1 of course) in terms of raw speed, they are inferior to F3 family in terms of IO handling capabilities. For example, F4 family is not equipped with UART port inverters. And that creates a series of problems when it comes to connecting various serial RX receivers and telemetry systems.

The most popular FrSky (Futaba) S.Bus serial RX protocol and FrSky SmartPort telemetry require inverted UART signal. If there is no hardware inverter on hardware UART port, they will not work. While S.Bus requires only one data line, external inverter is not a big issue. Some time ago I’ve published The Simplest Harware Inverter. One MOSFET transistor, one resistor and that’s all.

In case of SmartPort, it’s slightly more complicated. Not only signal is inverted, SmartPort also combines TX and RX UART line into single wire. That means the following:

  1. More complicated inverter is required
  2. Software has to support this case and fallback to unidirectional UART mode

Hardware

Continue reading “SmartPort inverter for F4 flight controllers” »

Read More

Simplest hardware inverter for flight controller

Together with increasing popularity of STM32F4 flight controllers, telemetry became hard topic again. Why? Most popular telemetry protocols, SmartPort and FrSky telemetry , requires inverted signal. Zero becomes one, one becomes zero.

In case on STM32F3 that was not a big problem. Those CPUs have built in inverters. STM32F1 and STM32F4 does not. So, if flight controller designer did not put external inverters on UART ports, FrSky telemetry, SmartPort and even S.Bus would not work.

Luckily, simple inverter for FrSky telemetry and S.Bus can be build using only few electronic parts:

  • Small logic level N-channel MOSFET transistor. One of the best choices is 2N7000
  • 10kOhm resistor
  • few cables

Continue reading “Simplest hardware inverter for flight controller” »

Read More