#help-with-radio

1 messages ยท Page 3 of 1

untold needle
#

circuitry is like 60-70% there

#

and our professor is making the pcb for us from the circuit diagram

#

and then coding the pico is probably the hardest part left

grizzled vapor
#

Look at schematics. Recieving continuous wave is at least kind of easy to recieve

#

Probably

untold needle
#

we have some premade code for that

grizzled vapor
#

Hardware may be easy

#

Or you could use sdr

untold needle
#

frequency range is 25.2 --> 28.8MHz

#

we will broadcast those

#

3.6MHz wide

grizzled vapor
#

Rtl-sdr can recieve 25MHz I think

untold needle
#

lol

#

its pretty small and tough to work with

#

I think we might manage to pull it off

#

its like 20 days

grizzled vapor
#

There are pre-made low noise amplifier boards, so that might simplify things. But you would probably have to do impedance matching into the mixer. I have no idea how to match impedance. There are calculators, but you have to know the load impedance. Maybe load impedance is the complex impedance of the biaser circuitry (the thing that acts inadvertently as a high pass filter).

#

Or does matching even matter when you really just want a high impedance load (the ADC) so you can get significant voltage from the tiny rf currents?

untold needle
#

Very interesting

#

@grizzled vapor they all use coaxial cables though

grizzled vapor
#

You can technically desolder the sma connectors

#

I'm also not sure about all the impedance matching stuff

#

But I don't think it matters as much for recievers

untold needle
#

I think its to connect the antenna to the circuit

grizzled vapor
#

@half plover or @primal warren Does impedance matching matter much for radio recievers?

grizzled vapor
untold needle
#

sounds like added complexity to me

#

my job on my team is basically managing the electronics, data analysis and general team

#

but I basically do anything needed

#

I'd be happy to not have to impedance match

grizzled vapor
#

If you are harvesting power. Definitely. Not sure about general reciever. A lot of fm recievers work fine with a random piece of wire attached.

untold needle
#

I don't think impedance matching is massively hard actually

#

I'm just reading this

grizzled vapor
#

Although the dipole antenna from my rtl-sdr kit does not work with my baofeng radios (I can't get any signal even on strong FM stations).

untold needle
#

oh

grizzled vapor
#

But maybe the rtl is just more sensitive

grizzled vapor
#

How do you find the load impedance?

#

But in the case of No teaming/af's reciever, wouldn't you want the source impedance to be low and the load impedance to be high so the voltage is higher at the source-load node so the ADC can read the signal?

#

For an energy harvester like I'm doing, you definitely want maximum power transfer and efficiency

untold needle
#

Well I'm reading how to do it

#

its not that hard

#

it could be worse

grizzled vapor
#

Impedance matching isn't that hard

#

But finding the source and load impedance might be if they're not given

untold needle
#

thats the tough part

grizzled vapor
#

There are likely antenna calculators, but I haven't seen anything for load impedance.

untold needle
#

I know about source impedance

#

isnt load impedance just the antenna's impedance?

grizzled vapor
#

The one you should match to

#

Source is antenna. Load is ADC or reciever thing

untold needle
#

oh wait what

grizzled vapor
#

But it's opposite for transmitter

untold needle
#

I thought it was other way

untold needle
#

I didn't think so

grizzled vapor
#

The power amp is source and antenna is load in transmitter

untold needle
#

ohhhh ok

#

but we are using a computer as our function generator

grizzled vapor
grizzled vapor
untold needle
#

not hard

#

audacity

#

We managed to test it

#

we will test it again with a picoscope

#

in a week

grizzled vapor
#

I didn't mean that as a reply to that message

untold needle
grizzled vapor
#

I would use si5351 clock generator. Or the Pico's internal clock.

#

You can create a clock out on some of the pico's pins

#

But Si5351 is more adjustable

untold needle
#

this seems to work

untold needle
untold needle
#

I think you can

grizzled vapor
#

Well square wave

untold needle
#

we need sine wave

grizzled vapor
#

You can't. Sound cards have a limited bandwidth since they are high resolution devices that are meant to create audio frequencies

grizzled vapor
#

My function generator can't go above 25MHz

#

You may not need sine wave

untold needle
grizzled vapor
#

Look into quadrature demodulators. There are some that use flip flops to create a 90 degrees phase shifted square wave for the mixers

untold needle
#

how do we create a variable waveform generator from 25-29MHz

#

thats what I need to find out

#

we dont have massive amounts of time

half plover
#

Use a high speed DAC

granite spear
#

A variable waveform is tougher, but if you just need one frequency, you can generate a digital square wave and just pass it through a filter to turn it into a sine.

grizzled vapor
#

Or use max2606

untold needle
#

maybe 3-4 frequencies

half plover
#

Or just make an adder

untold needle
#

28MHz, 26MHz, maybe a 27.5MHz and a 26.5MHz

half plover
#

Make a 27MHz oscillator and sum it with whatever signal you want

untold needle
#

those 4 frequencies

untold needle
half plover
#

Ah different frequencies

grizzled vapor
#

That sounds like a job for the si5351

untold needle
#

28MHz and 26MHz

#

Those 2 at least

grizzled vapor
#

Si5351 then use filters to make it more sinusoidal

granite spear
#

There might also be ways to play with the Pico's PLL and clock dividers to output some frequencies in that range. I don't have a great intuition for how fine of an adjustment you could get, though.

untold needle
#

28MHz and 26MHz

#

why is this so hard!!!

half plover
#

Because engineering is hard

grizzled vapor
#

Rf is black magic

#

Electricity is just normal magic

untold needle
#

but what about a normal raspberry pi

#

because it is ground based apparatus

grizzled vapor
#

Si5351 clock gen

untold needle
#

now that is a good shout

untold needle
untold needle
#

how do you code it

#

or whatever

grizzled vapor
#

I2c

#

There is library

untold needle
#

?

grizzled vapor
#

There is circuitpython support

untold needle
#

YES

#

PYTHON

grizzled vapor
#

Probably since it is an adafruit board

untold needle
#

I like this idea

#

is there a catch

#

do I have to setup some ungodly circuit

grizzled vapor
#

Not really. Just look at adafruit's schematics

untold needle
#

that shouldn't take ridiculous amounts of work, but we only have 20 days for the whole project(19 actually before testing)

grizzled vapor
#

It is only 3v pk-pk out so you may want to lower that to the level of the rf signal coming in

untold needle
#

I am stressing

untold needle
#

this creates a frequency?

grizzled vapor
#

It's a frequency gen

untold needle
#

yes

#

so what RF signal coming in?

grizzled vapor
#

But not adjustable voltage

#

Rf into mixer from antenna

untold needle
#

its the ADC that craes

#

cares

grizzled vapor
#

Should be fine

untold needle
#

I don't know how to do that either

grizzled vapor
#

It can be sma or it can be used with breadboard

#

Get the one with 3 outputs though

#

There may be some parasitic inductance concerns with the traces

#

I'm not sure how to handle that

#

I would just integrate the chip into my own pcb design

untold needle
#

we will use breadboard and connect a raspberry pi 4

#

or a raspberry pi 3

grizzled vapor
#

Breadboards are not good for freqs above 10MHz

#

You need to use perfboard, bare copper board, or solder in midair

untold needle
#

perfboard

#

oh yes

#

we have one of those

#

@grizzled vapor we have one of those

#

do they work for these high freqs

#

This seems easy enough

grizzled vapor
#

Probably

#

But maybe take care where you place your wires

#

Stuff gets funky at high freqs

untold needle
untold needle
grizzled vapor
#

I think you should have ground wires close to every high frequency thing to minimize inductance

grizzled vapor
#

And don't make wires too lose or dangly

untold needle
#

does this apply to my receiver too? probably

grizzled vapor
#

Large loops are bad

untold needle
#

my receiver is a PCB though

grizzled vapor
#

I thought you were doing this for transmitter

untold needle
#

transmitter --> perfboard, receiver --> PCB

grizzled vapor
#

On PCB parasitics should be easier to minimize

#

You need a power amplifier and some impedance matching for the transmitter

untold needle
#

nooooooooo

grizzled vapor
#

And I have no clue how to design that

untold needle
#

Why is life so har

#

hard

#

this project is so advanced

#

what am I doing

grizzled vapor
#

Look at QRP transmitters?

untold needle
#

I have been working 5 hour days

#

and I'm dying inside

#

my brain is rotting

#

I am dreaming about yagi antennas

#

this isn't healthy

#

sorry, I started ranting

untold needle
#

I have 20 days

#

I've got this

#

....maybe

#

......possibly

#

....potentially

#

I need to make a list of everything to do

grizzled vapor
#

There are plenty of ham radio schematics out there that do CW at 30MHz. So that's good

#

Just copy one verbatim and see if it works

grizzled vapor
#

Or buy QRP kit

untold needle
#

we will do like 2-4 frequencies

untold needle
grizzled vapor
#

2-4 frequencies just needs more individual transmitters. Or you could integrate them into one thing with a mixer

untold needle
#

Impedance matching on the receiver and transmitter(10/10)
Coding Rpi pico(9/10)
Yagi Antenna building(3/10)
Function generator building and transmitter supports/amplifier(8/10)
Finish circuit diagram completely(8/10)

#

what I have to do

#

well my team

#

with difficulty in brackets

untold needle
#

Si5.....

#

I just create separate programs

#

circuit remains the same

grizzled vapor
#

Electricity can be hard, but this is kinda how I learned. Maybe watch some videos to understand more of the theory

untold needle
#

I'll consult more experts tmmrw

grizzled vapor
#

Yes

untold needle
#

like madbodger

#

and edkeyes

#

and you

#

and people

grizzled vapor
#

I'm not really an expert

untold needle
#

I'll put in like a 5 hour shift tomorrow, I have maths exams too

untold needle
grizzled vapor
#

This is what I have for the "Insanity harvester V1"

untold needle
#

that looks hard

#

also with this clock chip thing, does it produce a sine wave - I assume wave but better to check

#

@grizzled vapor adafruit shipping is 20 dollars cheapest

#

outrageous

#

actually its fine

#

we can just buy from amazon

#

I love amazon

#

I love Bezos

grizzled vapor
#

I have a whole bunch of questions that I wrote down about the harvester.

#

How should I design the impedance matching network? What should it match with?

untold needle
#

I guess we are both in the mud, me more so

grizzled vapor
#

I figured out the ZMPPT setting. It turns out that you set the impedance it needs to match manually, and the IC will change its load impedance to be a certain value. So now I know load impedance. Source impedance should be 50 ohms since I'm using a standard rubber duck antenna. I just need to know the impedance of the multiplier. But I can fine-adjust the ZMPPT setting to get more of an impedance match.

untold needle
#

We are just using some bog standard lightweight wire

#

As antenna wire

grizzled vapor
#

No. Only for the AEM30940

untold needle
#

Oh.

grizzled vapor
#

dipole antennas work

#

but it would be SUPER long for 30MHz

untold needle
#

Yws

untold needle
#

We are just dangling it off the balloon

grizzled vapor
#

ig that works

untold needle
grizzled vapor
#

Maybe a thing you can do to know the load impedance is to have a resistor across the input and GND of the ADC

#

but Idk how dc blocking cap affects that

#

there must be a way to calculate it

#

ig you just take the resistance (50k) and add the capacitive reactance to get a complex impedance

untold needle
#

Probably he's

grizzled vapor
untold needle
grizzled vapor
#

You can make a loop antenna or use coils in your dipole that make it electrically longer

#

Loop antennas are supposedly very efficient

untold needle
#

Hm ok

untold needle
#

@primal warren @granite spear @half plover @grizzled vapor I have a question about the circuit, doesn't the voltage divider add 1.65V(half Vcc) to every voltage coming it, but at the same time, the nominal values for the ADC are 0.36V and 1.56V, which means every voltage will be out of this nominal range. I feel like I am misunderstanding something. What does this voltage divider do exactly?

primal warren
#

The voltage divider doesn't "add" voltage as much as set the baseline idle level

untold needle
#

ok I see

primal warren
#

However, normally yes, you'd center the idle voltage within the allowed input range of your ADC (which isn't Vcc/2 in this case)

