element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project Videos
  • Challenges & Projects
  • element14 presents
  • Project Videos
  • More
  • Cancel
Project Videos
Documents Raspberry Pi Pirate Radio -- Episode 355
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Project Videos to participate - click to join for free!
Related
Recommended
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 16 Aug 2018 7:56 PM Date Created
  • Last Updated Last Updated: 17 Aug 2018 7:24 AM
  • Views 6991 views
  • Likes 14 likes
  • Comments 53 comments

Raspberry Pi Pirate Radio -- Episode 355

image
Raspberry Pi Pirate Radio

element14 Presents  |  AirborneSurfer's VCP Profile |  Project Videos

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Matthew relives some of his youthful hacking by dabbling in a little "pirate radio" broadcasting. In this video, he builds a handheld FM transmitter from some salvaged parts and a Raspberry Pi. The Pi uses a piece of software to convert wav files to frequency-modulated signals emitted from GPIO pin 7. To improve transmission quality and prevent undesired signals, Matthew also designs and builds a band pass filter and seals everything in a shielded case.

 

 

Product NameQuantity
Buy Kit
Raspberry Pi 1 A+1Buy Now
Adafruit Powerboost 10001Buy Now
Rechargeable Battery, 3.7 V, Lithium Polymer, 1200 mAh, Connector1Buy Now

Jumper Leads

2Buy Now
100pF ceramic capacitors3Buy Now
5mm green LED1Buy Now
Toggle switch1Buy Now
Metal project enclosure1Buy Now
Micro SD card1Buy Now
  • geiger tube
  • e14presents_airbornesurfer
  • circuit
  • arduino ide
  • breadboard
  • matt eargle
  • vcp
  • arduino
  • friday_release
  • Share
  • History
  • More
  • Cancel
Actions
  • Share
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • airbornesurfer
    airbornesurfer over 7 years ago in reply to inghernandez +5
    Radio has a smaller reach, maybe, but don't ever doubt it's power!
  • ninjatrent
    ninjatrent over 7 years ago +5
    My ultra low budget pi zero pifm pirate radio from a few years ago. Trent
  • shabaz
    shabaz over 7 years ago +4
    Good to see the video addressing filtering, very cool. I have fond memories of mix-tapes being blasted via small pirate radio station in a friend's room at that same college that created PiFM.. : ) It…
