Keyboard Shortcuts
Likes
- HBTE
- Messages
Search
Re: Tiny low cost home build spectrum analyzer
#spectrum_analyzer
Gary,
toggle quoted message
Show quoted text
I assume that you do not yet have a hardware configuration for which Erik's code works. My code is still bit-banging the SPI port just like Erik's, but it is using pins that could use the Nano's SPI hardware interface if we ever decide to turn it on. Yes, Erik's pin choice conflicts with the serial port out of the Nano,?could be your problem.? He is not using a Nano. > I did convert a Nano to 3V, mostly worked but I think it needs a delay changed somewhere or something, >? the noise level steps up and down by 10s of db erratically. I assume that is with Erik's tinySA.ino and tinySA.exe.Is it still using Erik's pin choices, but on the Nano? Does it otherwise seem to work? Have you ever had hardware up that was working better? Remember, D0 and D1 are already used for serial communications. Not sure how, but I suppose this could explain the erratic jumps in noise level if you are still using the pins Erik selected. I doubt the symptom you report has much to do with running the Nano at 3v. I assume your Nano's processor clock is still at 16mhz, a bit out of spec but should work fine. If you have divided that Nano clock down to 8mhz, do try it at 16mhz to see if that cures your issue. Jerry, KE7ER On Mon, Feb 10, 2020 at 10:39 AM, wb6ogd wrote: Jerry, |
Re: Tiny low cost home build spectrum analyzer
#spectrum_analyzer
¿ªÔÆÌåÓýJerry,No, if it doesn't communicate in Serial Monitor, it won't work with tinySA.exe, unless I am mistaken. Yes, I believe it should be "Init"? coming out.? Locking up after 2 chars is the problem.? Getting 2 says its sort of working. Oh, I didn't change to my pins..?? that could be it..? I think you were going to use the SPI hardware port?? I am not, Erik's code is bit bang on any pin and I relied on that. I had to make some small changes to Erik's serial read? but my proto analyzer is working fine with that. I did convert a Nano to 3V, mostly worked but I think it needs a delay changed somewhere or something, the noise level steps up and down by 10s of db erratically. 73, Gary WB6OGD On 2/10/2020 9:58 AM, Jerry Gaffke via
Groups.Io wrote:
I assume you are not yet using tinySA.exe, |
Re: SAW filter PCB footprint (QCC8C)
#tinysa
#spectrum_analyzer
Interesting service. I'll have to keep it in mind.
toggle quoted message
Show quoted text
I guess, since you've made the request, you already have the data sheet with package profile but just in case its available here: ? Thanks for doing this. I appreciate it. Dave L. On Mon, Feb 10, 2020 at 10:08 AM, Ion Petroianu, VA3NOI wrote:
|
Re: SAW filter PCB footprint (QCC8C)
#tinysa
#spectrum_analyzer
Just made the request for the part and it was accepted. It takes about 24 hours to get it done. Ion VA3NOI On Mon, Feb 10, 2020, 12:21 Dave VE3LHO <dave@...> wrote: The last bits arrived last week and I'm working on my initial implementation of the TinySA, building the filters "ugly" style. I'm also considering making small PCBs for the filters, both low pass and the IF bandpass filter. --
Ion VA3NOI |
Re: Tiny low cost home build spectrum analyzer
#spectrum_analyzer
I assume you are not yet using tinySA.exe,
toggle quoted message
Show quoted text
just using the Arduino IDE Serial monitor to feed it commands by hand. Have you tried Erik's code, verified that it works as expected on your hardware using the Arduino IDE's serial monitor, once you set up the appropriate pin numbers so his code does not clobber the serial port at D0, D1? (If your code is explicitly using D0,D1,? that might explain why it fails.)
Here is a listing of the first code executed when the Arduino power up stuff gives us control:int main() {
//? ? #if isARDUINO
?Serial.begin(115200);
?Serial.setTimeout(1000);? ? ? ? ? ? ? ?// default timout is 1 second
//? ?#elif isRPI
//? ? ?wiringPiSetup () ;
//? ?#endif
?SI4432_Init();? ? ? ? ? ? ? ? ? ? ? ? ?// Init, set to freqA,freqB, and rbw
?PE4302_Write_Byte(0);? ? ? ? ? ? ? ? ? // Minimum attenuation
?prnts("Init Complete\n");
You are apparently seeing the first two letters of "Init Complete\n" at which point something dies. You might try commenting out the lines Si4432_Init() and PE4302_Write_Byte(), see if it then prints "Init Complete\n"; Maybe even Serial.setTimeout() is done wrong, try commenting that out. These are the Nano pins I am using, perhaps I fouled something up here? #define SS_PE4302 8? ? ?// SPI Enable for PE4302 attenuator chip
#define SSa? ? ? ?9? ? ?// SPI Enable for RX Si4432
#define SSb? ? ? 10? ? ?// SPI Enable for TX Si4432
#define spi_MOSI 11
#define spi_MISO 12
#define spi_SCLK 13
The prnts() is a call to Serial.print() when using the Arduino.One possibility:? replace Serial.print() with Serial.println() to make sure the outgoing serial buffer gets flushed. I doubt that's it, but then don't know a lot about how Arduino does IO. My primary interest is the RPi. To be useful on the Nano, it will probably have to work with Erik's tinySA.exe. If tinySA.exe does not end each command with a '\n', then we will need to? replace the Serial.readStringUntil() call with code that does single character Serial.read() calls until it either times out or it sees a letter character for the next command. At any rate, given that there might be interest in my code, I'll try to make time to? get it going on the Nano.? Perhaps this coming weekend. Jerry, KE7ER On Mon, Feb 10, 2020 at 08:41 AM, wb6ogd wrote:
Jerry, |
Re: SAW filter PCB footprint (QCC8C)
#tinysa
#spectrum_analyzer
Oops,? I have the 6 pin footprint. You can get it built for you if you go to . They offer this service. That is how I've got mine (the 6 pin). You have to provide them a spec sheet with the drawn footprint, with all dimensions. Do you have the spec sheet for the part you bought? I can look the package up for you and make the request myself as I am collecting the parts for the same project. 73, Ion On Mon, Feb 10, 2020, 12:35 Dave VE3LHO <dave@...> wrote: kicad but as I said if you have it in a format compatible with any of the software available to hobbyists that would be great.I'm only intending to use this for a small board (i.e. just the BP filter for the TinySA) right now. --
Ion VA3NOI |
Re: SAW filter PCB footprint (QCC8C)
#tinysa
#spectrum_analyzer
kicad but as I said if you have it in a format compatible with any of the software available to hobbyists that would be great.I'm only intending to use this for a small board (i.e. just the BP filter for the TinySA) right now.
Thanks! |
Re: SAW filter PCB footprint (QCC8C)
#tinysa
#spectrum_analyzer
Hi Dave. I can send you the footprint. What EDA software are you using? 73, Ion VA3NOI On Mon, Feb 10, 2020, 12:21 Dave VE3LHO <dave@...> wrote: The last bits arrived last week and I'm working on my initial implementation of the TinySA, building the filters "ugly" style. I'm also considering making small PCBs for the filters, both low pass and the IF bandpass filter. --
Ion VA3NOI |
SAW filter PCB footprint (QCC8C)
#tinysa
#spectrum_analyzer
The last bits arrived last week and I'm working on my initial implementation of the TinySA, building the filters "ugly" style. I'm also considering making small PCBs for the filters, both low pass and the IF bandpass filter.
I'm using the EPCOS B3555 434MHz SAW filter from the eBay seller in Poland. It is in a QCC8C package and I've hit a snag. I can't find an existing footprint for that package. Does anyone know of/have a footprint for it for any hobbyist available CAD package? My preference is kicad but others (e.g. Eagle) would be fine.? If no one has this I guess I'll need to consider learning how create kicad footprints ... or maybe just live with ugly construction :-) Dave L. |
Re: Tiny low cost home build spectrum analyzer
#spectrum_analyzer
Jerry,
I like your improved code.? I am just running a Nano. It compiles fine and small but, it doesn't run for me. In the Arduino Serial Monitor it outputs "In" and then stops, doesn't respond to any command (Nano Rx led blinks, so hardware is working). I am using IDE 1.8.29.0. I changed the defines as per your notes to: #define isARDUINO 1 #define isRPI???? 0 73, Gary WB6OGD |
Re: TinySA construction
Correction:
>? Section 2.5 of EMRFD gives the necessary background.
?
Noise Figure is discussed in section 2.6, not 2.5?
The book uses the symbol "F" for the "noise Factor" of an amplifier expressed as a ratio.
"NF" for "Noise Figure" is used to express it in dB, as Erik and everybody else in the world does.
If you don't have EMRFD, there are plenty of other places to learn about noise figures. Here's one:? ? ? Jerry, KE7ER On Sat, Feb 8, 2020 at 09:36 PM, Jerry Gaffke wrote:
Erik's post on noise figure is worth figuring out, but it would be tough |
Re: TinySA construction
¿ªÔÆÌåÓýIf you use TWO of SV1AFN¡¯s attenuators in series (31 dB per PE4306 attenuator), you get 62dB total.? You don¡¯t need to buy his controller¡ you can control it via the Arduino SPI interface. ? ? ? ? Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ ? Owner - Operator Big Signal Ranch ¨C K9ZC Staunton, Illinois ? Owner ¨C Operator Villa Grand Piton ¨C J68HZ Soufriere, St. Lucia W.I. Rent it: Like us on Facebook! ? Moderator ¨C North American QRO Group at Groups.IO. ? email:? bill@... ? ? From: [email protected] [mailto:[email protected]] On Behalf Of erik@... ? On Sat, Feb 8, 2020 at 02:41 PM, wb6ogd wrote:
If you have the space and the money, yes |
Re: TinySA construction
On Sat, Feb 8, 2020 at 02:41 PM, wb6ogd wrote:
Would it be more useful to build in two attenuators in the front end (60db)?If you have the space and the money, yes In practice I have not found much use for 60dB as for high power input signals you should want a high power attenuator and the PE4302 is not capable to do this ? -- HBTE Files section:?/g/HBTE/files Erik, PD0EK |
Re: TinySA construction
Erik's post on noise figure is worth figuring out, but it would be tough
toggle quoted message
Show quoted text
to fully understand it without any background. Section 2.5 of EMRFD gives the necessary background. Assuming that background, here's some quick notes on Erik's post. Let's start with his first formula: >? Pn (average level) = 10 log10(k * T * BW) + NF A resistor sitting out on a table as a signal across it, generated internally by heat causing the electrons to jiggle about. The power in a noise source such as a resistor is (k*T) Watts per Hz of spectrum, or?4e-21 Watts/Hz.? That's 4e-21*1000 = 4e-18 milliwatts, or 10*log10*(4e-18) = -174 dBm/Hz As the bandwidth (BW) of spectrum we are inspecting increases, the total power available from the noise source increases proportionally. The noise factor "NF" contributed by an imperfect amplifier using that noise source as an input is mulitplied with the noise source when factoring in the contribution from the amplifier as described in EMRFD. But since Erik is thinking in dB which is logarithmic, we add the NF (in dB) instead of multiply. Here's Erik's next formula: >? Noise floor = 10 * log(k * T * 1000) + NF + 10 * low BW,? ? ?T = 290K Again, Erik assumes NF is in dB.? And we can assume "low" is a typo for "log10". The "T=290" just says that the noise source is at room temperature. Note that "Noise Floor" is different than NF (for Noise Figure). Noise Floor describes the signal level of the noise for an entire system, including noise from the source and noise contributed by all the amplifiers. Noise Figure is a way of describing how much noise a single amplifier contributes. If we assume that NF is a ratio as initially described in EMRFD instead of in dB, and we want a result in Watts, then we get a very simple and easy to understand formula: ? ? ? ?Noise_Floor_in_Watts? = k * T * BW * NF_ratio Erik's result is in dBm, so we must first convert to milliwatts by multiplying by 1000, then do the usual conversion from mw to dBm by applying? ? 10*log10 to the result: ? ? ? ?Noise_Floor_in_dBm = 10*log10( k * T * BW * NF_ratio * 1000 ) Since log10 takes the logarithm (base 10) of the product in parenthesis, it's fair to split that product up into three different individual logarithms and then add the logarithms: ? ? ? ?Noise_Floor_in_dBm = 10*log10( k * T * 1000)? + 10*log10(NF_ratio)? + 10*log10(BW)? But remember, Erik is assuming that NF (the noise factor of our amplifier) is in dB.?? So the conversion from ratio to dB has already been done for us: ? ? ? ? NF_dB = 10*log10(NF_ratio)? With that adjustment, we arrive back at Erik's formula: ?? ? ?Noise_Floor_in_dBm = 10*log10( k * T * 1000)? +? NF_dB? +? 10*log10(BW) From this formula and the knowledge that the Si4432 can sense signals as small as -121 dBm, Erik was able to compute the noise figure NF (in dB) of the LNA (or "Low Noise Amplifier) internal to the Si4432 to be 19 dB.? Not a trick I would have known how to do. That 19 dB is a rather lousy noise figure for an amplifier.? A good wideband MMIC with a noise figure of 3dB or so can be had quite cheaply. As a more or less random example, look at Mouser pnum??772-QPA4563ATR7 Jerry, KE7ER Here's an amplifier with a noise figure of only 3 dB: Thermal noise, such as from a resistor, is generated by the electrons jumping around due to heat. The energy of this thermal noise signal is distributed evenly across the radio frequency spectrum such that each Hz of spectrum has an energy of (k*T), or Boltzmann's constant of 1.38e-23 Watts/Hz? times the temperature in degrees Kelvin. If we assume room temperature is around 17 degrees Centigrade, that's 17+273=290 degrees Kelvin. So any resistor lying on the desk has a signal across it with an energy of 1.38e-23 * 290 Watts per Hz. For milliwatts we multiply Watts by 1000.? ? To convert milliwatts to dBm, we find 10*log10 of that quantity. So that resistor has a signal across it of? 10*m.log10(1.38e-23*290*1000) = -174 dBm of power per Hz of bandwidth. If that resistor is hooked up to an amplifier with a power gain of 10dB, the power of that noise signal from the resistor will be increased by a factor of 10. The amplifier also contributes its own noise Note that he is doing computations in dB, which is to say computations using logarithms. And not being an RF engineer, that is not how I usually think. Also, the abbreviation of NF stands for Noise Factor, distinct from "Noise Floor" which also shows up in the computations. From other references, heat causes random motion of electrons within a conductor (or resistor). This energy shows up as a signal across that conductor. The signal is evenly spread across the frequency spectrum such that for each 1 Hz of spectrum, there is (k*T) worth of power (measured in Watts).?? k is Boltzman's constant of 1.38e-23 (the e-23 says move the decimal left by 23 places, so a very small number). T is the temp in degrees Kelvin, to convert from Celsius to Kelvin we add 273 degrees. So at room temperature of around 290 degrees (or 290-273 = 17 degrees C) a 50 ohm resistor is creating noise across the radio frequency spectrum with a power density of 1.38e-23*290 = 4.0 e-21 Watts per Hz of Bandwidth. 4.0e-21 Watts is 4.0e-21 * 1000 = 4.0e-18 milliwatts.? ?In dBm that's? 10*log10(4e-18) = -174 dBm. The voltage is miniscule for a good conductor such as copper,? for a 50 ohm resistor the voltage across it must be higher to give the same amount of power. generate the same amount of power. for a bandwidth of 1Hz, any conductor (such as a resistor) will have a signal power Here's his first formula: ? ? Pn (average level) = 10 log10(k * T * BW) + NF ? ? Where: k is Boltzman constant, T is temperature in Kelvin, B is bandwith in Hertz,? NF is the Noise Factor (the internally generated noise level) First off, the "10 log10" converts (k*T*BW) into? ?means 10 times the log-base-10 of the stuff in parNF is expressed in dBm. Here's his central formula: ? ?Noise floor = 10 * log(k * T * 1000) + NF + 10 * log BW My best guess is that the "1000" would be the bandwidth in Hertz, following from i The temperature of the noise source is specified to be 290 degrees Kelvin, converting to Centigrade that's 290-273= 17C, close enough to a typical room temperature. So a "perfect" signal detector looking at a 17C resistor will see a wide spectrum signal distributed evenly across all frequencies.? If the bandwidth of the signal detector is set to 1 Hz, the power it detects will be? ? such that if we inspect the signal with a bandwidth of 1 Hz it will have an energy of 10*log(k*T*1000) = at all frequecieshooked up to a perfect signal detector will detect electrical energy across On Sat, Feb 8, 2020 at 10:32 AM, <erik@...> wrote:
Jerry, |
Re: TinySA construction
Regarding register 0x6D, page 51 of AN440 says that
toggle quoted message
Show quoted text
bits D7,D6,D5,D4 are "reserved", and power up to a state of 0011. Probably best to always write to the register with? 0011 in those bits. D3 is the lna_sw bit, which internally connects the TX pin to the RX pin so they can use the same antenna.? This bit should always be zero (it's set to one in Jan 17 tinySA.ino). D2,D1,D0 are the drive level bits that we are interested in, a value of 000 gives -1 dBm of drive on the TX pin when transmitting, can be controlled in steps of 3dB with 8 possible settings between 000 and 111. So I would write to the 0x6D register with something like ? ? SI4432_Write_Byte(0x6D,? ?0x30 + (drive&0x7)); We could get smart and calibrate it in dBm with? ? SI4432_Write_Byte(0x6D,? ?0x30 + (((drive+1)/3) &0x7)); I find that harder to deal with than simply letting me set those 3 bits directly as above. I suspect the code in tinySA.ino of:? ? SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2); is a way of setting such a register given a drive level in dBm, but was created for a chip other than the Si4432. Truly robust code would just issue a warning if the drive level variable is out of range, without writing to the register.. Jerry, KE7ER On Sat, Feb 8, 2020 at 03:22 PM, Jerry Gaffke wrote:
All instances of? "SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2);" |
Re: TinySA construction
It might be useful on occasion, but I don't think it's worth doing.
toggle quoted message
Show quoted text
In those cases where I want 60dB of attenuation, the front end would probably be seeing Watts of power. Enough to burn out a PE4302, which spec's an absolute max of 1W of power going in (more than I expected!) Another issue is isolation. At 60dB, that's a ratio of 10**(60/10) = 1000000, so a million times more power at the input than the output. It is easy to imagine a wee bit of that power jumping across the attenuator somehow. Having an external 30dB attenuator well removed from the tinySA somewhat reduces the probability of this blow-by You could instead just have a 30dB attenuator consisting of 3 resistors that you put in series with the input. Maybe using 3W power resistors suitable for RF, such as the Xicon 283 series. At $0.10 each, cheaper than blowing out a PE4302, and easier to replace. Just to be clear for other readers, your front end attenuator in no way fixes the possibility of destroying the SAW filter or diode ring mixer due to 20dBm coming out of the Si4432 TX ports. Jerry, KE7ER On Sat, Feb 8, 2020 at 02:41 PM, wb6ogd wrote:
While you smart guys are thinking along these lines... |
Re: TinySA construction
Here's a grep for register 0x6D in the Jan 17 tinySA.ino Arduino code:
toggle quoted message
Show quoted text
tinySA$ grep -i 0x6d tinySA0.ino
? SI4432_Write_Byte(0x6D, 0x1F);//Set full power
? ? ? SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2);//Set full power
? ? ? ? ? SI4432_Write_Byte(0x6D, 0x1F);//Set low power
? ? ? ? ? SI4432_Write_Byte(0x6D, 0x1F);//Set full power
? ? ? ? ? ? SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2);//Set full power
? ? ? ? ? ? SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2);//Set full power
? ? ? ? ? SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2);//Set full power
tinySA$All of those look suspect to me. Most pressing: Don't run a "P6 3" command to go into signal generator mode. This drives the SAW filter with 20dBm from the RX Si4432, and the SAW filter is spec'd for an absolute max of 5dB.? A difference of 15dB, so 10**(15/10) = 32 times more power than the SAW filter datasheet says might damage it. I'd? go with the three LSB's all zero for the RX Si4432, giving -1dBm. And do that *before* turning the transmitter on. Any place where the LO Si4432 is set to 0x1F (3 LSB's of 111) means the LO port of the diode ring mixer is seeing 20dBm. The ADE-1 datasheet says a max of 40ma into the LO port, and I'm pretty sure the 20dBm setting would easily exceed that.? A value of 011 in those LSB's is a better choice, giving -1dBm + 3*3dB = 8dBm. Level 14 and above mixers won't get destroyed by that 20dBm LO. The fourth bit up is the lna_sw bit (bit 3), and is getting set to 1 in all cases. Page 37 of the datasheet says: ? ? "In the Si4431, the TX and RX may be tied directly. ..? ? ? When the direct tie is used, the lna_sw bit in ¡°Register 6Dh. TX Power¡± must be set." So, lna_sw should be zero for the Si4432, especially if setting TX power to 20dBm. If lna_sw is set to 1, that's 20dBm getting driven into the Si4432 RX port, which is spec'd for an absolute max of 10dBm.? Ten times too much power. All instances of? "SI4432_Write_Byte(0x6D, 0x1C + (drive - 2 )/2);" make little sense to me. Bit 2 is always set to 1, meaning the minimum drive is -1dBm + 4*3dB = 11dBm The two LSB's in bits 1 and 0 can take on values of 00,01,10,11 to give power levels of? ?11dBm, 14dBm, 17dBm, and 20dBm respectively. Why the funny math of (drive-2)/2, I have no clue. Out of range values for "drive" will affect other bits in the register. The value of "drive" gets set by the 'D' command, but register 0x6D is not actually loaded until a "P6" command is give. Jerry, KE7ER On Sat, Feb 8, 2020 at 01:48 PM, Jerry Gaffke wrote:
Absolute maximum power spec into a SAW filter is typically 5dBm. |
Re: TinySA construction
¿ªÔÆÌåÓýWhile you smart guys are thinking along these lines...Would it be more useful to build in two attenuators in the front end (60db)? 73, Gary WB6OGD? On Feb 8, 2020, at 1:48 PM, Jerry Gaffke via Groups.Io <jgaffke@...> wrote:
|
Re: TinySA construction
Absolute maximum power spec into a SAW filter is typically 5dBm.
toggle quoted message
Show quoted text
We definitely don't want the RX Si4432 to drive it with 20dBm when operating in the "P6 3" signal generator mode. So Jan 17 tinySA.ino code could destroy level 7 diode ring mixers and? most SAW filters. Jerry, KE7ER On Sat, Feb 8, 2020 at 01:27 PM, Jerry Gaffke wrote: The command "P6 3" of tinySA.ino appears to set both Si4432's in transmit mode |