Shop OBEX P1 Docs P2 Docs Learn Events
Fm transmitter can you make it with prop chip? — Parallax Forums

Fm transmitter can you make it with prop chip?

purplemonkeypurplemonkey Posts: 89
edited 2012-08-21 15:36 in Propeller 1
I would quite like to make a short range (just inside house) fm transmitter for my mp3 player. Has anyone done this and if so can you point me in the right direction for schematic and spin code?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-29 11:13
    I don't know if the Prop can do this on its own or not.

    If you don't mind using some extra components, you could use this FM transmitter from SparkFun.

    attachment.php?attachmentid=94575&d=1343585609
    188 x 188 - 11K
  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-29 11:37
    The question is "how good of an FM transmitter do you want?". The Prop can produce a monaural FM radio signal, but it will not be of a quality that you'd want for anything but a demonstration that it's possible. Better to get something cheap and of excellent quality like the breakout board from SparkFun. Here's a link to one existing thread on the subject. Note the birdies in the spectrum analyzer display.
  • purplemonkeypurplemonkey Posts: 89
    edited 2012-07-30 13:23
    What is the milliwatt output on pin 1 on propeller chip anyways? If you were to use it as transmitter albeit a bad one!
  • BitsBits Posts: 414
    edited 2012-07-30 13:47
    What is the milliwatt output on pin 1 on propeller chip anyways? If you were to use it as transmitter albeit a bad one!

    Not sure about this question as the propeller can output 3.3V at about ~40ma that will = .132Watts. I don't think this is what you are after though.
  • pedwardpedward Posts: 1,642
    edited 2012-07-30 13:53
    If you search the forum, you will find a couple of FM transmitter demos I did. The short of it is that you get a really noisy (lots of sidebands) transmitter. The quality is fairly decent, although I only experimented with 11Khz WAV files. It should be possible to get good quality FM, but it would be too noisy for the environment.

    My first test indicated that you effectively get a wideband transmitter, with sidebands a few Khz away. This would basically be a jammer, and I personally postulated that with the 16 counters you could effectively blackout the entire broadcast FM radio band for a considerable distance.

    I gave some power figures, even low power without a proper antenna, will go far.

    In short, buy an FCC registered CD/MP3 broadcaster at your favorite cheap store. I got one with a couple of Belkin chargers at Walmart.
  • purplemonkeypurplemonkey Posts: 89
    edited 2012-07-31 06:26
    just wanted to do it for some experimenting with prop chip. What was the range like on it?

    Also if i wanted to use a different cog for your code how would i cahnge it in the spin file?
  • purplemonkeypurplemonkey Posts: 89
    edited 2012-07-31 07:33
    what board layout schematic also would i need for this to work?
  • cgraceycgracey Posts: 14,255
    edited 2012-07-31 09:29
    The best way to make an FM transmitter is to set a cog's video generator to broadcast mode and use another cog's CTRA to generate a sideband which gets XOR'd onto the top-of-four video output pin. This way, you pick a frequency for the video generator which has no significant sidebands (ie some static CTRA (video) value which only has 1's in the top five MSB's). Then, use another cog's CTRA (which must be selected by the cog doing the video generation) to generate only a few MHz signal with about +/-50KHz of FM on it. The two signals get mixed together by the cog generating the video and you get very nice FM in the 88-108MHz range. The few-MHz modulated signal will generate FM signals equally above and below the center of the ~100MHz video broadcast base frequency. Trying to use a single PLL to output that high of a frequency results in way too much jitter, but by setting up the high-frequency portion statically in the video generator and then modulating a few-MHz signal with another cog, you get stability and high-frequency at the same time. I remember doing this, and only when I really turned the volume up could I hear any quantization noise in the demodulated FM signal coming over the TV or radio. I'd say the noise was about 11 bits down (-66dB).
  • pedwardpedward Posts: 1,642
    edited 2012-07-31 10:41
    Chip, I did this and documented it in my direct modulated FM thread. Phil ran it through his scope/spectrum analyzer and it was pretty noisy. The quality of the output was significantly better than a direct PLL modulation, not having any detectable sidebands with a radio receiver, but detectable with a scope/analyzer.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-31 15:05
    Here are some spectra from a Prop pin under various ctra/frqa configurations:

    5 MHz (frqa == $1000_0000) NCO:
    attachment.php?attachmentid=94626&d=1343771949

    5 MHz (frqa == $1000_0000) PLL:
    attachment.php?attachmentid=94633&d=1343771954
    Notice the minor jitter sidebands. These probably result from voltage noise in the PLL's VCO.

    7.5 MHz (frqa == $1800_0000) PLL:
    attachment.php?attachmentid=94632&d=1343771953

    8.75 MHz (frqa == $1C00_0000) PLL:
    attachment.php?attachmentid=94631&d=1343771953

    9.375 MHz (frqa == $1E00_0000) PLL:
    attachment.php?attachmentid=94630&d=1343771953

    9.6875 MHz (frqa == $1F00_0000) PLL:
    attachment.php?attachmentid=94629&d=1343771950

    9.6875 MHz (frqa == $1F00_0000) NCO:
    attachment.php?attachmentid=94628&d=1343771949
    Just to demonstrate how much worse things can be without the PLL.

    100 MHz PLL:
    attachment.php?attachmentid=94627&d=1343771949
    Pretty much covers the entire FM broadcast band.

    Also, don't forget that there are odd harmonics of all these signals, since the output is a square wave. Although the jitter sidebands cannot be filtered out after the fact, a good lowpass filter will take care of the harmonics.

    -Phil
    665 x 284 - 10K
    662 x 279 - 12K
    666 x 281 - 12K
    661 x 280 - 11K
    665 x 279 - 11K
    665 x 280 - 10K
    662 x 281 - 10K
    660 x 283 - 10K
  • purplemonkeypurplemonkey Posts: 89
    edited 2012-08-01 03:08
    Thanks what was the range in feet ?
  • pedwardpedward Posts: 1,642
    edited 2012-08-01 09:35
    The software transmitter I did had a range of around 80 feet at 2mw without a proper antenna, just a resistor to act as a load/antenna.

    Phil, I was looking at that output, and it seemed to me that if you attenuated the output by 30 or 40db, then amplified it, you'd get a decent signal with low noise and sidebands. Is that too simplistic a view of RF?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-01 09:51
    pedward wrote:
    it seemed to me that if you attenuated the output by 30 or 40db, then amplified it, you'd get a decent signal with low noise and sidebands.
    It doesn't work that way. If you attenuate the signal and sidebands by 30 dB, then amplify the output by the same amount, you'll be right back where you started. On the dB (logarithmic) scale, that would be the same as shifting the whole curve down without changing its shape or relative amplitudes, then shifting it back up again.

    -Phil
  • Mark_TMark_T Posts: 1,981
    edited 2012-08-01 10:04
    Attentuating by 30dB and re-amplifying will also raise the noise floor by 30dB!! The basis of all good radio transmission is a low-noise, low-jitter local oscillator - its fundamental (pun intended).
  • purplemonkeypurplemonkey Posts: 89
    edited 2012-08-01 10:17
    What frequency is it on with a 5 MHz crystal, cuz I can't seem to get anything on a radio
    It's programmed EEPROM ok but still nothing
  • purplemonkeypurplemonkey Posts: 89
    edited 2012-08-19 12:06
      Bits wrote: »
      Not sure about this question as the propeller can output 3.3V at about ~40ma that will = .132Watts. I don't think this is what you are after though.

      So would that be 21.2 DBM transmitting power? What does that equate to in miles or km covered?
    • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
      edited 2012-08-19 12:37
      What does that equate to in miles or km covered?
      There is no formula for that. It all depends on the type and height of the transmitting and receiving antennae, the transmission line feeding the antenna, the sensitivity of the receiver, atmospheric conditions, and the presence of RF noise.

      I can tell you this, though: no purely Propeller-pin-based transmitter should ever be allowed to transmit signals that escape the workshop or lab. In the spectral analyses I've done, any Prop transmissions designed for VHF propagation are so dirty that they threaten to interfere with aviation, marine, and perhaps other emergency radio frequencies.

      If you want to explore this realm, do it with a proper sine-wave oscillator or low-jitter IC designed for the purpose. The Prop is neither.

      -Phil
    • Mike GreenMike Green Posts: 23,101
      edited 2012-08-19 12:37
      Transmitter output power has little to do with distance covered. That depends somewhat on transmitter power but mostly on how well that power is coupled into an antenna and how well the antenna radiates. It is possible and all too easy for inexperienced transmitter users to have a badly matched transmitter and antenna and have almost all of their signal converted to heat in the transmitter, cable, and antenna.

      Communication over thousands of miles on Earth can be done with power levels on the order of tens of milliWatts with a good quality signal and a good antenna well matched to each other. You could also have a 100W transmitter coupled poorly into a very bad antenna and be lucky to be heard a few miles away.
    • purplemonkeypurplemonkey Posts: 89
      edited 2012-08-21 12:43
      How do you match an antenna to the circuit then?
    • Mike GreenMike Green Posts: 23,101
      edited 2012-08-21 13:09
      That's a huge subject all by itself. Go to your local library and find a copy of the ARRL Amateur Radio Handbook and look at the chapter(s) on antennas and antenna matching. They also publish an Antenna Manual. You can find copies of these at your local Amateur Radio store or on-line.

      The Propeller operates at 3.3V and an I/O pin can provide maybe 20-30mA of current. That would require a load of 100 Ohms to 150 Ohms. You'd need some kind of antenna tuner, both to remove some of the garbage in the output signal and to provide a load of this magnitude for the Propeller's output stage. You must have a good antenna tuner and frequency specific antenna to do some filtering, otherwise you will just have a radio interference generator. If this causes interference to legitimate users, the FCC can seize your equipment and fine you. At a minimum, they can require you to dismantle your equipment and agree never to interfere again.
    • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
      edited 2012-08-21 13:36
      Mike,

      Based on the experiments I've done, it will take more than an antenna tuner to remove the out-of-band interference from the Propeller output. I've tried quarter-wave coaxial traps connected serially and both parallel and series-resonant LC tuned filters. None reduced the spurious signals to a low-enough level to be suitable for propagation. And that's just the out-of-band stuff. The in-band birdies are simply impossible to remove via filtering. That's why I've been discouraging this approach to Propeller RF generation, in favor of more analog approaches.

      -Phil
    • Mike GreenMike Green Posts: 23,101
      edited 2012-08-21 14:27
      Phil,
      I'm sure you're correct. You've discussed various aspects of this before. I would rather see people use some basic filtering and matching than none at all. That at least will reduce out-of-band interference. We had all hoped that we could use the Prop-1 for frequency synthesis, but the best we can do is controlling an external DDS chip. I know Chip has put more work on this front into the Prop-2, so maybe that will come to pass.
    • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
      edited 2012-08-21 15:24
      Mike Green wrote:
      I would rather see people use some basic filtering and matching than none at all.
      I definitely agree. I'm just afraid that tinkerers who might otherwise abstain from the effort will be emboldened if they think that a little bit of filtering will keep them out of trouble. Unfortunately, it won't. (Nor would I preach birth control over abstinence, if birth control were only 5% effective. :) )

      Maybe I should come up with a simple analog transmitter circuit that can be controlled by a Prop, so that people will have something clean to work with. There's a plethora of one-transistor wireless FM mic circuits on the web that could be adapted. A varactor to control the frequency and a frequency divider in the feedback loop could be the core of a Prop-centric DFLL/DPLL controller. Like you, I'm very anxious to see what Chip has in store for RF generation in the Prop II.

      -Phil
    • ercoerco Posts: 20,259
      edited 2012-08-21 15:36
      Excellent points and tech info, but all these points are moot. No one's gonna want to try a Prop after they see how much fun people are having with Mr. Microphone. "Hey Good Lookin, we'll be back to pick you up later!"
    Sign In or Register to comment.