Parents
  • nk85
    nk85 over 5 years ago

    This looks like a fun project to do with my son. I wasn't able to open this 'exclusive to members' content until I became a member. When I did I was expecting some more detailed documentation on this project, but only saw a parts list which, while helpful, wasn't necessary. Is there any 'deeper look' documentation? Particularly regarding the low & high pass filter circuitry? I'll admit I may be overlooking the link, but any help I would appreciate.

     

    Kind regards!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • airbornesurfer
    airbornesurfer over 5 years ago in reply to nk85

    Hi Nathan!

     

    This was one of the very early projects on element14 Presents, before we really got into our groove, so to speak, and I didn't get a chance to do much follow-up regarding band pass filters. However, since you've joined element14, you do have access to one of the largest communities of electronics engineers and enthusiasts to ask questions of!

     

    Feel free to drop questions in these comments, or start a post in the RF community!

     

    These links might be helpful to get you started:

    RF (Radio Frequency)

    The specified item was not found.

    Software Defined Radio Lessons with GNU Radio

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 5 years ago in reply to nk85

    Hi Nathan,

     

    I only had a look at the video now, I too agree with Frank's comments.

    Using online calculators alone will give unrealistic values unfortunately, although the math works, it doesn't know what your input signal is, and in practice you can't put a 0.01 ohm resistor across your signal (when you're working at high frequencies, the 100nF capacitor almost looks like a short circuit) and therefore cannot expect much output; the reason is your input signal has it's own resistance in the order of ohms or more, and a potential divider calculation can be used to see what the effect of that is.

     

    Also, nothing is ideal, a real-world component is different to a pure resistance, capacitance or inductance. A real resistor can be approximated to be a pure resistance in parallel with a capacitance and in series with an inductance! The reason is, because wires are inductors, and a resistor has two wires. And two plates are a capacitor, and a resistor has two plates at the ends (as well as millions of tiny ones inside the resistive material perhaps).

     

    Also, levels matter. The Pi outputs several volts, but a receiver can pick up 0.000001V. Some of the signal picked up by the receiving antenna will be from before your filter and get inside the receiver that way.

     

    Also, in the spectrum view, it will be hard to see a measurable difference between 103MHz and 102 MHz, because the one-stage filter isn't as sharp as this.

    This is another example where the online calculator doesn't care what inputs you give it, it will output stuff that isn't practical. It is impossible to have an RC circuit with such a narrow band as this. An RC filter has a slope, it isn't a sharp vertical line. Similarly even with an LC circuit, you'd need to start looking at a different topology, known as a resonant circuit for such a narrow band. Notice the filter designs pasted above from Frank and me are using a much wider bandwidth, and you can see the slope on the sides too, and the x-axis markings in MHz shows that the slope is significant. Another reason for the wider bandwidth is component tolerance, because it was anticipated in those designs that components won't be ideal.

    image

     

    Another thing is that power is needed out of the circuit to drive an antenna, and the RC filter calculators don't care about what load (the antenna is the load) you've got on the output.

    image

    The Pi transmitter is a great demonstration, but trying to eliminate harmonics will be hard without putting it into a metal box. If the output is very low and cannot be picked up with a receiver beyond a few meters, personally I wouldn't try to expend too much effort on the filter. If you intend to use it beyond the scope of a simple demo (e.g. like amplifying the output or trying to broadcast beyond say 10 meters would be outside the scope) then that's another matter (and there's the legalities of transmitting at particular levels and frequencies too).

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to shabaz

    Yes, thank you both again very much for taking the time to spell things out for me. I obviously have much to learn here, but I'm having fun trying my hand at the this filter. I did realize that I wouldn't be able to 'scrub' all of the harmonics out, but I thought at least (before completing the project in a box for shielding) the tool would show a measurable difference between having the filter plugged in and not - then even more so once in a box. I'll try my hand at the 3rd order bandpass filter, although for such a 'simple' project I might be pushing the budget; knowledge learned by doing knows no bounds thought right lol? Thank again. If get anywhere I'll post another video.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to shabaz

    Shabaz, for a lack of not knowing much better I'm going to stick true to your shopping list. Maybe I'm not reading into it right, but does this filter schematic dictate the FM frequency to be used? In previous tutorials and forums I was lead to believe that the specs of your components does.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 5 years ago in reply to nk85

    Hi Nathan,

     

    You're right, the values dictate the frequencies, and the schematic provides the overall shape. The values in either of the filters (the one in Frank's post, or mine) provide a reasonable bandwidth for this particular schematic. If you wanted much sharper cut-off, the circuit would need to change (it would need more components) and then it is harder to build because each part needs to be reasonably accurate. As it is, a few pF difference will make an impact to the filter, so the components listed are slightly more accurate than normal, and are also suitable for high frequency work.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to fmilburn

    Hi Frank,

     

    I'm really dominating the Q&A on this topic; starting to get embarrassed, but I need to clarify something - to be sure my understand is on the right track. Using your example from rftools, signals will only be attenuated starting below 90 and above 110? Meaning, as in my demo, if I transmit a signal at 102.9 and there is a foreign signal at 103.9, they can still have an affect each other? Or is it that everything within 90 & 110 is attenuated from each other? I'm beginning to doubt what I've learned and when I do I freeze from moving forward :-/

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to nk85

    HI Nathan,

     

    No worries, I am pleased to try and help...  Filters are usually specified at the -3dB point and a Chebyshev filter is considered to have a sharp response.  So, everything below 90 MHz in the design I posted is greatly attenuated as is everything above 110 MHz.  The band in between passes most of the signal although Chebyshev have more ripple and are not quite as flat as some of the other filter types.  This ripple is more easily seen in the design that Shabaz posted although mine would have it as well.  For this particular crude application I think we can ignore that however.

     

    As Shabaz has noted, there is variance in the components we are using and so it is necessary to have some kind of a plateau either side of the design point (102.9 in your case).  I had a look in my text which says Chebyshev are somewhat more sensitive to this but I think the design by Shabaz is sufficiently broad to cover that.  By the way, if I ever write something that seems to conflict with Shabaz, always go with what Shabaz says :-).  You could explore this by varying component value by their stated tolerance in the design tool if interested in the influence.

     

    Now, how much should we worry about other stuff sneaking into what is being transmitted?  And it is important to remember this is transmission, not reception.  I haven't really investigated the radio here but it is bit banging the output if I remember correctly.  That means the Raspberry Pi is generating rectangular output over time varying between 0V and 3.3V.  It gets rounded off but it is still a really ugly signal.  If we look at it in the frequency domain then there will be lots of harmonics at other frequencies.  This is of course undesired in transmission because it causes interference across the spectrum.  But how bad is it?  First of all it is really low powered so it isn't going to transmit too far anyway.  Nonetheless, it is interesting to try and attenuate those harmonics and get rid of undesired energy away from the design point.

     

    To give an idea of what happens, the FFT below is from a post I made a while back on entry level digital storage oscilloscopes with FFT capability.  It is a 49 kHz signal from a clock with a strong 148 kHz third harmonic.  The spikes that can be seen would be equivalent to the undesired transmission we want to get rid of.  Note that the 3rd harmonic and the primary signal are quite a ways apart (49 kHz Vs. 148 kHz).

    image

    Your signal won't look like this, just giving you an idea of what is going on.  If it was a perfect sine wave there would be no harmonics.  Your signal will have harmonics spaced some distance from the desired 102.9 MHz just like my FFT.  The idea with the filter is to make sure the radio transmission is inside the band pass and the harmonics or at least most of the undesired energy are outside of it.  Make sense?

     

    Frank

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to fmilburn

    Yes this is great Frank, a lot of good points here! One might accuse me of overthinking this project, but I have an OCD nature and you understand me with "it is interesting to try and attenuate those harmonics and get rid of undesired energy away from the design point". This is really about exploring what I can and cannot do. I obviously got the project working I just want to dabble and experiment with the filter side of things; clean it up if you will. Thanks again and until my next 'point of confusion'...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kmikemoo
    kmikemoo over 5 years ago in reply to nk85

    nk85  Forgive me if someone else has already mentioned this and I missed it but... you're using wirewound resistors (aka inductors).  You would have gotten better filtering if you would have used carbon film.  This little adaption cleaned up my pirate radio output.

    image

    As fmilburn states, the Pi is bit banging the signal out so I opted for a simple lowpass filter to attenuate the harmonics.

     

    Thank you for bringing this back up.  I've been thinking about digging back into trying to make this work at Amateur Radio frequencies.  Wow.  I hope I didn't try this a year ago with the lowpass filter in... image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to kmikemoo

    Good point.  And the breadboard added unknown capacitance as well. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 5 years ago in reply to fmilburn

    Hi Nathan,

     

    Frank's right, he picked a better filter design actually, and both should be good enough for your scenario.

    You had the right approach, exploring website calculators, it's just that the particular input and calculator produced something that in practice was more unrealistic.

    But this is the normal way, everyone uses the website calculators or software to design filters, and exploring how things change as values are modified, or as more stages are added (for steeper roll-off). It's a cheap way of virtually experimenting without needing to buy components, but it will be only as good as the values you feed it. For instance, if you known your components have (say) 5% tolerance, then you'd have to run your formulas or simulation with the different expected values, to at least see if the effect is significant or not. Prior to online calculators, people used tables from books.

    There are free simulators like LTspice for totally custom component configurations (as opposed to calculators which will only offer defined topologies), which you could use too, but for filter design and other small building-blocks it can be better to use online calculators, since they are pre-progammed with established topologies.

    When you come to want to test it with test equipment and draw the frequency response, the NanoVNA is probably a good way (quite low cost too), I've not used it, but there's several blog posts by others experimenting with it and it looks ideal for this.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • shabaz
    shabaz over 5 years ago in reply to fmilburn

    Hi Nathan,

     

    Frank's right, he picked a better filter design actually, and both should be good enough for your scenario.

    You had the right approach, exploring website calculators, it's just that the particular input and calculator produced something that in practice was more unrealistic.

    But this is the normal way, everyone uses the website calculators or software to design filters, and exploring how things change as values are modified, or as more stages are added (for steeper roll-off). It's a cheap way of virtually experimenting without needing to buy components, but it will be only as good as the values you feed it. For instance, if you known your components have (say) 5% tolerance, then you'd have to run your formulas or simulation with the different expected values, to at least see if the effect is significant or not. Prior to online calculators, people used tables from books.

    There are free simulators like LTspice for totally custom component configurations (as opposed to calculators which will only offer defined topologies), which you could use too, but for filter design and other small building-blocks it can be better to use online calculators, since they are pre-progammed with established topologies.

    When you come to want to test it with test equipment and draw the frequency response, the NanoVNA is probably a good way (quite low cost too), I've not used it, but there's several blog posts by others experimenting with it and it looks ideal for this.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • nk85
    nk85 over 5 years ago in reply to shabaz

    Hi there, I'm back at it for a bit. Some fun with paint lol - it's been ages. Can you tell if if I'm somewhat on point here? I've attached an untampered image if you want to use it to correct my mistakes. Thanks so much!

    image

     

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to nk85

    Hi Nathan,

     

    Those proto hats are nice as they allow the breadboard to be transferred directly to a more permanent solution.  I suggest putting it on a breadboard first, make sure it works, and then solder it like it was breadboarded.  There are some issues with it at the moment:

    • Rs is the supply resistance and won't be on your board
    • Rl is the load resist and is the speaker - it is not on the board either
    • Remember that the vertical strips on each side of the breadboard gutter are connected.  If wired as shown, it will be necessary to cut the trace which is unnecessary if wired differently.
    • Use the lead wires on through hole parts to minimize the soldering and no traces need be added to the back
    • The ground and +5V/+3V are already connected to the power rails
    • Run the wire to the input from the inside rail - as shown it is connected to the header that plugs into the Pi

     

    I'll try to mark up the board and post it in a bit.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to nk85

    Have a look at this....

    image

    I can't remember which pin is the one bit-banging on the Pi so check that.  There are lots of ways to lay this out but note that this will minimize soldering by using the leads on the components and traces on the protoboard to make the connections.  If you decide to string it out the same way as in the schematic that is OK but I like to put the wire on top of the board, and not bridge solder or put wire on the bottom as it is easier to see the circuit and I think looks better.  But that is just personal preference.

     

    You might want to flip it 180 degrees as well depending on where the speaker wires go which would also minimize the jumper length from the Pi pin to the filter input.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to fmilburn

    Wow, I really appreciate you taking the time to highlight those points and for marking up a sketch. By 'speaker' do you mean 'antenna'? Some of the components I was needing were only available in SMD, so to over come that I was going to use an adapter, of sorts, as in the image below. Meaning that I couldn't stretch it like you set it up. I'll either have to modify my bandpass components based on availability with 'through hole' or keep the schematic as I built it and make adaptations based on what you did.

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to nk85

    Doh!  Yes, I have been working on an audio amplifier :-)  Embarrassing sign of old age...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to nk85

    Which parts are the ones you can only get in SMD?  The reason I ask is that sometimes it is easy enough to solder them between 0.1" pads.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to fmilburn

    I might as well put it out there. I'm hesitant because I don't want to hear that it won't work lol. But the truth will 'set me free' - or 'not spend money where I don't need to. Tell it to me straight!

     

    image

     

    image

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 5 years ago in reply to nk85

    The LO201R68 inductor has a 0201 footprint - that is tiny and will be extremely difficult to hand solder.  I recommend at least 0805 if you are trying to hand solder SMD parts for the first time although 0603 aren't too bad.  The Bourns inductor has an uncommon footprint.  I see you have tightened up the band.  I suggest axial through hole where possible.  You can get most caps in SMD 0805 (your Kemet cap is 0805). 

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 5 years ago in reply to nk85

    Hi Nathan,

     

    Great to see you're really getting into filter design. As Frank says, the larger parts (0805, or, worst-case 0603) are needed. I don't think I've ever soldered 0201 (you'll also see why if you order one of those : ).

    Regarding the filter design, this looks valid, but in practice the issue you'll have is that all parts have a tolerance (maybe 2.5% or 5% etc), and if you choose to design such a narrow filter (1 MHz bandwidth at 100MHz) then there's a chance that the implemented filter could easily be off by a MHz or more. There's actually no need to implement such a narrow filter, because the output from the Pi won't (or won't have much) have anything apart from the harmonics, which are exact multiples. So, to guarantee that the filter works for your purpose, it is better to go for a more wider bandwidth filter.

    On another thread, Mike mentioned that you may not even need a bandpass filter, and a lowpass may be sufficient incidentally.

    Question on Harmonics and Filters

    There's no harm with a bandpass (provided it is of a wider bandwidth as mentioned), but according to that thread, you will likely be fine with just a lowpass filter.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nk85
    nk85 over 5 years ago in reply to fmilburn

    I would much rather use through hole components to be sure. But as I tightened up the band, it was asking for parts that didn't come available in through hole type. Reason being, for the tighter band, was to avoid other in-use frequencies near by (above and below the 102.9). Thats been a big part of it I guess, trying not to interfere with neighbouring in-use frequencies. Also the online catalogs (like Newark, DigiKey-Key & Mouser) overwhelm me; so many choices and so many factors to each choice. I'm definitely to rookie to be left to successfully choose the parts, so I've been delegating to the tech. support from each company to satisfy the schematic. That turned into SMD parts pretty quick. I can't always get it right the first time, and I don't suspect to, but this extracurricular interest might not be for a tight budget guy. If I could only get the part selection nailed down I shouldn't have to spend and re-spend because I didn't do my home work. Knowing the reason for the tighter band, what would your shopping list look like? I'd be interested in what Shabaz puts together too!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube