Antenna Acquired! - Power supply problems

 NRF24L01+

The antennas arrived!

Another layer of abstraction: Libraries. 

First, I'm going to use the RF24 library by TMRh20 in the Arduino IDE. After which, if time permits, I'll learn to work with the NRF24L01 datasheet and do some low-level programming. For now, I just need to make sure these antennas work and understand the fundamentals.

I'll be using this tutorial to introduce me:

https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/

I followed the instructions above, yet couldn't get the simple program to work: One antenna sends the message "Hello World!" And the receiver displays the message on the serial output in the Arduino IDE. 

One comment the above link makes is that the nRF24L01+ is very sensitive to power fluctuations. I plugged in my Analog Discovery 2 (USB oscilloscope) and discovered this pattern:



The Arduino was connected to a 5V power supply from the AD2, yet its own 3.3V supply seems to have a periodic issue. Let's see if it works if I supply the antenna power from the AD2. Note: this pattern does not exist in the AD2 power supply. 


Better, but somehow the problem persists. 

I also discovered that this pattern is caused by the antenna module itself. Any time it sends a signal, the Arduino doesn't seem capable of supplying enough power. Let's test this theory by increasing the transmission rate from 1s to 10 messages per second. 


That seems to be the case.

Something else I discovered: Since the antenna draws so much current, a typical 9 V battery isn't good enough. I tested my voltmeter on the power supply and it dropped from 8 V all the way down to 5.5 V. When I mount this antenna in my controller, we'll need to make sure the battery can handle the current demands.

Let's try to do everything we can to smooth out power. Below I have an external power source with two decoupling capacitors (low cap and high cap) to smooth out high frequency and low frequency fluctuations:


That helped some. But didn't solve the problem. Transmission still doesn't work and there are still some noticeable fluctuations. nRF24 seems to be highly sensitive to power noise. Let's figure this out.

6+ hours later





