Introduction: Squishy IR-based Switch

When we started building Clyde, our adorable adaptable lamp, we knew we wanted a satisfying interaction to toggle between the different lighting modes the lamp offers. We had an idea for a squishy silicone button that feels good to the touch, that is responsive, and sturdy enough to support repeat interactions.

We’ve shown Clyde to multiple people, and many are intrigued by the interaction with the silicone button, so we thought we should share how to create your own. Although our button is tailored to the shape of Clyde, we will try to write this Instructable so that you can adapt and integrate this squishy sensor into your own project.

The button uses a soft squishy membrane, in our case made of silicone, and an IR sensor to detect when the button is pushed (i.e. when the membrane is deformed).

The steps to follow are:
    1. Prep Materials and Tools
    2. Plan the Squish
    3. Make the Squishy Membrane
    4. Design the PCB
    5. Assemble the PCB
    6. Assemble the Squishy Switch
    7. Interpret Sensor Data

Also, check out Clyde on Kickstarter.

Step 1: Prep Materials and Tools

To make this squishy button, you will need:

    - a squishy membrane (step 2 and 3 cover how to make this part)
    - a custom PCB (step 4 and 5 cover how to make the PCB)
    - IR emitter and detector pair
    - 10Kohm resistor
    - 82ohm resistor
    - 22 AWG wire (preferably three colors)
    - four #6 screws (length depends on your design, we use 10mm (0.39”))
    - an Arduino (we use a Uno)
    - screw driver that matches the four screws
    - soldering iron

A few notes.

The soldering iron was late for the photoshoot, but you will still need one.

You will need the four screws to attach the squishy membrane and the PCB to the object you want to add the squishy button to. We use 10mm (0.39”) wood screws, which work well for our plastic prototype and the thickness of our button.

Go through the steps first as you may need some extra materials to make the squishy membrane and the PCB. We list a few options, some require more time, others require more handywork.

Step 2: Plan the Squish

First, you want to plan the characteristics of your squishy button. In our case, we wanted the button to be as large as possible for the casing we designed.

We decided that the visible part of our button should have a diameter of 68mm (2.68”). With the inside diameter chosen, we can define the outside diameter of the squishy membrane. The membrane will be attached to the outside case by #6 screws, so we need to leave enough space for the holes, which have a diameter of 5.18mm (0.20”). We found that an edge of 22mm (0.87“), distance between the inner diameter and outer diameter, gave us enough space for the screw holes, and enough surface for the support PCB. This gives us a squishy membrane with an outside diameter of 90mm (3.54“). (see image #2)

