Introduction: Robot to Make Cool Music With Dry Ice!
What do you get when you put together some wind chimes, a bunch of solenoids, a myRIO and a block of dry ice?
Some very cool music!
I used an NI myRIO as a controller to send signals to solenoids attached to wind chimes, essentially making a robotic chime keyboard. But instead of the chimes being struck by a beater, they are being made to vibrate with a block of dry ice!
This barmy concept is easiest explained by seeing it in action, so check out the video below.
You'll see that the dry ice makes it possible to hold long notes, making a ringing noise like an alarm clock. The instrument plays MIDI files, so you can get it to play all of your favourite tunes!
Here's an explanation of what's going on:
Step 1: Tools and Materials
There's a fair amount of kit listed here, but don't let it put you off. A lot is unessential and depends on how you want your frame to look - I chose perspex so you get to see all of the wiring beneath, but could have easily gone with wood.
At the start of this project I had very little electronics experience, so don't worry if you're in the same boat! I'll provide all the instructions on how to wire everything up. The workshop skills are fairly basic, and the LabVIEW code is already written, so this should be accessible to people of any experience level.
The essential bits:
- Metal wind chimes - I went for this set of 22 bronze tuned chimes. Only 8 are used at a time, but it gives you a nice choice in notes from the C major scale.
- Dry ice slices This is what gives the instrument it's unique ringing sound. Don't purchase them yet, they will melt!
- NI myRIOas the controller. You'll need this to be able to run the LabVIEW code that I have written.
- 8 x Pull type solenoids i.e. they retract a plunger when a current is passed through them, rather than pushing it out. I went for these (12V 1A, 10mm stroke) - you want something with a reasonable stroke so you can accurately lift the chimes away from the ice.
- 12V power supply for the solenoids. I wanted to be able to play 4 notes at a time, so went for a 5A model to give myself enough current.
- 8 Channel 5V Relay board (like this) for the myRIO to control when the solenoids are energised.
- USB Pen Drive - to put the MIDI files on
For the frame:
- Wooden base board, A3 or larger and ~20 mm thick, quantity 1
- A4 landscape clear Perspex Stand-Up Sign Holder (like this), quantity 1
- A4 Landscape Acrylic Poster Menu Holder (like this), quantity 1. This has a 60° bend so saves you having to heat up the plastic.
- A4 Polycarbonate sheet, 3mm thick, quantity 2
- Pipe clips (15mm) to go on the end of the solenoids, quantity 8
- Small rubber bands (those used on orthodontic braces, but braid ties would probably do), quantity 8
- M6 threaded rod, length 1m cut into 4 x 0.2m and 2 x 0.1m
- M6 Wing nuts to make the platform easily adjustable. Quantity 8
- M6 flat washers, quantity 80
- M6 hex nuts, quantity 72
- M6 bolts, quantity 4
- M4 screws to keep the solenoids in place. Quantity 16
- M4 flat washers. Quantity 64, or 32 if you can find thicker ones.
- M4 antivibration rubber washers, quantity 6. (Or a PCB mounting kit could do the same job)
- Sticky labels for the chimes
- 2+ polystyrene plates or cups.
- 13 Jumper cables/Dupont wires - female to female
- 1m or so of single core wire, coated with PVC
- Superglue - plenty of it!
- 4-6 rubber feet to stop the bottom of the assembly from scratching surfaces
- Sellotape (!)
- Thin sponges or kitchen cloths to put the dry ice on
- Velcro to fix the myRIO down with, or you can use 2-3 M3 screws
- A water bottle or beaker to drop spare bits of dry ice in and create fog - adds to the ambience!
- Computer with LabVIEW and Real Time module installed
- Workshop tools including...
- Powered drill with 6mm and 4mm drill bits
- Appropriate workshop PPE such as goggles
- Gloves for handling dry ice
Step 2: Put the Pipe Clips on the Solenoids
Get started with a simple but fun task - put the pipe clips on the end of the solenoids. These will be supporting the chimes when the note is not being played.
The pipe clips that I had bought already had small holes in them, but I found that I had to expand these out with a powered drill in order to fit on the end of my solenoid plungers. I secured them in place on the solenoid with a drop of superglue. They sort of remind me of the hands on Lego men.
Step 3: Make the Circuit and Get the Solenoids Working
Now it's time to get things moving with the relay board and solenoids. Above is a few seconds of footage of what you're aiming for.
For tasks like this, it's worth getting the simple stuff working before you worry about the trickier bits. E.g.
- First of all, can you use the 12V supply to get your solenoids to contract?
- Then, can you wire up the relay board's supply and ground, and test one relay? You should hear a click when you connect the +5V pin.
- Next, can you test all relays using NI MAX test panels (or similar) to set the DIO on the myRIO?
- Then can you get the relay to pass 12V when on?
Only then wire everything up fully as in the diagram. This step-by-step approach makes it a lot easier to troubleshoot.
Why do you need the relay board?
The myRIO can't supply enough current for the solenoids, so it's necessary to make a switching circuit for another power supply. You could do this with transistors, a soldering iron and a lot of patience, but it's much quicker and simpler to buy a relay board instead. See the attached photo and image for how I wired mine up.
What's going on here is that the DIOs from the myRIO tell the relay board when to pass the current through the solenoids, and the board is powered from and grounded to the myRIO's 5V and GND terminals respectively. There is then a separate 'power rail' circuit that provides a 12V supply, but this is only passed through a solenoid when the switch is active.
The power rail is cannibalised from a breadboard, and again I used my best friend superglue to keep the wires in place.
The power supply that I bought has a nifty terminal block so I didn't have to expose the wires to access the ground and supply. If not, carefully split the two cables down the middle and strip to expose the copper, then twist the strands so they don't separate.
Step 4: Make the Frame Components
I wanted my frame to be easily adjustable, to cater for different chime lengths and dry ice block sizes. That's why I built it around threaded rods and wing nuts.
To see the dimensions that I used, download the CAD model at the bottom of this step.
The steps are as follows:
- Chop the threaded rod into 2x10cm and 4 x 20cm lengths with a saw
- Drill 6xM6 holes through the base board, with the dimensions as in the CAD model
- Make the platforms by drilling 4xM6 clearance holes in perspex*. You can use the base board as a template
- Make the chime holder by cutting down the menu holder (the one with the 60° bend in)
- Create squares of polystyrene. I did this by cutting the ends off cups then unravelling and chopping down to size, but it would be easier to use polystyrene plates if you can get hold of them.
- Make the solenoid holder by cutting down the sign holder (the one with the 90° bend in). Keep the leftover bits
- Use the leftovers from the previous step to make the protective shield.
Be careful when cutting perspex because it can splinter - it's worth wearing goggles and reading up on it beforehand.
We'll assemble it all later, hold on to the bits for now!
Step 5: Label the Chimes
The user needs to know which chime note is which when they're swapping them in and out, so it's important to add labels.
I was lucky enough to have access to the nifty office label maker, but you could easily use pens and sticky labels or print some out from a computer.
While you're here, put an elastic band on each chime at the point where the holes are. This will stop it from slipping out of its slot.
Step 6: Assemble Hardware
By this stage you should have all the parts for the frame together, so you're ready to build this thing!
- Thread an M6 nut to the end of each of the threaded rod lengths, and superglue in place to keep it from travelling. Add a washer on top.
- Use one of the A4 perspex pieces to mark the holes for the threaded rod, and drill clearance holes through your baseplate. The dimensions that I used are in my CAD model.
- Mount the PCB on antivibration washers, to protect it from knocks and induced stresses.
- Screw and glue the power rail to the base board from underneath
- Assemble frame as in CAD model, using washers around each nut to spread the load.
- Make the solenoid holder by sandwiching the polystyrene between the smaller pieces of perspex and screwing in place. You might want to be able to move this later on depending on the length of chimes you are using, so I fixed mine down with sellotape.
- Add the circuit to the frame by screwing each solenoid to the holder. Play around with positioning until you are happy.
- Mount the myRIO using velcro or screws through the mounting holes.
- Position the water bottle somewhere where it is visible and glue it down if you wish.
- Cut up the cloths or sponges to give yourself an insulated surface that you can put the dry ice on.
- Glue a plastic foot to the bottom nuts if you're worried about it scratching any surface that it sits on.
The solenoids have a violent kick to them, which I found was strong enough to loosen bolts after it had been running for a while. To avoid bits flying everywhere, I'd recommend using superglue to glue the nut at the end of each solenoid plunger in place, and also on the nut that attaches the solenoids to the frame.
Step 7: Download and Deploy the Code
This is a multistep process, because you need to let the computer know the IP address of your myRIO and compile the FPGA bitfile on your device.
To deploy the code on your own myRIO:
- Download the zip file at the at the bottom of this post and unzip.
- Plug in a pen drive to your computer and copy the 'Music' folder (only) to a pen drive at the root directory, e.g. it might look like D:\Music\ on your computer, if your pen drive was in the D drive.
- Transfer this pen drive to your myRIO.
- Plug in your myRIO to the computer using the USB A-to-B cable. Open up the lvproj file.
- Look up the IP address of your myRIO (e.g. in NI MAX) and replace it in the project by right clicking the myRIO and selecting 'Properites'. Once you have put in the IP address, it should update with the name of your myRIO.
- Under 'Chassis' in the project, open the FPGA Main.vi and run it to compile. I'd recommend using the cloud server.
- Right click the myRIO project item and select Deploy.
- Open up Main.vi to get ready for the next step.
Step 8: Add Dry Ice, and Make Some Music!
Now you're all good to go!
Wearing gloves, carefully put the dry ice on the sponges and adjust the height of the platforms using the wing nuts, until the chimes impact the dry ice on their down stroke. Now you can select a song on the UI that you set up in the last step, and make some music!
For example, here myDryIceChimes plays Beat it by the King of Pop, Michael Jackson.
Step 9: (Optional) Expand the Song Choice by Adding Your Own MIDI Files
So do you want to play a track other than the ones provided? No problem!
You’ll need to make a MIDI file, plus an ini file to tell the myRIO VI which notes you will be using in the note slots.
How do I make a MIDI file?
You can download free software like Anvil Studio, a web tool, or export a file from music notation software such as Sibalius.
What is the format for the ini file?
There are two sections in my ini file: Note Allocations and Track No. For the format of the ini 'keys', use notepad to open an existing ini file from this folder and take a look! I'd recommend copying and editing an existing ini file, then giving it the same name as your midi file.
The midi numbers for C major are shown above. Google 'MIDI note mapping' if you get stuck.
Which track is my MIDI data in?
MIDI consists of a number of layered tracks, so this will depend on the file that you are trying to play. You can use a free piece of software called Anvil Studio to open up the MIDI file and see what data is in each track. You can also use this to merge a number of tracks together - export it as a new MIDI.
Enjoy, happy music making!
We have a be nice policy.
Please be positive and constructive.