After adding an external power supply, capacitors, and trying just about everything (and testing the connection between the Arduino's and antennas and verifying a solid connection), I have concluded we need an even more stable power supply that can draw 200mA+ current (did a Google search to see the current demands). We'll need a voltage regulator:


I went with the LD1117V33 voltage regulator to output a steady 3.3 V (max for the antenna) and can draw up to 800 mA of current. Since the voltage dropout at 800 mA is only 1.2 V, I'll only need 4.5 V to power it, which is totally doable. 

It'll arrive May 27th! In the meantime, I still want to practice interfacing with Brandon's on-board Arduino....






Update #1 - Antenna Research

Laws and regulations

The first thing I thought of before beginning my controller research was whether our project had any legal constraints. After some digging, I found this federal regulation in the FCC:

§ 15.23 Home-built devices.

(a) Equipment authorization is not required for devices that are not marketed, are not constructed from a kit, and are built in quantities of five or less for personal use.

(b) It is recognized that the individual builder of home-built equipment may not possess the means to perform the measurements for determining compliance with the regulations. In this case, the builder is expected to employ good engineering practices to meet the specified technical standards to the greatest extent practicable. The provisions of § 15.5 apply to this equipment.[1]

Fortunately, since we're not marketing this, we don't have to jump any large legal hoops to get our RC plane approved. It looks like we're expected to at least try to meet the regulations in this legal document, but not necessarily expected to exactly. Now, what are the technical standards?

The first and foremost guideline is found in 15.5:

15.5 General conditions of operation.

(a) Persons operating intentional or unintentional radiators shall not be deemed to have any vested or recognizable right to continued use of any given frequency by virtue of prior registration or certification of equipment, or, for power line carrier systems, on the basis of prior notification of use pursuant to § 90.35(g) of this chapter.

(b) Operation of an intentional, unintentional, or incidental radiator is subject to the conditions that no harmful interference is caused and that interference must be accepted that may be caused by the operation of an authorized radio station, by another intentional or unintentional radiator, by industrial, scientific and medical (ISM) equipment, or by an incidental radiator.

(c) The operator of a radio frequency device shall be required to cease operating the device upon notification by a Commission representative that the device is causing harmful interference. Operation shall not resume until the condition causing the harmful interference has been corrected.

(d) Intentional radiators that produce Class B emissions (damped wave) are prohibited. [1]

Since we'll be buying an RF module with its own modulation scheme, we don't have to worry about (d) (otherwise, why would it be on the market?). Although we'll still check to ensure that the modulation isn't Class B (damped wave). (a) and (c) are if we mess something up. (b) will be my primary concern.

Ensuring that my controller does not cause "harmful interference", we want to check:

Harmful interference. Any emission, radiation or induction that endangers the functioning of a radio navigation service or of other safety services or seriously degrades, obstructs or repeatedly interrupts a radiocommunications service operating in accordance with this chapter.[1]

So we'll want to ensure that my controller isn't so powerful that it obstructs other ISM-band services. We'll want to limit both its range and power output. And follow the regulations for whatever ISM band we choose (thinking 2.4GHz as of now).

In addition, we must "accept" interference from other ISM band devices. I'm not entirely sure what this means, but from some Google searches it seems to mean that the device must be able to "handle' interference from other devices, and I must legally be okay with interference from other devices. Technically speaking, I should probably choose a modulation scheme that can handle interference well or look into filtering. AM modulation, from the outset, seems like a bad idea, and ensuring my modulation scheme has some kind of header and error detection is a must.

Now, since I'm purchasing an RF module, many of the regulations surrounding modulation and scheme will be handled for me. However, the biggest question now becomes a matter of the other components of wireless communication: namely, antenna usage, data rate, and transmit power.

Many RF modules are FCC-approved and likely have firmware/power-limiting circuits to limit transmit power. My main concern now, is which RF module to use and what antenna to use. 

Frequency band and picking an RF module

I'll want to pick an ISM band that has both a good range and allows for a good data rate
However, before I do that, I'll need to investigate my desired abstraction level.

My options are:
  • Build an RF module or circuit from scratch.
  • Purchase a raw RF module and design my own breakout board
  • Purchase an RF module with a breakout board
Something I've noticed is that the lower the abstraction level, the greater the engineering challenge and the more "engineering" it actually is. Buying a pre-built remote isn't engineering. It's being a consumer. So I'll need to go "low" enough to be an engineer and learn what I want, but not so low that I'm mining copper and producing my own wires, so to speak. Since my group and I want to finish this project this summer, I'll want to get some estimates for how long each of these might take. Since I don't know any RF engineers personally, the best I can do (for now) is Google "how long does ____ take" and simply examine the requirements. 

Building my own RF module from scratch: This seems like it'll take too long. A Google search suggests it might take "months," which extends beyond the scope of our summer-long project. By the time I finish my custom RF module and design it beneath the pages and pages of FCC regulations, I'll have a module. Not a controller.

Building a raw RF module and designing my own breakout board: The lovely thing about this is KiCAD (and similar software) seems like a great, marketable skill to have. How long does it take? A Google search... isn't helpful. It seems like it might take an uncomfortably long time. 

Perhaps my first option is to purchase an RF module that already has a pre-built breakout board, and then, if I finish early or want to learn, I can build my own breakout board and compare its performance with the pre-built one. Especially because an RF module is only one component of my controller. I'll still need to construct a protocol to send a signal with an RF controller and have everything working in harmony with joysticks, buttons, etc. 

Let's go with an RF module with a breakout board. It's still complex enough that I'll need to write a lot of code to interact with it, but not so deep that we never finish making our plane this summer.

I decided to go with the NRF24L01+. Seemed like a reputable chip:

I'm going to make a safe assumption (for now) that this reputable seller with 421k items sold has likely followed FCC guidelines for me. Otherwise, the data sheet seems to allow variable power output/input, and I can always purchase another antenna. In addition, the data sheet shows that the max output power is 0 dBm, which is far from the .125 W power limit in FCC part 15 for 2.4 GHz. However, FCC part 15 does limit power output for directional antenna gains greater than 6 dBi [1]. I've messaged the seller asking exactly what type of antenna that is. A quick search (Chat GPT and Google) shows that these external antennas are typically omnidirectional and likely up to 5 dBi. This shouldn't be an issue then. 

However, once I make my own breakout board, I'll need to be more careful with regard to power output and antenna usage. 

While I wait for what gain this antenna has, I won't be able to calculate the exact range. And before our first test flight, I won't be able to determine how the Doppler effect will alter the system. For now, we're going to assume it'll be fine. 

Other considerations: I may opt to purchase an NRF24L01+ with a patch antenna so it can more easily fit inside the plane's shaft. I want to use this chip for other projects in mind anyway (and they're fairly cheap), so I don't mind purchasing another chip if need be. 

