Maker.io main logo

Lights and Sound with Tiny FX W and Infrared

134

2026-07-23 | By Pimoroni

Courtesy of Pimoroni

Guide by Pimoroni

The Tiny FX range brings light and sound to your models and dioramas. Combining it with our new IR Receiver Stick + Remote Kit lets us remotely control our models and scenes via infrared from the comfort of our sofa. In this tutorial we’ll guide you through the process of wiring up and coding the project.

What you'll need

  • A Tiny FX W Starter Kit
  • Infrared Receiver Stick + Remote Kit
  • LED Noodles
  • Noodle Adapters
  • A model kit (we chose a Lego Millennium Falcon)

Substitutions

We'll be using a Tiny FX W in this project, but if you have the version without Wi-Fi you'll be able to wire it up in exactly the same way. You could use one of the mono LED dots or strips in the starter kit instead of the LED noodle (or multiple mono LEDs, if you connect them up using an expansion board).

Wiring up the project

With the components in the Starter Kit and the new IR receiver kit your project will soon be lighting up your bookcase and making lots of noise! And we don’t even have to whip out a soldering iron (unless you really want to).

Image of Lights and Sound with Tiny FX W and Infrared

Tiny FX W has purpose built connections for input and output devices. For this project we will be using the following.

  • LED Noodle
  • Speaker
  • IR Receiver

1. Connect the LED Noodle to port 1 via the noodle adapter. The adapter board has two connections, + and -. The + end of the noodle is marked with a small hole in the metal tab. Insert that into the + connection.

Image of Lights and Sound with Tiny FX W and Infrared

Image of Lights and Sound with Tiny FX W and Infrared

2. Connect the speaker to the 'AUDIO' port.

Image of Lights and Sound with Tiny FX W and Infrared

3. Connect the IR receiver stick to Tiny FX W’s 'S' port.

Image of Lights and Sound with Tiny FX W and Infrared

4. Check all of your connections before moving on.

Image of Lights and Sound with Tiny FX W and Infrared

Coding Tiny FX W

We’re using Thonny, an easy to use Python editor for this project. With Thonny we can write code directly onto Tiny FX W, and move files to the device. In this first section we will write the code that reacts to our remote control input. Then we will use Thonny to transfer an audio file that we wish to play as part of the diorama.

1. Connect Tiny FX W to your computer using a good quality USB C data cable.

2. Open Thonny and go to Tools >> Options.

Image of Lights and Sound with Tiny FX W and Infrared

3. Click on Interpreter, and select MicroPython (Raspberry Pi Pico) from the dropdown. Click OK to close the dialog box.

Image of Lights and Sound with Tiny FX W and Infrared

4. The Python Shell will update and confirm that we can communicate with Tiny FX W. If nothing happens, click on Stop to force the board to restart and reconnect. If the issue remains, try another USB cable.

Image of Lights and Sound with Tiny FX W and Infrared

5. Click on File >> New to create a blank file in Thonny. You'll need to copy and paste the following bits of code into this new tab - we'll be explaining what each part does along the way.

Image of Lights and Sound with Tiny FX W and Infrared

6. Import a series of modules to work with Tiny FX W and the new remote control.

Copy Code
import time  
from tiny_fx import TinyFX  
from picofx import MonoPlayer  
from aye_arr.nec import NECRemoteReceiver  
from aye_arr.nec.remotes import PimoroniRemote

7. Create an object to easily interact with TinyFX W and to specify where sound effects will be stored. We will get to that part later.

Copy Code
tiny = TinyFX(wav_root="/falcon")

8. Create a function to handle fading the LEDs connected to Tiny FX W’s first output (1). The function has two for loops. One will increment the brightness from 0 to 1 in 0.01 increments. The other for loop will decrease the brightness from 1 to 0 by 0.01 each time.

Copy Code
def fade_led():  
    for i in range(110):  
        x = i * 0.01  
        tiny.one.brightness(x)  
        time.sleep(0.01)  

    for i in range(110, -1, -1):  # count down from 110 to 0  
        x = i * 0.01  
        tiny.one.brightness(x)  
        time.sleep(0.01)

9. Next, create a function called flight() and use it to play an audio file. We’re using a mono 11KHz WAV audio file to keep the file size small. We only have 4MB of flash storage, so keeping file sizes small is important.

Copy Code
def flight():  
   tiny.wav.play_wav("flight.wav")

10. Create a remote object, that we'll use to interact with the IR receiver’s Python module.

Copy Code
remote = PimoroniRemote()

11. Configure button 1 on the remote so that a single press will call the “flight” function to play the audio.

Copy Code
remote.bind("1_RED", on_press=flight, on_repeat=None)

12. Create an object that links the code to the IR receiver, and then binds the receiver to look for a signal.

Copy Code
receiver = NECRemoteReceiver(TinyFX.SENSOR_PIN, 1, 0)  
receiver.bind(remote)

13. Start the receiver. This will make it ready to receive a signal.

Copy Code
try:  
    receiver.start()

14. While the Boot button is not pressed, set the receiver to decode any IR signals from the remote. Pressing the Boot button will exit the code.

Copy Code
 while not tiny.boot_pressed():  
        receiver.decode()

15. Using an if conditional, check If the audio file is playing. If it is, the fade_led function is called and will fade the LEDs in the Millennium Falcon to mimic a thrusting engine. The audio file is played if the IR receiver decodes that button 1 has been pressed. The audio playback is the trigger for the fading LEDs.

Copy Code
       if tiny.wav.is_playing():  
            fade_led()

16. In the finally block, we stop the receiver and shutdown Tiny FX W. This section is only called when the user presses Boot to stop the running code.

Copy Code
finally:  
    receiver.stop()  
    tiny.shutdown()

17. Save the code to the Tiny FX W as main.py. Thonny refers to the board as a Raspberry Pi Pico.

Image of Lights and Sound with Tiny FX W and Infrared

Adding an audio file

Image of Lights and Sound with Tiny FX W and Infrared

For this project, we used a 16-bit, 11025 Hz, Mono WAV audio file of a space engine. You can easily find audio files via your search engine. Using software such as Audacity, we can edit the audio to meet our needs.

To get the audio file onto the Tiny FX W, we need to use Thonny.

1. Click on View >> Files.

Image of Lights and Sound with Tiny FX W and Infrared

2. Note that the Files window is split into two areas. At the top are the files on our computer. At the bottom are the files on the Tiny FX W (Raspberry Pi Pico).

Image of Lights and Sound with Tiny FX W and Infrared

3. In the top area, navigate to where your audio file is located.

Image of Lights and Sound with Tiny FX W and Infrared

4. In the bottom area navigate to the folder where you want to store the audio file.

Image of Lights and Sound with Tiny FX W and Infrared

5. In the top area, right click on the file that you wish to send, and select 'Upload to'. This will copy the file over the USB interface to Tiny FX W.

Image of Lights and Sound with Tiny FX W and Infrared

Testing the project

1. Ensuring that all the connections are correct, press Tiny FX W’s reset button to start the code. MicroPython automatically runs any file called main.py.

Image of Lights and Sound with Tiny FX W and Infrared

2. Point the remote control at the receiver and press 1. You should hear the audio play, and the LEDs should illuminate. If nothing happens, check that you have pulled the plastic tab from the remote control’s battery compartment.

Image of Lights and Sound with Tiny FX W and Infrared

Conclusion

Using Tiny FX W, and a range of accessories including the IR receiver, you’ve just added light and sound to a diorama scene. This project could be expanded to use other IR remote inputs to trigger other effects. Laser fire, explosions, alarms, all are possible with Tiny FX W.

That's all folks!

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.