Shop OBEX P1 Docs P2 Docs Learn Events
Hook an antenna to your Propeller, and listen to the radio! (New shortwave prog - Page 3 — Parallax Forums

Hook an antenna to your Propeller, and listen to the radio! (New shortwave prog

1356789

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-21 01:44
    I've always got two PCs, an LCD screen, at least one Stamp, numerous other digital devices — not to mention the Propeller itself, running at 80MHz — on when I'm testing the AM radio program. But the biggest source of hash by far has been the fluorescent lights in my shop. They all use solid state ballasts, and they are noisy, electrically speaking — one in particular, which I leave off.

    I'm glad some folks are getting decent reception with this project. Being in a fringe area surrounded by noise, I'm rather envious!

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-08-21 02:54
    I've made lots of crystal, regenerative, and TRF radios.· Wrapping an air-core coil is easy.··For a coil-form you can use a cardboard tube, a plastic pill bottle, a wood dowel; diameters of 1 inch or more make for·good handling.

    The inductance of an air-core coil --

    L = (R2 x N2)/ (9R + 10L)

    L = µH, R = coil radius (inches), N = number of turns, L = length of the windings




    µH per inch = R2 x (1 / wire diameter)2 / (9R + 10)

    turns per inch = 1 / wire diameter

    length of wire req'd = N * 2R * π
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-08-21 03:28
    PJ Allen,

    Yeah, those are the same formulas that I have used and placed in a spreadsheet with a couple of other coil geometries. I have found them to be reasonably accurate to better than 5% in many cases.

    Coil Calculator Spreadsheet:
    http://forums.parallax.com/attachment.php?attachmentid=55202

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • JonathanJonathan Posts: 1,023
    edited 2008-08-22 17:37
    Finally got around to trying this, it's been a busy week.

    Anyway, I can't seem to pick anything up. There are two major diffs between my setup and the one shown. I am using a much longer antenna, and the Prop I am using has a 10 mHz xtal instead of 5. Of course I changed the _xinfreq and PLL. Any reason these diffs would make it not work? I don't think so but I thought I'd check. I live WAAAY out in the sticks, which is why I have an outdoor antenna set up. I'm guessing it's just low signal strength, but I thought I'd check here and see if anyone has any other ideas.

    Oh, one other small thing, my air coil measured 600uH instead of 500, but that may just be my meter, it is built according to calculations.

    Jonathan



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • RaymanRayman Posts: 14,755
    edited 2008-08-22 17:50
    Well, I think the feedback resistor has to very close to the Prop chip for low inductance. It didn't work for me on the Demo board proto area, but worked on the Proto boards through-holes.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-08-22 18:04
    Rayman,

    My experience is that the inductance needs to be balanced and the proto boards parasitic capacitance should be observed.
    ·
    If I space the 10Meg resistor out by 4 holes on the proto-board and make sure that it is equidistant from the proto boards through-holes that are being used, it works ok.· Also I use the same length of jumper wire from the proto boards through-holes to the Demo board proto area. (Even the 3 inch piece of wire has·enough inductance to throw things off... so you use two of them to balance or cancel each others effects out).· The positioning of the jumper wire should be symmetric as well in relation to the 10Meg resistor and the I/O's being used.
    ·

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/22/2008 6:11:20 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-22 18:05
    Jonathan,

    Your inductor is probably close enough, and the 10MHz crystal with PLL8X should not be a problem. A good earth ground will help, if you don't already have one. Also, soldering the feedback resistor directly onto the Prop's pins is essential. Surface mount resistors are best for this. One thing that helped me, since I also live in a fringe area, was having another radio at hand to find the strongest station to set my program on and to verify any faint signals I thought I heard through the static while I was tweaking things. Eliiminating as many sources of noise as possible also helps.

    Beau might be able to weigh in on the consequences of using a longwire antenna vs. the shorter whips we've been experimenting with. I do know that AM broadcast waves are vertically-polarized, so a horizontal longwire antenna may not be optimal.

    In any event, don't expect to hear anything nearly as clean and strong as Beau's .wav file if you're out in the boonies!

    -Phil

    Addendum: Beau beat me to it! I would defer to his advice where it contradicts mine! smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!

    Post Edited (Phil Pilgrim (PhiPi)) : 8/22/2008 6:12:36 PM GMT
  • JonathanJonathan Posts: 1,023
    edited 2008-08-22 18:08
    Aha. I am trying on a DIP prop on a breadboard. Alas, I don't have an alive demo board (I killed mine, dunno how, sniff) or a protobaord handy. Any way to work around this? I'm a long time crystal set maker and love this sort of thing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • JonathanJonathan Posts: 1,023
    edited 2008-08-22 18:18
    I have a good ground, 3 six foot copper clad ground rods one foot apart and bonded together, and it is only used as a RF ground (not tied to my mains power ground). I'll try soldering a resistor directly to the DIP prop I have. I'll also try Beau's layout tips. I don't expect great sound, it would just be fun to hear anything.

    Also, what about an adjustable air cap across the 500uH inductor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-23 06:59
    If you're in a fringe area, like I am, you may find this RF preamp useful for pulling in those weak stations:

    attachment.php?attachmentid=55288

    The circuit comes from a set of lab notes prepared for the "Electrical Circuits and Systems II (ESE206)" course at the University of Pennsylvania. (Published university lab notes are a great way to pick up electronics info, BTW.) The amplifier uses three transistors from a CD4007 (MC14007) "dual complementary pair plus inverter" CMOS IC and runs on 5V. The CD4007 is nominally a digital IC which finds many uses in analog circuits, such as this one. It's configured as a common-source amplifier (the nMOSFET) with an active load (the two pMOSFETs hooked up as a current source). The wiring seems to be uncritical. I just used the breadboard area of my Propeller Demo Board, and got much better results than with the original circuit. Your results may vary...

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
    433 x 373 - 4K
  • JonathanJonathan Posts: 1,023
    edited 2008-08-23 14:25
    Phil,

    Dang, I was sure I had some CD4007's laying around, but an hour of digging yields none. Before I start digging through dead equipment looking for one to salvage, any alternates?

    Thanks a ton for the circuit and info though! Worst comes to worse, I'll have to order some and *shudder* wait for them to arrive. On the other hand, maybe I'll get done what I'm suppopsed to do today. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-23 15:30
    Jonathan,

    Beau suggested (via email) a CD4049 inverter. You could try that in lieu of the CD4007 and the 5.1K resistor. Just connect the 10M resistor from output to input to bias it into linearity. Be sure to ground any unused inputs. I didn't have any 4049s to try this, although I could've used the inverter section in my 4007. What I did try was a 74HC00 NAND gate connected as an inverter (one input tied high), but with mixed results.

    One thing to note: this is a broadband amplifier, so it amplifies noise, too. I'm considering adding another stage, but without some added selectivity to go with it, the sound quality probably won't improve.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • LeonLeon Posts: 7,620
    edited 2008-08-23 19:01
    A single JFET such as a BF244 with a resistor load should work just as well.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-23 20:34
    Leon,

    That's a good point. Here is a circuit that uses an MPF102 (available at Radio Shack). I haven't tried it, and now my 60KHz WWVB ferrite antenna has arrived from DigiKey, so I'm gonna be busy!

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • TimmooreTimmoore Posts: 1,031
    edited 2008-08-23 23:27
    Phil, thanks for this code, it works really well as a mixer for a Theremin sensor as well.

    I have some sensors based on the front end sensors of this http://thereminvision.com/version-2/TV-II-index.html·but I have connected the sensors directly to a prop running a modified version of your code. The quadrature code is pretty much the same but its a fixed frequency encoder, the mixer cog cycles round each outputs a value per sensor. I dont use your audio cog at all.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-09-09 01:29
    Here's a challenge for you EE's.

    I'd like to include this project in my 101 projects book, but we need a description of
    how this works in a manner that someone new could understand. It's been suggested
    that this might not be possible. Nah... Let's see if someone can pull it off. [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-09 01:53
    If you want a 2nd related project, how about a theremin synthesizer. The sensor is a lm555 with a couple of resistors/caps. A modified version of phils code can decode a hand moving near the antenna and generate tones from it. 2 sensors one feeding the tone value and the other the volume and you have a synthesizer.
  • DroneDrone Posts: 433
    edited 2008-09-09 09:09
    Hi OBC,

    At the moment I can't expand on Phil's software description, but I do happen to have a simulation of how the quadrature amplitude demodulation Phil mentioned works. Note the pictures attached. I've also attached the LTSpice/SwitcherCADIII simulation files in the .zip if you want to try them yourself. (You can get the excellent LTSpice application free from www.linear.com.)

    Basically what happens is you take one amplitude modulated signal and by one of various means possible such as quadrature power division or quadrature down-conversion, you end up with two identical amplitude modulated signals that are 90 degrees out of phase. The two signals are commonly referred to as I for In-phase, and Q for quadrature.

    Once you have the I and Q amplitude modulated signals, to demodulate them you simply take the root sum of squares [noparse][[/noparse]sqrt(I^2+Q^2)]. The simulation time-domain plots show this process.

    The top two plots are the radio carriers in quadrature. The third plot from the top is the original modulating signal. The next two plots show the amplitude modulated carriers in quadrature. The bottom plot performs the mathematics on the two signals plotted above thereby recovering the modulating signal. Note the formula just above the bottom plot pane.

    In-general, once you have signals in quadrature, you can do all sorts of things with them mathematically. I-Q signals are at the foundation of most of software-defined radio designs.

    Hope this helps a bit... David
    800 x 559 - 47K
    800 x 567 - 126K
  • rjo_rjo_ Posts: 1,825
    edited 2008-09-09 22:45
    OldBit,

    I'm a good subject... I know nothing about any of this and I haven't had a chance to go back and study the thread yet. I have heard of Spice but never used it.

    I can follow Drone's explanation... I'm not worried about the math... as long as it works. The only thing I don't get is why you do the modulation/demodulation in the first place...

    Rich
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2008-09-09 23:22
    for: rjo_

    en.wikipedia.org/wiki/Demodulation

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
  • rjo_rjo_ Posts: 1,825
    edited 2008-09-09 23:54
    Bob,

    Years ago, quad coils came for MRI and I thought that they were better because the biologic signal itself was circularly polarized...and you were basically catching the same signal twice[noparse]:)[/noparse] Now I'm completely confused!!! Sometimes a misperception is more comfortable that realizing that you are completely wrong. There might be a grain of truth to what I thought, but I'll have to look for it again[noparse]:)[/noparse]

    Thanks,


    Rich
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2008-09-10 02:57
    rjo_,

    I don't know anything about MRI beyond the basics. If you start a new thread over in the sandbox section and tell us about your experience, I'll follow it. cool.gif

    Maybe this is what you were referring to:
    A recent development in MRI technology has been the development of sophisticated multi-element phased array coils which are capable of acquiring multiple channels of data in parallel. This 'parallel imaging' technique uses unique acquisition schemes that allow for accelerated imaging, by replacing some of the spatial coding originating from the magnetic gradients with the spatial sensitivity of the different coil elements.

    en.wikipedia.org/wiki/MRI#Radio_frequency_system


    I'm really interested in trying Phil's AM radio project but have too many things on the go right now. I did start on an ant system for the proto board a few months back but never got around to getting it finished yet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2008-09-10 03:01
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
    2048 x 1536 - 1M
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2008-09-10 03:05
    I'll try to make it an active antenna at some point. It's not pretty but it's a start burger.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
    2048 x 1536 - 1M
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-09-10 05:01
    To Modulate is to move or deviate your signal (or Data) away from your carrier.
    To De-Modulate is to detect how far the signal (or Data) has been moved.

    The Carrier is the base frequency you want to send your data on.

    AM modulation varies the Amplitude proportionally to the analog signal being sent over a fixed carrier frequency.
    FM modulation varies or shifts the frequency proportional to the analog signal being sent over a varying carrier frequency.

    Quadrature demodulation is used, because it's an easy way to re-capture the carrier signal. All we need to know for quadrature demodulation is the frequency being used.
    Thanks to the Pythagorean theorem, we do not need to know the phase relationship of the carrier between the transmitter and receiver.

    C = √(A^2 + B^2)

    See the attached WMV file showing the I-Q representation of a sinusoidal wave...

    As the "I"n-Phase and "Q"uadrature-Phase move in relation to the sine wave, notice the "white" bar (the hypotenuse of I and Q). This represents the Carrier Signal strength.

    Any deviation in signal either through AM or FM modulation will cause small fluctuations in the hypotenuse (Signal Strength) that can easily be converted into Audio with a LOW-PASS filter.


    attachment.php?attachmentid=55710

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 9/10/2008 3:06:48 PM GMT
  • rjo_rjo_ Posts: 1,825
    edited 2008-09-10 13:26
    Beau,

    That is a beautiful explanation... does this mean that by definition the quadrature modulated signal is always over unity?


    Rich
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-09-10 15:02
    rjo_,

    "does this mean that by definition the quadrature modulated signal is always over unity?"

    No, not really, the signal should have unity throughout....· It's just that any deviation in frequency, amplitude, or Phase in the
    modulated signal will propagate into the de-modulated signal for easy recovery using this method.· This deviation will cause the
    'strength' to increase or decrease but average Zero over time.


    Suppose at 0 Deg...

    I = cos(0) = 1
    Q = sin(0) = 0

    Strength = √(I^2+Q^2) = 1

    ...at 30 Deg

    I = cos(30) = 0.866
    Q = sin(30) = 0.5

    Strength = √(I^2+Q^2) = 1

    ...at 45 Deg

    I = cos(45) = 0.707
    Q = sin(45) = 0.707

    Strength = √(I^2+Q^2) = 1


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • rjo_rjo_ Posts: 1,825
    edited 2008-09-10 17:15
    This is going to take me a while... but it is definitely stuff I want to know.

    Thanks

    Rich
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-09-10 19:20
    I've been thinking about coming up with a way to do wireless propeller to propeller communication with minimal components. This looks like a promising approach. I've already successfully transmitted tones to an FM radio with nothing more than a piece of wire on a pin. I think using ASK it would be easy to transmit data.

    I wonder if there's an easy way to detect FM with this approach? Perhaps with a couple more counters! smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"I have always wished that my computer would be as easy to use as my telephone.· My wish has come true.· I no longer know how to use my telephone."

    - Bjarne Stroustrup
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-09-10 19:27
    Come to think of it, if you duplicate the design where you are tuning to just above and just below the carrier (call them A and B), then perhaps you can FSK the transmitted signal and detect the bit value by taking the difference between the two outputs on the receiving end. If A > B then it's 0, if A < B then it's 1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"I have always wished that my computer would be as easy to use as my telephone.· My wish has come true.· I no longer know how to use my telephone."

    - Bjarne Stroustrup
Sign In or Register to comment.