Link budgeting calculations will come at a later update!

Finally, you may be thinking: why antenna first? Why not other things? Why not a high-level diagram? I'm getting there. The reason I chose this first was for our first "milestone" test: a 10 second flight. My computer can act as the controller (connected to an Arduino). I just wanted to get this out of the way first. 


Sources:
[1] https://www.ecfr.gov/current/title-47/chapter-I/subchapter-A/part-15

RC Airplane - Renewed!

 It's been a while!

A failed test

Our first test flight was looking good. All we needed to see was our motor producing lift on our airplane. Then we could proceed to design the rest of the plane. There's no use designing a plane all at once, especially one that can't even take off for a few seconds. The plan was to turn on the motor for only 5 seconds and shut it off.

Brandon's plane model was able to house the motor and all my electronics, and it seemed to glide rather well.



In the next clip, I used a simple remote to trigger an IR sensor on an Arduino to activate the motor for a few seconds:




Unfortunately, right before we were going to run our test, an error in my code led to our ESC burning out:




I learned a valuable lesson that day: always rigorously test your code in and out before letting it interact with hardware. Especially if that hardware has risk (20 A ESC and a giant battery can cause some serious damage). 

Renewed

School got in the way of the project shortly after this failed test, unfortunately. But that didn't mean our interest went away. 

Brandon was still very interested in finishing the project, and my other friend, Justin Archer, expressed interest in joining. He's also a mechanical engineer and recently started developing his skills with CAD and 3D printing.

Yesterday we had a great meeting about how to proceed and finish this RC airplane:


Starting soon after finals:

Justin will take over the physical design of the airplane using his CAD and 3D printing experience.
Brandon will be responsible for onboard control, furthering his interest in Arduino and microcontroller design.
Carsen will be responsible for the handheld controller.

Like last time, our first test is the same: a simple short flight that produces lift. 

There are a few preliminary things to get out of the way before we begin. In the next few weeks, as we're finishing finals, Justin will be playing around with designing the airplane and the housing for our electronics. I will be researching good wireless communication systems and perhaps looking into getting an RF license if I end up building a custom controller/custom antenna. 

We're super excited!!
Stay tuned.



The frame and the skeleton

Brandon and I have made some progress! Rather than delving into weeks upon weeks of theory and mathematical equations, we figured appealing to empiricism would accelerate the process, make the project more meaningful (being able to put something on the table sooner rather than later) and help facilitate an agile methodology of developing our RC plane--we're bound to make plenty of changes and spending weeks upon weeks of theoretical research only to end up changing or scrapping our plans won't feel that great.

Brandon's choice of material is cheap, sturdy, and somewhat versatile. Since the electronics components are a lot more cumbersome to purchase and configure, we thought it would be best for me to buy high-quality electronics components and try to adapt the airplane frame around them. I anticipate some leftover power from the high-quality components I purchased, so we can use that power for future improvements (faster plane, a camera, etc.).

After some research into RC planes and what is necessary, I purchased the following components:

  • A brushless motor
  • An Electronic Speed Controller (ESC)
  • A 4S Lipo Battery
To be 100% honest, I have no idea why brushless motors are necessary and why they are used for RC applications--that'll be a great research question for a later day. Again, appealing more to an experimental rather than a theoretical approach to get something on the table requires skipping out on some fundamentals of RC plane component design as well as some research opportunities. As much as it would be a great learning opportunity to develop my own motor and ESC or to look into why ESC's and Lipo batteries are the standard for RC devices, it is, practically speaking, not in my best interest to spend hours upon hours developing something while having Brandon wait the equivalent time twiddling his thumbs waiting to improve something about the plane design.

