AnyFC F7 and DIY buzzer for INAV

Because both original and Banggood clone of AnyFC F7 flight controller and missing buzzer support, its usefulness is somehow limited. There is no dedicated pin and driver. Next release of INAV (1.7.2) will finally solve this problem by reusing Motor #9 output as buzzer output.

But, some additional hardware will be required. To be precise, single n-channel signal MOSFET transistor like 2N7000. Connection diagram is shown below.

AnyFC F7 Buzzer driver with 2n7000 mosfet transistor

And this is how it can be soldered together.

AnyFC F7 Buzzer driver with 2n7000 mosfet transistor

AnyFC F7 with buzzer

That is all. Simple, right?

Read More

Working solution for USBasp driver in Windows 10 64bit

Yesterday I've spent like 2 hours fighting to make USBasp ISP programmer work under Windows 10 64bit. Seriously, that was like some kind of nightmare that turned into a comedy. All web pages that I've found suggested following procedure:

  1. Download zadig
  2. Install libusb-win32
  3. Be happy

Unfortunately, in my case all attempts failed miserably. All I was getting from avrdude was

avrdude: error: programm enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1

I've found a solution. Internet was wrong. libusb-win32 was not the correct driver for USBasp. The correct driver was libusbK (v3.0.7.0). After installing libusbK USBasp came back to life!

usbasp driver for Windows 10 64bit

Read More

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!


FS1000A transmitter Arduino


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