untold needle
primal warren
#

Correct

untold needle
#

meaning I should redo my voltage divider values?

primal warren
#

Correct

untold needle
granite spear
#

Be prepared for other issues like this to crop up in the future. Us 'random people on the internet' are usually not carefully reading everything in the datasheet, so places where things differ from the typical behavior of similar parts can slip through...

granite spear
#

๐Ÿ™‹

untold needle
#

not really

#

you have been of great help

untold needle
#

the one going into the voltage divider

primal warren
#

Theoretically, but the 3.3ยตF capacitor you currently show is SO LARGE that it just doesn't matter, unless you change the effective parallel resistor value by orders of magnitude.

untold needle
# primal warren Theoretically, but the 3.3ยตF capacitor you currently show is SO LARGE that it ju...

https://www.amazon.co.uk/SI5351A-Clock-Generator-Breakout-Board/dp/B00SK8LNYG we are also using this for our function generator to create different frequencies

#

this works right?

primal warren
#

I'd probably buy it from a reputable reseller, and you may need some shaping circuitry to avoid harmonics/birdies, but if it covers the specific frequencies you need, it should presumably do the job.

untold needle
untold needle
primal warren
#

Amazon has a bad habit of selling counterfeit knockoffs, which can cause all sorts of unexpected problems if they don't behave quite like the genuine units.

primal warren
#

What a mixer does is when you input two frequencies, it will output the sum and difference frequencies. Normally you filter out the one you don't want and feed the other to you digitizer.

untold needle
#

yes

#

so we need to filter out the sum

primal warren
#

However, I think that clock generator doesn't produce a harmonic free pure sine wave but a square(ish) wave, which includes several additional harmonic frequencies. When you feed all that into a mixer, you get a whole zoo of assorted sums, differences, etc., which can confuse your digitizer if they're not filtered out (either before or after the mixer)

untold needle
primal warren
#

Something like an AD9837 or AD9833 might do the job. Unfortunately, I'm not too familiar with the Si5351, so I'm unsure what it produces as output.

untold needle
#

right

primal warren
#

Even those fancy chips produce harmonics, but they intentionally push the harmonics far from the fundamental frequency, so they're easy to remove with a simple low-pass filter.

untold needle
#

hmm right

primal warren
#

I was playing with an AD9833 chip recently, here is the nice sine wave output it produces

untold needle
#

so a simple low-pass would get rid of it

untold needle
primal warren
#

Yes, I find an oscilloscope quite useful for working with circuitry

untold needle
#

@primal warren for these chips you need an SDP controller board though don't you?

#

and how do you code them?

#

also they are very expensive

#

uh oh

#

@primal warren are there any other ways to generate different frequencies between 25 and 28MHz

grizzled vapor
#

Another method might be something like a max2606 could work

#

You would just need a few

#

control them with a dac to tune the frequency

#

you can get i2c dac

#

you select the inductor for each one to be around the freq you want, then you use dac to fine-tune

primal warren
grizzled vapor
#