Other characteristics of the squishy membrane you’ll want to plan for is its material, thickness and hardness. We chose to use silicone because it feels good to the touch, and it’s fairly easy to prototype. We picked a thickness of 3.18mm (1/8”) with a shore 60, because it’s satisfying to push, and it keeps its shape well after many interactions. (see image #2)

Step 3: Make the Squishy Membrane

Many materials are available to make the squishy membrane at the center of your button, and as many techniques to shape the membrane to your requirements.

We chose to use silicone because it can be semi-transparent, a characteristic we require to shine light through, and also because we could easily mold multiple pieces of different thickness to find the one that feels best.

We list three options to make your squishy membrane. You can use a professional prototyping service to create a single part; this is fast and easy, but can be costly based on your location. Another option is to make your own mold, and cast the part in silicone; this is a flexible approach as you can quickly make different thicknesses, but it requires that you get your hands dirty. A third option is to use available sheets of squishy material and cut out a piece; this is fast, easy, and cheap, but less flexible as you need to use available thicknesses. See the three options detailed below.

Option 1: Prototyping Service
We were very fortunate when we prototyped our lamp. We used the services of Industri-Man, a rapid prototyping shop in Shenzhen, to quickly make the exact silicone part we needed. We made a 3D model of the part (see model file below), sent it to our contact at Industri-Man, and less than a week later, we had the exact squishy membrane to test. However, we know this is not practical for most people.

See the 3D model of our part in different formats in the attached "SiliconeMembrane.zip" file.

Option 2: Mold Your Own
If you’re handy, you can mold your own silicone part, which gives you a lot of flexibility, but takes more time and energy. This is how we made our early prototypes.

Find two sheets of acrylic larger than the outer diameter of the squishy membrane you require, like those sheets. For our 90mm (3.54”) part, we chose two acrylic pieces of 120mm x 120mm (4.72” x 4.72”). We picked a sheet thickness as close as the thickness that we require for our squishy membrane, 3.18mm (1/8”).

We found a place that offers lasercut services locally, and we cut a 90mm (3.54”) circle out of one of the acrylic pieces to match the outer diameter of our squishy membrane. (If you have a sizeable sheet of acrylic and you want to make lots of squishy membranes, you can cut several of these and cast them all at once.)

Next, we want to stack the acrylic sheet with the circular hole on top of a solid acrylic sheet, and bond them, to create the circular cavity that we’ll pour the silicone into. We used some acrylic cement, like this one, to bond the two layers.

Then, it’s time to pour your silicone in your acrylic mold. We have had good experiences with Smooth-On’s Smooth-Sil series and some mold release like Ease Release. Mix your silicone according to the supplier’s instructions (usually a 10:1 ratio by weight), apply your mold release to the acrylic mold, and carefully pour in the silicone. We let them cure in the open, but you can also clamp a third layer of acrylic firmly on top of the mold to close the cavity. Wait the required amount of time for the silicone you chose, and then take out your new squishy membrane.

This will give you a circular shape, so you’ll want to use a hole punch, like this one, to make the holes for the screws. Make sure they are in the correct locations because they will need to match the holes in the PCB.


Option 3: Cut a Sheet of Squishy Material
This third option is the fastest of the three, and still gives really good results. All you need is to find a sheet of material to use as a squishy membrane, and to cut the shape your require.

Amazon sells small silicone and rubber sheets of different thicknesses and colors that can work really well for a squishy button:
    - Natural (Gum) Rubber Sheet
    - Silicone Sheet
    - Silicone Rubber Sheet

Cut the outer diameter, 90mm (3.54”), from the sheet of material. Then use a hole punch, like this one, to make the holes for the screws. Make sure they are in the correct locations because they will need to match the holes in the PCB.

Step 4: Design the PCB

The PCB of our button serves two functions. It is a substrate for the electronic circuit of the IR sensor, and it supports the squishy membrane by attaching to the outer case of our lamp.

We designed our PCB based on Sparkfun’s Infrared Emitters and Detectors. The inner diameter of the PCB should match the visible inner diameter of the silicone part, which is 68mm (2.68”). Its outside diameter should match the outside diameter of the silicone part, 90mm (3.54”). This gives you a nice circular ring.

We then place four holes for #6 screw spread evenly around the PCB. The location of the holes on the PCB need to match the location of the holes in the silicone part.

Another important feature of the PCB is the location of the infrared emitter and detector, which should be across from and pointing at each other. D1 is the IR emitter and Q1 is the IR detector in the diagrams. (see image #2 & #3) 

Adafruit has a great list of PCB manufacturers, and a neat little page where you can calculate and compare the cost of your PCB across most of them.

You can download our Eagle files to speed things up, see attached "EagleSquish.zip" file.

If you don't have the chance to make a custom PCB, you can still make this design using a thin but hard ring made of plywood or cardboard. You want the ring to be hard enough so that it applies pressure equally on the squishy membrane to hold it in place. You can then use small perf boards glued to your ring to create the same circuit we defined in the schematics. (see image #3).

Step 5: Assemble the PCB

The circuit for the IR sensor is fairly simple. You’ll need:
    - a soldering iron
    - one IR emitter and detector pair
    - one 10Kohm resistor
    - one 82ohm resistor
    - three 22 AWG wires, ~150mm (6”), preferably different colors

Solder the four components in their respective location on the PCB. Make sure that the IR emitter and detector are well aligned and point at each other. If you used our Eagle files, the three wires connect to the three rectangular pads on the edge of the board. Those pads are made to use with a JST connector, but you can easily solder wires directly to them.

Step 6: Assemble the Squish Switch

Align the holes of your PCB, the silicone membrane, and the part you want to attach the button to. In our case, we have holes already in place in the plastic case of our lamp, but you may have something completely different. Use four #6 screws to attach the button to the case. Make sure that the screws are the correct length based on the thickness of your silicone part and of your PCB. We use 10mm (0.39”) #6 wood screws. You can also used spacers if you can’t find screws that are short enough.

Step 7: Interpret Sensor Data

First, connect the three wires to their respective spot on your Arduino board. You need to connect the 5V wire to the 5V connection, GND to ground, and the sensor wire to an analog pin, let’s use A0.

Our button is ready to go, now we need to interpret the data coming from the sensor to detect when the button is pressed. To the computer!

We wrote a BasicSquish sketch with a simplified cleaned up version of the code we use in our lamp to make it as clear as possible. See the attached "BasicSquish.zip" file.

A few notes about the sketch. It is a modification of the Analog > Calibration example, which samples values read on an analog pin for the first five seconds the sketch executes, and it saves the minimum and maximum values read.

Our modification uses the minimum and maximum values to detect when the membrane is deformed. When a value higher than the average of the minimum and maximum is detected, we output “squished!” to Serial.

Upload the sketch to you Arduino, and open the Serial Monitor. When it says “Start calibration...”, press your squishy button a few times. The minimum and maximum detected values will appear next. If you press the button again, you should see “squished!”