# PhatBeat + IR Receiver - Extending Pirate Radio

**URL:** <https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753>\
**Category:** Raspberry Pi\
**Created:** [January 14, 2020, 11:34pm UTC](https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753 "2020-01-14T23:34:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikecsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/mikecsmith/32/6289_2.png) [@mikecsmith](https://forums.pimoroni.com/u/mikecsmith)\
**Post date:** [January 14, 2020, 11:34pm UTC](https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753/1 "2020-01-14T23:34:03Z")

</div>

Hi all,

Hoping I can get a bit of help.

I’ve just gone a bit nuts buying Raspberry Pi’s to put together a number of projects over the next few months - also to learn Python as I mostly use JavaScript/Ruby/C/Swift for my job and want to get in on some Machine Learning goodness eventually.

One of the kits I bought is the Pirate Radio kit with the intention of building my 2.5 year old son a bedtime audio book device.

I work as a software developer so am confident of my coding chops but I know next to nothing about hardware. One of the ideas I’ve got for modifying the Pirate Radio kit is connecting an IR receiver to the Zero W along with the PhatBeat and using a little remote I have lying around to give the radio some extended functionality - current thoughts are:

1. Mode switching via remote so I can switch it between being an AirPlay speaker, an internet radio and an AudioBook player.
2. Adding a button via the remote to give it a timed fade out so it gradually gets quieter.
3. More general commands like play/pause/fast-forward via remote.

So my core question is this:

**Given I know next to nothing about hardware - does anyone have any idea how (or even IF) I could attach an IR Receiver to the Zero W whilst the PhatBeat hat is attached? i.e. given the PhatBeat will cover all the GPIO pins could I just solder the IR receiver onto the correct GPIO pins underneath the board or is that going to cause me issues?**

If the IR receiver is a no go I could probably write a little iOS app to allow control via the Bluetooth module but I kind of want to get the remote working :)

Thanks for the help - if I get this working I’ll open source the code! :)

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [January 15, 2020, 12:28am UTC](https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753/2 "2020-01-15T00:28:11Z")

</div>

Welcome to the forum!

There’s this:  
[https://www.amazon.com/dp/B06XHGJG7Q/ref=psdc\_3230976011\_t2\_B07J2PWNWF](https://www.amazon.com/dp/B06XHGJG7Q/ref=psdc_3230976011_t2_B07J2PWNWF)

although I can’t recommend anything in particular. BCM Pins 14 & 15 are the UART pins on the Pi and you should be able to write something to read/write them to control a Pi.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 15, 2020, 11:26am UTC](https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753/3 "2020-01-15T11:26:55Z")

</div>

I had a go at that a while back. I got it to work, but my setup wasn’t reliable for some reason. My remote would just stop working and I’d have to get up and push a button anyway. Might have been the really inexpensive (cheap ;) ) remotes I was using though.  
Here is the thread if you want to have a go yourself.

> [@Use a media keyboard with your pHat Beat, can it be done?](https://forums.pimoroni.com/t/use-a-media-keyboard-with-your-phat-beat-can-it-be-done/5176):
>
> Is there a way to use a wireless keyboard, namely the media keys, with the pHat Beat Pirate radio setup? I plugged my mini WIFI keyboard dongle in but nothing happens when I press volume up down etc. I’m running the Full Raspbian, its just set to boot to command line instead of desktop GUI. This would be a really nice add on feature as those little side buttons are a bit tricky to push. If it had worked, my next step would have been to plug my FLIRC in and use a remote control to change channels…

---

<div class="post-metadata">

**Author:** ![mikecsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/mikecsmith/32/6289_2.png) [@mikecsmith](https://forums.pimoroni.com/u/mikecsmith)\
**Post date:** [January 15, 2020, 1:02pm UTC](https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753/4 "2020-01-15T13:02:10Z")

</div>

Thanks!

I have one of the original FLIRC’s lying around the house somewhere I think - used to use it on a media PC. Might see if I can dust it off as a first pass at this - end goal is to just wire an IR receiver direct to the GPIO but proof of concept with a FLIRC is a nice idea!

EDIT: Looking at your code right now - damn that’s nice - you’ve done a really large part of the initial work I was thinking about doing. Do you mind if I use your code as a base and extend from it? We could open source it at that point, do some setup/config stuff and host it on GitHub for anyone else who wants to run something similar.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 15, 2020, 1:11pm UTC](https://forums.pimoroni.com/t/phatbeat-ir-receiver-extending-pirate-radio/12753/5 "2020-01-15T13:11:53Z")

</div>

I started out just wanting to use the media keys on a mini wireless keyboard. Play, pause, volume up down etc. Then I remembered I had a FLIR in my parts box and got it out. That let me use an IR remote control which I figured would be better, and it freed up my mini keyboard for something else.  
I had it all working, it just wouldn’t stay working. I likely needed some error handling code in there some place but that was and still is above my skill level.  
Eventually I had to do a clean install and just didn’t bother setting up the remote control function. I now have some easy to push mini arcade buttons on top of my pirate radio enclosure.
