micro:bit Powered FM Radio
Features

micro:bit Powered FM Radio

Jez Whitworth
Jez Whitworth

Have you ever wanted to create your own radio station? Well, maybe you can take inspiration from this project by Jez Whitworth who built his own home radio station from old parts and using a micro:bit to handle the power management and broadcast schedule.

Radio has always been something that has fascinated me. When I was young I would find myself staying up late, scanning the airwaves to listen to local radio phone-ins and plays whilst occasionally stumbling on random stations that didn’t fit the usual format. Straight away these stations intrigued me, they were rough around the edges, had a somewhat amateur indie feel about them and broadcasting music and talks not normally covered by the mainstream stations. I instantly fell in love with them. I later learnt these stations were the work of pirates, illegally invading the megahertz to reach out to audiences with alternative content. Whilst this activity is illegal in most countries (something that made me appreciate them even more now that they had a risky edge to them), the pre-internet me loved this idea of producing content and distributing it to an anonymous audience huddled around their radios, casting their nets into the airwaves to see what they can catch. These days with the internet so ingrained in our every day, it’s all too easy to record your shows and broadcast it online, but despite these advances in technology, radio still remains as popular as always and is still a subject that interests the older me a great deal.

Over the years, ideas have had to take a backseat due to life but now with the explosion of the maker movement in recent years, there’s never been a better time to start building. My first project efforts involved experimenting with the various Raspberry Pi FM radio projects already out there, of which I had varying degrees of success. Rather than try and reinvent the wheel, I decided to base future builds around components that I already had in the workshop in the hope of developing a better radio project, all the while learning some new skills along the way. The Pirate Box was the result.

Hardware used:

  • micro:bit
  • In-car FM transmitter
  • Servo motor
  • TIP120 transistor
  • Diode 1N4004
  • 1k resistor
The Pirate Box

At the heart of the Pirate Box sits a small FM transmitter, the sort that was popular a number of years ago if you wanted to play your MP3 player through your car’s radio. I managed to pick up a couple at a charity shop a couple of years ago thinking they would come in useful one day. I prefer these older transmitters to the more modern ones as they seem to broadcast further, allowing me to cover the whole of my house. They also broadcast on frequencies at the top of the FM range, around 107 MHz which ensures that despite their range being kept to a local level, you don’t run the risk of masking other radio stations broadcasting on the more popular frequencies and interrupting everyone’s listening enjoyment. If the FM transmitter is the muscles of the project, then the micro:bit is the brains of the operation.

The micro:bit has two roles: Its first job is controlling the raising and lowering of the external aerial via a servo motor to allow for greater broadcasting range. Servo motors are easily programmed using the Servo Write blocks found in the MakeCode editor. The second task of the micro:bit is to keep everything running to a schedule and only activating the FM transmitter and aerial deployment when necessary in order to conserve power. This was achieved through the use of the Digital Write blocks with the pins connected to a TIP120 transistor.

It’s surprising how much you can get out of just three pins. Whatever project you’re making, the micro:bit simulator is a great way to test out ideas before committing to the building phase.
It’s surprising how much you can get out of just three pins. Whatever project you’re making, the micro:bit simulator is a great way to test out ideas before committing to the building phase.

Whilst there are suitable add-ons for the micro:bit that will give you control over things like motors, lights and in this case transmitters, for a fraction of the cost you can do it yourself by using a TIP120 transistor. The transistor is able to act as a switch, allowing power to flow through it when passed a signal from the micro:bit. By intercepting the transmitter’s battery with the transistor, I was able to control the power being sent to the transmitter with a simple output from one of the micro:bit pins.

With a great many connections comes a great mass of wires. The housing for the Pirate Box had to be big enough to accommodate not only its components but also the mass of wires.
With a great many connections comes a great mass of wires. The housing for the Pirate Box had to be big enough to accommodate not only its components but also the mass of wires.

The final thing to consider with this build was the housing. I set about designing nice, functional cases on paper first before 3d printing them but after a number of failed attempts, the best design turned out to be the simplest. Featuring a single switch at the front, the Pirate Box has been printed to a size that allows it to hold all the components safely, protecting them from the weather if the box should ever be used outdoors. The Pirate Box is able to stand on its own making it truly portable or be fixed to a wall.

As well as a keen interest in radio, I am also a big fan of chiptunes. I really like the Pirate Box project as it allowed me to combine my two interests: 8bit music and radio. Taking full advantage of the Start Melody block to play a range of preset tunes, I was able to output the music via another of the micro:bit’s pins, feeding it through to the FM transmitter via its headphone jack. Incidentally, if you want to broadcast something a little different, it’s this jack that can also be used to feed in and broadcast non-micro:bit content, such as your own recordings from an external MP3 player. This instantly opens up a whole world of possibilities and whilst helping achieve your childhood ambition of becoming that popular DJ you’ve been dreaming about for years.

Improvements

Now that the Pirate Box is up and running, thoughts turn to improve the build. Here are the top three ideas that are either being considered or are currently being worked on.

Boosting the range: Another advantage of choosing the older models of FM in-car transmitter over the more modern ones is that they can easily be hacked to increase their range and if you’re interested in doing this, then a quick Google search will reveal a variety of methods. Since the initial build, I have experimented with boosting the range of the Pirate Box’s transmitter to allow coverage of the whole garden and the woods beyond, providing the village dog walkers with something different to listen to as they stomp on through.

Poetry corner: I would like to rewrite the project in Python in order to introduce additional features not available through the blocks editor. I’ve previously used the speech tutorials found online to get the micro:bit to talk, it’s not perfect but still a great deal of fun. What if the Pirate Box was able to generate and read out its own poetry over the airwaves. Now imagine yourself listening to the radio whilst walking the dog through the village woods and being read random poetry, in a somewhat DALEKesk voice, through your headphones.

Sensors: The micro:bit is an amazing board packed full of sensors, so it would be a shame not to put those sensors to good use. I would really like to experiment with broadcasting sensor data, such as temperature, back to the house every hour. It’s not quite the Shipping Forecast I loved listening to late at night all those years ago but I would like to think the younger me would approve.

Maker Kits

From start to finish, this has been a really fun project and one that has allowed me to sharpen my existing skills whilst learning one or two new ones along the way. In an attempt to pass on what I have learnt and encourage others to get creative, I’ve put together a simple kit consisting of the necessary components in order for micro:bit users to hack and control hardware themselves, in a similar fashion to how the transmitter is being controlled with the Pirate Box.

These maker kits are a combination of components and knowledge learnt from the build to help encourage others to get creative with their projects.
These maker kits are a combination of components and knowledge learnt from the build to help encourage others to get creative with their projects.

These kits have been distributed amongst my pupils and the results have been great to see. There have been some truly creative hardware hacks built during the school breaks with more and more pupils getting interested in coding things in the real world. One simple radio project, built on a kitchen table is now inspiring a new generation of hackers and I hope by showcasing the Pirate Box, it has managed to inspire even more.

Twitter: @RocketJez

Website: rustyrocket.co.uk

Video: https://youtu.be/8T25oqJO1QQ