max2606 is reasonably simple

untold needle
#

as it will be easier

primal warren
#

The AD9833 boards aren't expensive. The ones I picked up on eBay were only $9 apiece, and there are cheaper ones out there.

grizzled vapor
#

another option is crystal oscillator (colpitts). More stable and predictable, but cannot be adjusted easily

primal warren
#

Normally crystal oscillators are Pierce oscillators (Colpitts are normally LC oscillators)

grizzled vapor
#

ok that's what I meant then

#

it's similar to colpitts

#

AD9833 looks like a good option

#

much better than buying a whole function generator

primal warren
#

Yeah, oscillator classification is not an exact science (the more unusual ones like electron coupled oscillators, Clapp oscillators, SAW oscillators, phase shift oscillators, blocking oscillators, etc. all have their place too).

grizzled vapor
#

The most crazy oscillaors are the ones with only 1 or 2 components

primal warren
#

You could build a simple inverter-based crystal oscillator and switch crystals for the specific frequencies desired. That is a pretty minimal approach.

grizzled vapor
#

they use some weird non-linear negative resistance to make relaxation oscillators

untold needle
grizzled vapor
#

like neon bulb oscillators

untold needle
#

with only 20 days left I think we will just use a premade one

primal warren
#

Weirdly, the electronic organ I'm repairing uses strange oscillators that are a combination of Hartley and Colpitts, and then uses neon bulb oscillators as frequency dividers synched with the main oscillators. It's a trip.

grizzled vapor
#

you do have to do some code, but there are libraries written for it

primal warren
#

I used a canned library and an Arduino to control the AD9833, it took me less than half an hour.

grizzled vapor
#

so are other reverse biased "diode" oscillators

#

They do work over SPI, which requires more pins than i2c

#

but your pico/pi should have enough

primal warren
#

If you aren't using the SPI bus for anything else, and you don't need to read back any data, it's the same number of pins (2) as I2C

grizzled vapor
#

true

#

but you do need a CS for each device

primal warren
#

If there's only one device, you can tie CS to active.

grizzled vapor
#

yes

#

but I think he needs multiple for mixing and things

#

The AD8933 is a really cool IC

#

definitely using it if I build a radio

primal warren
#

The AD9837 is similar, but a higher range of frequencies

grizzled vapor
#

nice

untold needle
#

@primal warren we will get something premade like this

#
#

seems alright

waxen idol
#

Hello, im using adafruit 32u4 radioboard and I keep getting this error message when trying to upload basic RX example code:

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44
#

any ideas?

#

we also keep finding that when we attempt to upload the code to the board, the board keeps disconnecting per the status in the bottom right of the arduino IDE:

primal warren
#

I'm confused, the M0 is one CPU (a SAMD21) and the 32U4 is a different CPU (an AVR)

grizzled vapor
#

How would I find the impedance of a voltage multiplier?

#

Is there a seperate input and output impedance like a matching network? Or is it basically a series impedance?

primal warren
#

A voltage multiplier is a kind of non-linear impedance, so it's hard to model

grizzled vapor
primal warren
#

I'm unsure why you would want to

grizzled vapor
primal warren
#

While it seems intuitively like you'd want to match impedances for maximum power transfer, in most cases, you want to optimize for max voltage (instead of power), as the main loss mechanism is forward drop in the diodes: the more voltage, the smaller percentage you'll waste in diode drops. At least that's the model I used for my harvester.

grizzled vapor
#

That's good to know

#

So that means antenna source impedance is more than multiplier impedance

primal warren
#

If you manage 70mV (which is rather high for an antenna signal) and the diodes drop 65mV, you'll get 5mV of it. But if you can eke out 100mV, then you'd have 35mV after the diode drop.

#

Yeah, higher impedance generally equates to higher voltages and lower currents, which (I'm guessing) is going to be the winning approach

grizzled vapor
#

This is a napkinCAD sketch of the system

#

If the whole rf harvesting thing fails, I can just power the system off of a AA battery. The input of the AEM30940 I'm using can go down to 50mV, so that battery will last a long time

primal warren
#

Here's my harvester in operation. The antenna is held near a WiFi router antenna by the alligator clip (I'm harvesting 2.4GHz WiFi here). The trace on the oscilloscope shows the voltage on the storage capacitor, once it gets up to a little voltage, the harvester chip empties the capacitor, leading to the sawtooth-ish waveform with the diagonal part the charging bit, and the vertical drop the harvester chip grabbing the charge out of the capacitor once it's high enough.

grizzled vapor
#

Cool

#

What harvester chip?

primal warren
#

It's one of the TI ones, BQ something or other maybe? Let me see if I can find it.

#

BQ25560 "Nano Power Boost Charger and Buck Converter for Energy Harvester Powered Applications". Note the scales on the trace: 20mV/division vertical, so the capacitor is getting up to about 60mV before the chip discharges it, and 1s/division horizontal, so it's taking about 4 seconds to charge the capacitor to 60mV

grizzled vapor
#