Reading about different methodologies of engineering led me to this "bottom-up" approach--"The bottom up engineering method is essentially a 'start with a product and make it work' approach" (https://www.fastengineering.com.au/single_post.php?id=Top%20Down%20vs%20Bottom%20Up%20Engineering). 

Essentially what I'm doing, then, is taking well-established products and engineering to just "make it work" with whatever Brandon and I make. However, I'll still have an opportunity to design my own component: the receiver.

Receivers and transmitters are rather expensive (some going as high as $100 on amazon with others costing $50). I've already spent a bit of money on the motor, ESC, and battery (which has made me slightly regret not planning more and doing more theory initially). Remember the other plane I lost? Well fortunately I still have the transmitter! I just need to engineer a way for that to work with my own Arduino. I have recently taken a class on electromagnetics and we briefly covered antennas--this will be a great opportunity to save money and practice some more low-level engineering while minimizing the time spent on other components and consequently, the amount of waiting Brandon will need to do.

The plan for now? Use an Arduino to simply trigger the motor to run for 3s to ensure that the plane will generate some lift. A transmitter and receiver aren't necessary at this stage. Brandon just needs some feedback to see if his design will work with my electronics skeleton as well as an estimate on the weight distribution.

Excited to engineer my own receiver and watch something fly!



Feature ideas coming the hard way

Yesterday I decided to dig up an old RC airplane in our family's garage to examine its features and "feel" to know what generally to aim for in our own RC airplane as well as what could be improved. I also figured that someone needed to be good at flying these things so that testing the plane could scale with user competence (we'll likely test the plane under the hands of someone who has never flown before, and then I'd be the "experienced" flyer to test it as well. I don't personally know anyone who regularly flies these things).

I had a good first flight, impressed that a small motor could carry the forearm-sized Styrofoam airplane so far and so high up! My second flight, though, wasn't so fortunate. Moments into the flight, the wind started to pick up. I tried to turn the plane around away from some trees, but it was too late. Shutting off the rutter, frantically trying to get it to turn around away from the neighborhood next to the park I was at, and doing everything in my power to get the plane back to me was futile. That was the last I saw my personal training device.


Some lessons:

  • Always write your name and number on valuable possessions, especially those that have any realistic risk of getting lost or left behind
  • Before running a test, consider all variables and possibilities, even if those possibilities seem small
  • Failure invites ideas for new features, although that should likely be a secondary source of inspiration.

After losing this $100 airplane, I've thought of several features to add to our own to help mitigate the risk of completely losing another airplane, especially one that I'm certain Brandon and I will pour dozens of hours into.
  • a slot to add an Air tag in case it gets carried away by the wind or somehow crash lands somewhere else. 
  • A loud buzzer
  • flashing lights
  • Ability to divebomb by the push of a button (if it starts to get carried away by the wind, this may save it from straying too far). Perhaps collapsible wings or something of the sort.
Although I feel guilty and naive for losing something so quickly, at the very least this failure has inspired many features and variables that otherwise would've potentially been missed in our own development. 


Start of RC Airplane Project!

I've long been upset at the overabundance of theory taught in my university program instead of practical skills; I have wished for my time and money spent at college to prepare me for industry rather than teaching me what would theoretically help me in industry. Taking matters into my own hands, I decided to begin a project with my good friend Brandon.

Brandon is studying mechanical engineering at Brigham Young University, and I'm studying electrical engineering at the University of Utah. It was clear to us that combining our skills would yield some cool gadgets. Brandon is really interested in aerospace engineering, so we both decided to start building an RC airplane.

This isn't my first at-home project. But this is certainly the first time I've worked with someone on a project this complex. I'll be posting updates, developments, and even setbacks for anyone interested in our journey! 


I've done a lot of reading leading up to this project about project frameworks and structures. Part of the motivation to do that was that my last project--a frequency detector--got wayy too complicated and way too disorganized. I needed a framework. I read a bit on scrum and the "waterfall method" and decided that a simplified agile method that uses a kanban style board would be best. Brandon and I had our first meeting this week to discuss the budget, timeline, meeting times, and the software we'll be using to keep track of the project -- Trello!


We're super excited!