It seems that harvesters are much more sensitive and efficient at lower frequencies, so I might be able to get a significant amount of power out of power out of broadcast FM. I have gotten about 10mV pk-pk on my oscilloscope using nothing but a probe (and the scope's bandwidth is only 70MHz). So maybe I can get something? Maybe I'll have to stick a big dipole or directional antenna on it or something.

primal warren
#

A more efficient antenna will get you a lot more signal, and you can run the antenna into something like a 1:9 balun to raise the impedance and voltage. However, the only time I was able to get anything like a "significant" amount of power was when a cell phone was operating nearby. Those things really soak the environment in RF energy (if you've ever heard the staccato bleedover into a sound system, you know what I mean)

grizzled vapor
#

Maybe I can use the capacitive coupling from 60Hz AC lines to power the harvester if the RF harvesting doesn't work.

primal warren
#

You can often grab a fair amount of energy that way. Inductive coupling can work too if you have room for a largish loop (or better yet, a few turns) of wire

#

Oh, I mistyped that chip number, it's bq25570

grizzled vapor
#

FM broadcast stations are like several tens of kilowatts. So I was thinking I could get some decent power. If you're able to get energy from a wifi source and Samsung was able to get enough wifi energy to charge their remote, then it is possible I guess.

primal warren
#

Oh yes, if you happen to be near a radio transmitter, cell tower, high tension line, etc., it's a lot easier. But a depressingly small distance away gets you down into microvolts.

grizzled vapor
#

I wonder if using synchronous rectifiers/ideal diodes in the multiplier would work. I could use the charge stored in the supercapacitor to power them.

#

It would require some initial charge to get going, but still would be useful and cool

primal warren
#

It's possible: once the thing is bootstrapped, you can sidestep some of those losses, if your control circuitry is efficient enough.

grizzled vapor
#

Yeah driving the ideal diodes would get extremely complicated and expensive fast

primal warren
#

The TI chip does this as well as using an input inductor as a voltage booster

grizzled vapor
#

The aem30940 has a similar input boost inductor

primal warren
#

While there were chips with even lower input voltage requirements available when I was playing with this (a few years back), they were thermal harvesters that used things like 1:200 transformers on their inputs to boost the voltage. Since I didn't have a low-enough impedance source for that trick, I opted for this ideal rectifier / boost converter chip instead.

grizzled vapor
#

The balun is a good idea.

#

I'll almost definitely try it

#

But impedance matching will be a pain since I might be changing the circuit to optimize things and I would have to change the matching network for those things. I don't have a whole bunch of SMD RF inductors and caps on hand, and I don't really want to buy them.

primal warren
#

I found a handful of chips that needed 200-400mV to get started, I wonder if there are some lower voltage ones available these days

#

Oh, I'd probably just use a binocular ferrite and a few turns of wire for the balun

grizzled vapor
#

The one I found can cold start at 380mv and go down to 50

#

It is a $7 IC though, so it's expensive. But not as expensive as some other options

#

Another last-ditch effort would be to use one of those tiny calculator solar cells

primal warren
#

Things like this, they're easy to make and surprisingly effective

grizzled vapor
#

This is honestly my first foray into RF engineering

primal warren
#

Yeah, that TI IC isn't cheap. The project I was using it for had an investor bankrolling things, which changed the parameters I was optimizing for.

grizzled vapor
#

There are RF energy harvester modules that are like $40 on mouser

#

$7 is cheap compared to that

#

How would I impedance match/optimize for 60hz mains through capacitive coupling?

#

I guess I just need a big ground and a big reciever.

primal warren
#

Yeah, for capacitive coupling, you'd probably want some sort of ground reference

grizzled vapor
#

Well, that's an ideal voltage multiplier

primal warren
#

It seems to me you'd need some really low threshold MOSFETs to make that work

grizzled vapor
#

True

primal warren
#

It also seems you'd use up a lot of the RF energy charging and discharging the gate capacitances

grizzled vapor
#

@primal warren what capacitors did you use in your harvester? I'm thinking 10-50nF will work for mine

primal warren
#

I think mine were fairly small value C0G ceramic, probably 100-1000pF or so. I'll see if I have any notes.

#

Looks like even less: 1284-1283-1-ND CAP CER 1.5PF 500V NP0 1111 or 1284-1274-1-ND CAP CER 10PF 500V 5% NP0 1111

grizzled vapor
#

1.5pF. I guess 10pF to 1nF will work well on my design

slate comet
#

Beginner here, just had a GMRS radio installed in my truck. I'm able to listen in, but I tried transmitting a few times and no one responded. Assuming they weren't ignoring me ๐Ÿ˜… , does this mean they were either using privacy codes or on a separate repeater channel? It's a Midland MXT275 with a ghost antenna

grizzled vapor
#

They may have been using CTCSS or something

slate comet
grizzled vapor
#

Would there be a way to modify these so that they can transmit/recieve on 915MHz instead of 433?

primal warren
#

You'd probably have to adjust the matching network

grizzled vapor
#

There isn't. SX1278 only supports 137-525MHz

primal warren
#

Heh, those aren't going any 5km with those antennรฆ anyway

#

Ah, I didn't realize the chips were different too

grizzled vapor
#

Probably not. Just looking for cheap lora transmitters

primal warren
#

Interesting how the listing mentions SX1278 and SX1276, but it is a site notorious for counterfeit and mislisted junk

grizzled vapor
#

I was thinking that there would be a resistor that would just need to be changed or bodged to change the freq but no. And even if that were possible, I would still need to change the matching network

#

A lot of low power matching networks seem to be really simple. Just an inductor and a capacitor (some have more). But then why is this matching/whatever it is network so complicated? Is it because this HT radio needs to push out 10W of RF power and different matching networks are needed?

grizzled vapor
primal warren
#

It's nowhere near 10W, but reflected energy can damage the transmitter, so a simple L or pi network normally suffices to transform the impedance at the feedpoint as needed for a frequency band.

#

Or are you referring to the one in that pic, which looks like possibly a cell phone or HT or something?

grizzled vapor
untold needle
#

Our transmitter has to go approximately 200-250km but it helps that our frequency is quite low at around 27MHz

untold needle
#

We are using a yagi antenna though with several booms and mounting it up to like 15 feet and putting around 30-50 Watts through it

untold needle
#

@primal warren do you know if a UK CEPT license applies to other countries like Belgium as well?

granite spear
untold needle
#

project

granite spear
#

Afraid not, I've not gone through that process even in the US, let alone the UK, but I'd be worried that it might not be particularly quick if it's anything like other government bureaucracy.

primal warren
untold needle
#

oh yeah here are some updates, @primal warren @granite spear we decided to scrap the idea of the ADC and the mixer as well as local oscillator, so the only circuitry remaining is the Raspberry Pi(now a 3B+ not a pico), a band pass filter and a balun for impedance matching. We found a $35 dongle that attaches to a raspberry pi and acts as a spectrum analyzer, the only parts that remain challenging now are 1. Getting license for transmission and 2. The coding of the Raspberry Pi 3b+ to store the data rather than outputting it to a computer screen/monitor as a series of images.

#

because the dongle looks like it outputs some images to the screen as a spectrum analyzer and runs its own FFT, we need to save this in some way as we cannot see that data until the balloon comes back to ground

granite spear
#

Excellent, the use of an SDR dongle seems like a good approach given the short timescale.

untold needle
#

I wonder how to save that

#

It shouldn't be massively hard

untold needle
#

IQ samples looks like something I could just FFT or use the inbuilt FFT

primal warren
#

That's quadrature demodulation ("I" is "in-phase" and "Q" is "quadrature"). If you don't need the phase information, you can just store the "I" channel. If you do need phase, store both of them.

granite spear
#

It looks like it's using the same chipset as the RTL-SDR project, so a lot of the software tools you find for that will probably work with this one too.

untold needle
#

just to see if the data coincides

untold needle
granite spear
#

I'm not sure offhand. The dongle is just providing the samples to the Pi, so saving the data would be up to whatever app is receiving them. But somewhere there must be a command-line tool to just save everything to a file.

primal warren
#

Not much to it, just read the data and stream it to a file.

untold needle
#

how does one do that

untold needle
young cove
#

I'm sure there are more of these -- it's a matter of doing the right websearches

primal warren
untold needle
primal warren
young cove
untold needle
#

So its not as simple as a command line tool

young cove
#

you can make a batch job that runs the command-line toosl

untold needle
#

I cant type

untold needle
#

I cant type on the balloon I mean

#

It has to be remote

young cove
#

also see the pyrtlsdr

untold needle
young cove
#

right, but a program is a program, whether it's a shell script or a python program or a c program

untold needle
young cove
#

you were going to need that anyway to run whatever program. look up cron and at

primal warren
#

Or just a script that runs when you start the system.

young cove
#

if you find a linux sysadmin kind of person, they will know exactly how to do this

#

i thought you didnt' have the power budget for the Pi 3B+

#

you might want a cron job to monitor that the software is still running, and restart it if it is not

#

it's probably obvious, but run Raspberry Pi OS Lite, so you don't have all the baggage of a desktop system

untold needle
#

3b

#

So it's 260mA

#

Although even that is a lot

#

Ouch

#

Max was 200mA but we will apply for a waiver

#

@young cove does a pi zero suffice or any other sort of pi?

#

This is looking like too much current draw

young cove
#

you can turn off the wifi, not sure if 260ma is with the wifi on

untold needle
#

I forgot about that

young cove
#

also you may be able to underclock it to reduce the power draw. Pi Zero would probably be fine too, but you need an OTG cable: a tiny bit trickier

untold needle
#

OTG cable?

untold needle
untold needle
young cove
untold needle
#

A pi 3b+ drawing 0.35A

#

That means a simpler 3b might only draw around 0.25A

young cove
#

you should measure the power draw, and look at all these tips for lowering the power. maybe you can find an older A+ model as well. I'm sure there's another chart somewhere for power draws. You need to use your Google Fu.

untold needle
young cove
#

i think i was a reference librarian in a previous life

untold needle
untold needle
#

I'll see the least powerful pi that will be suitable

primal warren
untold needle
#

We will have to apply for a waiver either way

#

If we can get a pi with between 170-250mA that would be nice

untold needle
#

I think so but I don't know if it is fast enough

young cove
#

You have simplified the system so much -- you will have time to try things out. You don't need a Zero 2W if you dn't need wifi

granite spear
#

You may be able to mitigate the power because you're only taking data intermittently. Burn 1A for a second to take data and record it to the SD Card, then deep-sleep for 5 minutes, etc. The average power might be much lower than the peak.

primal birch
#

noob question. What is the difference in these? Or better question is why would I pick one over the other? I know I want the Lora 900mhz but being new to microcontrollers in general and just discovered Adafruit I'm lost on the 'Feather' terminology.

half plover
primal birch
#

Thank you for explaining that. Does that mean it will fit an Arduino Nano?

half plover
#

A nano is 5V logic so you would likely need some kind of level shifting

#

Highly recommend using something like the Feather RP2040

primal birch
#

I'll look into that product.

half plover
#

The RP2040 is incredibly well documented, has tons of RAM and storage on the feather compared to the nano which is just a 5V 8-bit AVR board.

primal birch
#

I just got my VS Code setup to develop for my Nano. Do you know if I can use VS Code for the RP2040?

half plover
#

You can, the RP2040 also means you can use circuitpython which should have a VS Code extension

primal birch
#

ok I'm going to purchase the 2040 also and see what I can do

half plover
primal birch
#

Is CircuitPython more powerful than using the cpp files?

half plover
#

No, but it can be easier to prototype what youโ€™re trying to do

primal birch
#

ok, I'll brush up on my python ๐Ÿ˜‚ I'm mostly a C# person by day.

half plover
#

PlatformIO should allow you to add the RP2040 Arduino cores available for Arduino based development if thatโ€™s your preference

#

All the boards Adafruit manufactures has learn guides with usually both Arduino and CircuitPython examples too

primal birch
#

Excellent that gives me a good starting place. I have PlatformIO setup for my Nano via VS Code. But I'm really liking what I'm seeing over at AdaFruit even thought I'm an infant in microcontroller knowledge.

half plover
#

We all start somewhere ๐Ÿ™‚

primal birch
#

Plus I've fallen victim to buying garbage on Amazon for my nano that doesn't work.

half plover
#

There are usually a few people keeping an eye on those channels that will help when they are able to or have an idea of how to help

primal birch
#

Excellent. Thank you for the info.

half plover
#

I say โ€œa fewโ€ but itโ€™s probably close to a dozen

#

Yeah, definitely!

#

Wherever you start, thereโ€™s always someone here whoโ€™s been there that can help ๐Ÿ™‚

primal birch
#

Awesome. Is there a Veterans discount code for checkout?

half plover
#

I donโ€™t believe so

primal birch
#

ok

half plover
#

If you time your purchases right, Adafruit sometimes does discount codes like on Wednesday nights during ask an engineer

#

Usually you can save a few bucks

grizzled vapor
#

Would this be a good general topology for a simple SDR? It would probably work over a soundcard first (since I can use stereo channels for I and Q signals), but I might move it up to using ADCs and DACs that have a higher sample rate. It is an ambitious (actually maybe not since it's only a few ICs and there is open software available (can you direct me on any (especially for the transmit section)?)) project, so it may not make it far past the sketch phase. Would be really cool to make even just the reciever section. It's based off a hackaday article and QRP labs' QDX.

primal birch
#

@primal birch is sitting at the desk tapping his fingers, waiting for his fun package to arrive from Adafruit ๐Ÿ™‚

untold needle
#

@granite spear I've got the pi zero, an adapter to connect the dongle and a mini-hdmi to hdmi cable so should I just connect pi to monitor and install software on it(NOOBS) and then try making the pi zero receiver FM radio?

#

I've got an antenna connected to the RTL-SDR dongle

brave willow
granite spear
untold needle
brave willow
untold needle
#

we have a 6V battery with a voltage regulator

#

so thats fine

untold needle
#

so some coding will have to be done

#

I will have to use command line or something

#

I'm not sure yet

brave willow
#

Not sure what kind of runtime you'll get from a battery- it's pretty resource-intensive during decoding

untold needle
#

so barely any power being drawn

brave willow
#

Oh nice! You can certainly try it with a Zero and see what kind of results you get- IIRC it didn't take too long to set it up and test it

untold needle
#

fair enough

untold needle
#

mmm I forgot to ask this @young cove @granite spear Since I cant control the pi remotely, can I code this in python or do I have to use command line tools or something?

granite spear
untold needle
#

so the command line stuff is just basically to run the script after booting

#

fair enough

#

I'm trying to get the pi working right now

#

I need some long cable

#

my pi booted up

#

at least

untold needle
#

ok col

#

@granite spear @primal warren so I've got gqrx working with the dongle and everything

#

now how do I save this stuff to a file

#

instead of outputting to my screen

half plover
#

echo data >> datafile.txt

untold needle
#

Works with gqrx

#

but currently it is outputting IQ samples to gqrx

#

rather than saving like data to a file

#

it is in visual form

half plover
#

Ah sorry thought maybe you were getting command line data ignore what I said

young cove
#

and I'm sure there are more. You are not the first person with this use case

untold needle
#

but of course not

untold needle
#

I will look into it

untold needle
#

mmm @young cove @granite spear I can get the data using pyrtlsdr but thing is when I save it to a file, it saves as like dodgy symbols and says it cant be read as utf-8. I'm not sure what the problem is here. Do you have any ideas?

young cove
#

it's binary data, isn't it?

#

I would guess it's not text

#

to process it, you'll need to read it as binary data

untold needle
untold needle
#

how do I do that?

young cove
#

the data format is described somewhere. You can use stuff like struct.unpack to parse it.

#

have to worry about byte order, is it floats vs ints, etc. are there there describing headers, etc.

young cove
#

it will be described in the pyrtlsdr documentation, or it will point to something that describes it

untold needle
#

ok thanks

untold needle
#

and the allow_pickle part

young cove
#

Do you have a pointer to your program that's using pyrtlsdr? Are you using read_samples()?

young cove
#

so if you are using read_samples, it can return a numpy.ndarray(). You can use a numpy function to write that to a file (maybe you are doing that already), and use another numpy function to read that file. Looks like the samples are complex numbers. numpy can wrote that out efficiently as binary data. It can also write it in human readable form, but that takes longer.

unkempt hearth
#

Apologies if sent to wrong channel.

I'm trying to figure out if I can use a Huzzah32 Feather as a wifi coprocessor (like the airlift boards). Same chip if I understand correctly. Is it only a matter of flashing the airlift firmware?

umbral oxide
#

@unkempt hearth The pin numbers get a little confusing, but yes you can. You can't stack two microcontrollers though, or put them on a doubler, they'll need to be explicitly wired together with just the necessary pins.

untold needle
untold needle
#

maybe I just convert to decimal or something before actually writing to a file

primal warren
young cove
#

you need to open binary files in binary mode

untold needle
untold needle
young cove
#

text mode treats newlines and related characters specially, and deals with multi-byte characters (e.g. UTF-8 encoding). binary mode is just a stream of raw bytes

untold needle
#

how does one access binary mode

young cove
#

there are functions in numpy to read and write ndarrays

untold needle
#

I see

young cove
#

you don't even need to open the file yourself, it should handle it. To use binary mode, you add a "b" to the mode: open("some.file", "rb")

young cove
#

but aren't you using the numpy functions for file i/o?

young cove
#

assuming you wnat to process the data in numpy

untold needle
#

I wanted to

#

but it is not working

#

which is rather sad

young cove
#

we really need to see some code that isn't working

#

you can upload a file with the + on the left

untold needle
#

sure, once I have access to my monitor(5pm GMT) I will definitely send it

untold needle
#

one second

young cove
#

show how you write the files in your pyrtlsdr code, and how you read them in the analysis program

untold needle
#

sure

young cove
#

text is much better than screenshots

untold needle
#

from rtlsdr import RtlSdr

sdr = RtlSdr()

sdr.sample_rate = 2.048e6 # Hz
sdr.center_freq = 28e6 # Hz
sdr.freq_correction = 60 # PPM
sdr.gain = 'auto'

f = open("results.txt", "wb")
f.write(sdr.readsamples(1000))
f.close()

f = open("demofile2.txt", "wb")
print(f.read())

#

I just made this up on the spot from memory

young cove
#

yeah, don't use f.write, use the numpy functions to write ndarrays

untold needle
#

from rtlsdr import RtlSdr

sdr = RtlSdr()


sdr.sample_rate = 2.048e6  # Hz
sdr.center_freq = 28e6     # Hz
sdr.freq_correction = 60   # PPM
sdr.gain = 'auto'

f = open("results.txt", "wb")
f.write(sdr.readsamples(1000))
f.close()

f = open("demofile2.txt", "wb")
print(f.read())

#

wait I mistyped file names

#

from rtlsdr import RtlSdr

sdr = RtlSdr()


sdr.sample_rate = 2.048e6  # Hz
sdr.center_freq = 28e6     # Hz
sdr.freq_correction = 60   # PPM
sdr.gain = 'auto'

f = open("results.txt", "wb")
f.write(sdr.read_samples(1000))
f.close()

f = open("results.txt", "wb")
print(f.read())

#

@young cove so create an np.array()

#

and append to that?

young cove
#

readsamples returns an ndarray

untold needle
#

Yes

young cove
#

if numpy is present, it says in the pyrtlsdr documentation. is numpy installed on the Pi

untold needle
#

yes

#

numpy is present I do believe

young cove
#

numpy.savetxt() and numpy.loadtxt() read and write text-format files. numpy.save() and numpy.load() use binary, which will be more compact

untold needle
#

thanks a lot!

#

will come back after testing it.

young cove
#

you have to use numpy.save to save in a format numpy.load() needs. THere are many tutorials online about this. I may have some names slightly wrong, but that is what I see.

untold needle
#

oh my, silly me

#

thank you very much

#

โœ…

untold needle
#

HAHA IT WORKS

untold needle
#

completely random @granite spear, would you like to try an electronics problem, my brain isnt working

#

Ive been trying but cant find voltage drop across R3

#

its crazy because my brain has been broken

remote pond
#

you probably want to think of each resistor as having its own current. they sum to zero at the node Vx. V1, V2, and V3 appear to be fixed, according to the problem statement, so calculate what some of the currents are, and that should give you enough information to calculate the rest

untold needle
#

they are fixed

#

you dont know what the current is

untold needle
#

wait a second

remote pond
remote pond
#

in the general case, the currents through each resistor will not be equal, as you seem to have written with "IRn" with no number on the I

untold needle
#

but for calculating Vx

#

I will need a resistance

#

what is the resistance at Vx

remote pond
#

there is no such thing as the resistance of a node

untold needle
#

i can find currents in terms of Vs and Rs

untold needle
#

but I can find current easily

#

but for V=IR you require a resistance

remote pond
#

what is Vx in terms of V2?

untold needle
remote pond
#

you're not given I, though, are you? only V1, V2, and V3, along with the associated resistances?

untold needle
#

Like current from V1 = V1/R1

remote pond
untold needle
#

thats trivial

remote pond
untold needle
#

find

#

but same applies for each one then

primal warren
#

Yup. Then I1+I2+I3 = 0, set up simultaneous equations et voilร 

remote pond
#

you might want to label each resistor with + and - ends so you can define the polarity of the voltages and currents

untold needle
#

wait no

#

you only have one

#

thats it

remote pond
#

Ohm's Law gives you the other 3 equations

#

you don't have to do the nasty linear algebra thing because manual substitution is straightforward here

remote pond
#

you have V=IR for each resistor. that's 3 equations

untold needle
#

we have covered I = V/R

untold needle
#

V = IR just yields V1 = I1*R1 which leads you back to where you where

#

or V1 in terms of V2

#

and things like that

#

my brain is failing to work

remote pond
#

no, you're given 3 voltages and 3 resistances

untold needle
#

so I found the 3 equations

remote pond
#

you need 4 equations because Vx is the fourth unknown. I1, I2, I3 are trivial. yeah, that's the current summation equation with the individual currents substituted in

untold needle
#

my brain is blowing up

remote pond
#

that's actually the substituted equation for I1 + I2 + I3 = 0, so it's already all 4 equations combined, because the substitution is easy to do manually (and you did it intuitively without thinking of it as 4 separate equations)

untold needle
#

I didnt realise that

#

๐Ÿ˜‚

#

I remember this from like year 9

primal warren
#

It's easier if you learn it when you're young

untold needle
primal warren
#

My situation was a little odd: my mom was a math teacher, so she'd just tell me how to do algebra. The fact that I was 4 years old didn't matter to her, so I could rearrange equations, solve for unknowns, all that stuff before I started pre-kindergarten. Imagine my surprise when I started "school", and they tried to teach me about the number line! I got in big trouble for trying to explain negative numbers to the "teacher".

half plover
primal warren
untold needle
#

My lamp is holding the dipole antenna up

restive fjord
#

hey. i'm having trouble with the bluefruit LE UART and RP2040 QT PY

#

i'm using the neopixel example

#

and i'm getting the following error :

#

'BLUEFRUIT_HWSERIAL_NAME' was not declared in this scope

#

i'm not sure how to interpret that

#

am i missing something

granite spear
# restive fjord am i missing something

It looks like it's intending to have you define/replace that string with the name of the serial port you're using to connect to the Bluefruit with, which in Arduino land would be something like Serial or Serial1, etc. Does the example code have a commented-out line referencing it?

restive fjord
#

Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);

// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif
#

@granite spear this is all i got

granite spear
#

So I guess the question is, what serial port on the QT PY are you using to connect to it?

restive fjord
#

so looking at this

#

i'm guessing it's UART1

#

but if type in UART1 it doesn't work

granite spear
#

So my guess is that there's so few pins on the QT PY that it doesn't set up UART1 by default since it doesn't know whether you want to use those pins for serial or I2C or something else. However, I don't know what the correct SERCOM incantation would be to configure that, I'm afraid. You may want to ask in #help-with-arduino.

untold needle
#

It's beautiful, thanks for helping me guys. May still need some help on command line stuff tho

primal birch
#

I just received my RFM95W and it came with a small piece of paper with what looks like an address on it. Can someone enlighten me?

inland thistle
#

That's a MAC address, the hardware ID or address of that modem. It can be used to comminicate with a specific device, or if asked for that when signing something up. Sorry not a LORA person yet, but I think of that like a bluetooth MAC address, or wifi MAC address, but LoRa

normal drift
untold needle
#

I really hoped I was done

#

@young cove @granite spear I am sorry to bother both of you for the 100000th time. I have all the data and everything. But when I run my FFT on it, I get very different results from GQRX which is the main RTL-SDR dongle reader and analysis tool. Is there anyway I could upload my data to GQRX???

#

It also produces a really nice waterfall and basically all round great data

granite spear
untold needle
#

I want to load in some data file with the data, but right now the data I have is complex

#

so its like

#

1.029399+1.53943j

#

I'm pretty sure IQ samples are complex so GQRX is fine

untold needle
young cove
untold needle
young cove
untold needle
#

Hmm OK thanks.

young cove
#

say that you have numpy complex IQ files from pyrtlsdr and you want to get them into gqrx.

untold needle
#

Ok sure

untold needle
#

@young cove Another idea I'm thinking about, could I convert these voltages or data points into audio

#

and then analyse the audio in GQRX

young cove
#

did you ask on the email list?

untold needle
#

I only asked about 10 minutes ago though

untold needle
young cove
#

yeah, and you should say that the prtlsdr output is in numpy compelx float format

young cove
untold needle
young cove
#

it's not a very active list, I would expect it to take a bit

untold needle
#

Thats true

#

it seems tough though

young cove
#

I don't think so, they are both I+Q, we just need to know the format, we can look at the code if necessary

untold needle
#

Thats true I gues

#

we do need a reference point however

young cove
#

can you upload a data file here to try?

untold needle
young cove
#

the numpy binary format, give me a short one

untold needle
#

it prints in the form 0.4598459845 + -0.3589734897j

#

where j I assume is a complex number

young cove
#

we were talking about numpy load() and save() format above; that's the most compact and is easy to manipulate with numpy

untold needle
#

should I send you my code for the save to file and unpacking of the file?

young cove
#

pyrtl readsamples will return a numpy ndarray. Then use numpy.save() to write that out to a binary data file. it is two lines of code

untold needle
#

and it works

young cove
#

can you give me one of those .save() files?

untold needle
#

I have also created an unpacking of the file

untold needle
young cove
#

short is fine, it's either going to work or not.

untold needle
young cove
#

yes

untold needle
#

alright

#

Ill send it from pi to my computer first

untold needle
young cove
#

i am looking at the gqsrx source code, not yet. and I can convert it in numpy anyway

untold needle
#

my raspberry pi sometimes freezes up

#

I dont think I am feeding it enough voltage

#

thats not a big problem though

young cove
#

what is the amp rating of the AC adapter you are using

untold needle
#

this is annoying

#

5V==1S

#

5V==1A

#

the normalized power supply is 5.1V==2.5A

#

I guess I am throttling it

#

ok @young cove I have the file in question

#

how does one send it to you

#

drag and drop?

#

time to connect pi to discord

young cove
#

use the + to the left

#

how big is it

untold needle
#

288 bytes

#

small file

young cove
#

!? very small numberof samples, how long did you sample for?

untold needle
#

it has either done 3000 or 10

#

oh well

young cove
#

well certainly not 3000

untold needle
young cove
#

get a chonkier AC adapter

untold needle
#

as soon as I send this file to you I will

#

ok I'm in on the pi

young cove
#

what is the sampling rate?

#

that you used?

untold needle
#

like 3MHz

#

I asked it to read only 10 samples though

#

HAHA

#

it worked

#

@young cove did you get the file

young cove
#

yes, i downlaoded it. It looks like gqrx is using gnuradio under the covers, which is expecting a matlab-style complex I+Q file

untold needle
#

how should we go about making the .npy file a matlab style one

young cove
#

i found a lot of stuff about reading .npy IN matlab, but not external conversions

#

are you the only person doing this? Do you have people with numpy or matlab experience on your team?

#

do you have other software people on your team?

untold needle
#

I coded my own fourier which works but GQRX is better

young cove
#

so the other people are hardware/balloon only?

untold needle
#

we have an AD9801 or something module

untold needle
young cove
#

it's not looking like matlab format after all, it's looking like raw, hold on

untold needle
#

ok.

young cove
#

gqrx uses gnuradio. gnuradio has File Sink and File Source. File Sink writes out raw I+Q values https://wiki.gnuradio.org/index.php?title=File_Sink File source will read those values. So you can use .tofile() above to write a "File Sink" style complex I+Q file, and then read it in gqrx by giving the filename in the window I showed above. There is a place to give a filename and sampling rate, etc. in the "Device string" box:

#

I think that is a gnuradio device string. gqrx is basically a wrapper around gnuradio, as far as I can tell, so you need to start studying the gnuradio doc

#

I have to do some other work. I hope I have narrowed the path for you

#

you might also be able to find some code to convert the I+Q values to audio, but that's doing unnecessary computation, since gnuradio can use I+Q values anyway

untold needle
young cove
untold needle
untold needle
#

its not particularly chunky but I've got a 5V, 2A one @young cove , in the real thing it will be powered by a Li-Po battery that is 6V(regulated to 5V) with something like 1.5A or a bit higher

#

but I will disable wifi and some other features

#

and it wont output to a screen

#

so less current

untold needle
#

@young cove I'm getting the error: Parameter 'rate' is missing in arguments. Please select another device. I will show you the complex file I am asking it to go to

#

actually it just says file isnt opening

untold needle
#

due to parameter 'rate' missing

#

All I did was rename the .npy file into a .raw file with the parameters Vladislav P gave me from the GQRX email list.

young cove
# untold needle due to parameter 'rate' missing

an .npy file is not a raw file. to convert from .npy to raw (using your samples.npy file as an example):

>>> import numpy as np
>>> np.load("samples.npy")
array([-0.23137255+0.19215686j,  0.41176471+0.46666667j,
       -0.05098039+0.18431373j, -0.43529412-0.23921569j,
        0.09803922-0.20784314j, -0.1372549 -0.39607843j,
        0.25490196-0.09019608j,  0.54509804+0.3254902j ,
       -0.52156863+0.09019608j, -0.43529412-0.27058824j])
>>> samples = np.load("samples.npy")
>>> samples.tofile("samples.raw")
young cove
#

now I'm working on reading it into gqrx, hold on a minute

#

The "Device String" has multiple things in. I changed file=, so it now says file=samples.raw,freq=100e6,rate=1e6,repeat=true,throttle=true. The frequency and rate are wrong -- you know what they should be. The file path is in my current directory, but you could do something like /home/yourusername/samples.raw or whatever to give a full path. An alternative is to use the Tools -> IQ Recorder window. See the menu bar:

#

I think you then need to set the right parameters:

#

does that make sense?

#

Or, according the email reply you got, I think you can rename the .raw file and it will parse the filename for the parameters it needs when you use the "I/Q recording and replay tool"

#

i am making an informed guess

#

re the files, notice the size difference between the raw file and the .npy file. The .npy file has metadata in it to describe what's in it so it's bigger:

$ ls -l samples.*
-rw-rw-r-- 1 halbert halbert 288 Mar  2 15:39 samples.npy
-rw-rw-r-- 1 halbert halbert 160 Mar  3 12:57 samples.raw
untold needle
#

I'll play around with it once I reach home

untold needle
#

Tell me if you manage to get it working

young cove
#

file=samples.raw,freq=100e6,rate=1e6,repeat=true,throttle=true
what is freq, and I think you could set repeat=false

untold needle
#

Centre freq

young cove
#

i thought it was 27ish MHz

#

I noticed that when i tried playing the raw file, it scanned over and over, hence I think repeat=false is right

untold needle
#

Should I send you a new one with all the specs @tight sail

#

I've got some chonky 5.1V, 2.1A thing

#

This is centred at a frequency of 92.2MHz, an SDR gain of 4(dont know if that matters) and a sample rate of 2.4e6 or 2.4MHz

young cove
untold needle
#

I think you need %s

young cove
#

I don't really know what I am supposed to be seeing in the gqrx window when I play back samples. I did successfully supply all the parameters in file=samples.raw,freq=92.2e6,rate=2.4e6,repeat=false,throttle=true. I think you might try a much larger samples.raw, one that spans several seconds of samples, and maybe things will be clearer.

#

you might try using pyrtlsdr to record some AM or FMbroadacast or similar so when you play it in gqrx you will know what to expect

#

lotsa matlab in that one. You have probably seen these already

untold needle
young cove
#

not if you give the parameters it's looking for in that parameter string, I believe.

#

the renaming is just another way to supply those parameters.

untold needle
#

Maybe make repeat = True and try it

#

Would you like a 3000 samples one

young cove
#

I have to do other work now, can you continue by yourself? Also see the last link above, which does an FFT without using gqrx

untold needle
untold needle
#

OH MY

#

@young cove IT WORKS

#

it just needs a lot of samples

#

thats fine

#

it needs like 15000+ samples

#

@young cove love you mate, thanks a lot, it works beautifully

#

repeat=false is godly

#

Look at that wow

young cove
# untold needle Look at that wow

oh, that is great (I think ๐Ÿ™‚ not sure what I should be seeing). The numpy-only FFT link I gave above might also be interesting, together with the plotting library. If you stay in numpy, then there are many analysis tools available in numpy and scipy. Lots of people use it so there are many examples and the documentation is good. But if gqrx is helping you, that's great too.

untold needle
#

but yeah I'll look into that too

grizzled vapor
#

How does this RF magic work? Might be something to do with the traces having an inductance that helps it radiate or something. But then why are there capacitors between ground and why are there even capacitors from the RF output to ground (it would seem like it would short the RF to ground). Why don't they use a simple monopole trace antenna or a chip antenna?

granite spear
#

Thanks for asking, I hadn't run across that technology before. Seems to be relatively new.

grizzled vapor
#

Maybe it's because it's very efficient

#

But why didn't rpi foundation just plop an ESP32-C3 in there and use a trace antenna as so many boards do?

#

Why did they go through the effort of using the cypress chip?

primal warren
grizzled vapor
#

And they ctually used the cypress chip before on the Pi 3B so it didn't require much new development

#

Also wbga (or whatever it is) is smaller and prolly more affordable

#

So they could squeeze it in there unlike a qfn for an esp32 C3

young cove
#

They also get very good pricing on the modules they use in great quantity.

frozen monolith
#

hi @pliant venture ! I am using a lora bonnet on a rpi zerow and reading the awesome guide you wrote on it: https://learn.adafruit.com/adafruit-radio-bonnets
Question: did you ever got to printa a case for it? I am looking around for an stl and have not found any. If you have not, I will try making one.... someday. ๐Ÿ˜‰

Adafruit Learning System

Upgrade your Raspberry Pi with a LoRa or Packet radio, so it can communicate over very long distances!

untold needle
untold needle
#

hmm @primal warren @granite spear @young cove so basically, danh helped me out with importing a file into GQRX and the fourier in gqrx works perfectly. However when I run my own numpy fourier, there is so much random noise unlike gqrx, can any of you point me to a good example of an fft implementation that can filter out noise or produce nice peaks as mine currently fails to do so. Many Thanks.

granite spear
#

Possibly it might be just the way you're plotting it? I'd expect GQRX might be defaulting to a decibel scale (effectively a log plot) whereas you might be plotting the linear values of the FFT, which might look different in terms of the size of the peaks and the noise. That's just a guess, though.

glass jungle
#

i have the 95C version

#

what code do you run on it?

untold needle
frozen monolith
glass jungle
#

ty!

#

are you using it to connect to loraWAN or just as a peer to peer messenger?

frozen monolith
glass jungle
#

perfect!

#

thank you!!

untold needle
frozen monolith
#

np. I am thinking of doing a show-and-tell... if I find the time.

untold needle
#

@primal warren@granite spear so my code is throwing errors when I give it complex data in the form: 0.0117647058823529+0.0117647058823529j

#

should I just discard the complex part or is there a way to run fourier on it as well

granite spear
#

What's the actual error?

half plover
granite spear
#

The ifft() function should be able to take complex values, so it might be something else.

half plover
#

Might need to be number*j

untold needle
#

0.0117647058823529+0.0117647058823529j its in this form

#

some crazy error

#

wait a second

#

yes this is the error @granite spear @half plover

#

C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\builders_utils.py:196: UserWarning: Narrowing conversion from <U45 to float64 precision
warnings.warn("Narrowing conversion from %s to %s precision" % (a.dtype, dtype))
Traceback (most recent call last):
File "C:\Users\aryan\PycharmProjects\Fast Fourier Transform\main.py", line 36, in <module>
fhat = pyfftw.interfaces.numpy_fft.fft(f, n)
File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\interfaces\numpy_fft.py", line 110, in fft
return _Xfftn(a, n, axis, overwrite_input, planner_effort,
File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\interfaces_utils.py", line 136, in _Xfftn
FFTW_object = getattr(builders, calling_func)(*planner_args)
File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\builders\builders.py", line 302, in fft
return _Xfftn(a, s, axes, overwrite_input, planner_effort,
File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\builders_utils.py", line 203, in _Xfftn
a = numpy.asarray(a, dtype=dtype)
ValueError: complex() arg is a malformed string

#

the error is thrown after the fhat line @half plover @granite spear

#

oh I havent sent the code

#

import pyfftw
import multiprocessing
import numpy as np
import matplotlib.pyplot as plt

plt.rcParams['figure.figsize'] = [30, 21]

plt.rcParams.update({'font.size' : 10})

#Create a signal with two/multiple frequencies and some noise

dt = 4.16666667e-7 #Time div


with open('time.txt', 'r') as a:
    t = [line.strip() for line in a]

with open('voltages.txt', 'r') as a:
    f = [line.strip() for line in a]



#FFT computation

n = len(t)
print('works')
fhat = pyfftw.interfaces.numpy_fft.fft(f, n)
print('works')
PSD = fhat * np.conj(fhat) / n
print('works')
freq = (1/(dt*n)) * np.arange(n)
print('works')
L = np.arange(1, np.floor(n/2), dtype = 'int')

indices = PSD > 40
PSDclean = PSD * indices
fhat = indices * fhat
ffilt = pyfftw.interfaces.numpy_fft.ifft(fhat) #Filtered signal

#Plot

fig, axs = plt.subplots(3, 1)


plt.sca(axs[0])
plt.plot(freq[L], PSD[L], color = 'c', linewidth = 2, label = 'Noisy')
plt.plot(freq[L], PSDclean[L], color = 'k', linewidth = 1.5, label = 'Filtered')
plt.xlim(freq[L[0]], freq[L[-1]])
plt.xlabel('Frequency(Hz)', fontsize=12)
plt.ylabel('Power(PSD)', fontsize=12)
plt.legend()

plt.show()








#

This is my code

#

error thrown after fhat line as my print lines are checking the errors

#
Traceback (most recent call last):
  File "C:\Users\aryan\PycharmProjects\Fast Fourier Transform\main.py", line 36, in <module>
    fhat = pyfftw.interfaces.numpy_fft.fft(f, n)
  File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\interfaces\numpy_fft.py", line 110, in fft
    return _Xfftn(a, n, axis, overwrite_input, planner_effort,
  File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\interfaces\_utils.py", line 136, in _Xfftn
    FFTW_object = getattr(builders, calling_func)(*planner_args)
  File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\builders\builders.py", line 302, in fft
    return _Xfftn(a, s, axes, overwrite_input, planner_effort,
  File "C:\Users\aryan\AppData\Local\Programs\Python\Python310\lib\site-packages\pyfftw\builders\_utils.py", line 203, in _Xfftn
    a = numpy.asarray(a, dtype=dtype)
ValueError: complex() arg is a malformed string```