Building more pressure sensors

In a recent post, I described the work so far on making low-cost pressure sensors.  One of the key components in that was a MAX406 Operational Amplifier (Op-Amp) chip to handle the high resistance of the sensors.  However, when I went to design a PCB around this, I discovered to my extreme inconvenience that the IC is actually obsolete, and there is just some dregs of stock around.  So I need an alternative.

While thinking about alternatives to the MAX406, it occurred to me that the impedance of my sensors might not be too high for the Arduino's analog to digital converters (ADCs).  This would not only save the cost of the op-amp chip, but would save me having to find a suitable one :)

The ADCs basically need a voltage that varies with the resistance of the sensor.  I could just connect one pin of the sensor to the ADC, and the other pin of the sensor to either ground or +3.3V, but it would be relying on the current leakage of the ADC to provide it with a reference voltage.  Trying that out confirmed that it was not that great.

The next option was to keep the resistor ladder from the Op-Amp based design, but just skip the Op-Amp.  That seems to work reasonably, although perhaps the sensitivity at high pressure is not that fantastic.  A further simplification is possible to just have one resistor in-line with the sensor, and use that to make the voltage ladder. I.e., have the resistor connected to +3.3V on one pin, and the sensor and ADC on the other pin. The other pin of the sensor would then be connected to ground.  This should give greater voltage variation compared with having the full resistor ladder, and indeed it seems to work ok.

I would like to increase the voltage range of the sensor a bit more, so maybe I can drop the 10M Ohm resistor to a smaller value.  Dropping to 5M Ohm doesn't seem to make any real difference. So I'll just stick with 10M Ohm.  In any case, the part count has been reduced to 1 resistor, and dropped from about $3 to 3 cents.

So time to design up a simple PCB that can connect 6 pressure sensors to the 6ADC ports of an Arduino. Ideally I would be able to connect many more than that, as I will probably need at least 6 sensors on each side of the horse, another 4 at least under the saddle, and then some on the neck and some in the mouth. There are some analog switches that I could potentially use, that would allow me to have at least 2x as many sensors connected, and more if I add more of them in a chain.

The 4066 series of analog switches has been around for decades, and are dead cheap. I know them from their use in the Commodore 64 home computer. According to this datasheet, the current leakage when switched off is 10pA, which should be well below the current that the sensor delivers when active.  At 50M Ohm maximum resistance, that would correspond to 20nA, i.e., over 3 orders of magnitude greater than the leakage current.  These chips are also in plentiful supply, and cost less than a dollar each, and can switch 4 lines each.  By cascading them, it should be possible to select from a large number of banks of analog inputs -- assuming I can multiplex them without losing accuracy.

It's also worth considering applying a much simpler horrible hack: Power the resistor ladders using GPIOs on the Arduino, and switch only one resistor ladder on at a time, but have several connected in parallel.  This would be super cheap and simple, because no ICs would be required.  The problem would be the current flowing between the ladders. Tri-stating the ladders wouldn't help either, as the tri-state current leakage is likely to be similar to the low current of the sensor itself.  But it is a tantalising option, precisely because it is so horribly simple and cheap.  However, despite how much I might wish that it would work, I don't think that it can. So back to the 4066s...

If I use 4 digital GPIOs on the Arduino, I can select each of the 4 lines of the 4066 multiplexors independently. If I tie the outputs of all 4 lines on a given 4066 together, and the inputs to separate sensors, I can get 4x the number of analog inputs, with a still quite simple design. 6x4 = 24, which should be enough for the left side, right side, saddle, neck and mouth.  So that sounds like an attractive option. I think I even have a 4066 or two in my IC stash, so I can at least test the circuit before designing a PCB and sending it off for fabrication.  I'll also need to make up some more of the pressure sensors, so that I have enough bits to make a meaningful test.

Well, I _thought_ I had some 4066s laying around... Jaycar have one variant of the 4066, but it might not have quite low enough leakage voltage, but I can invest the princely sum of $1.55 in buying one tomorrow, and trying it out.  If it works, then I can design up a quick Arduino shield around 6 of them.

(There is already an analog input expansion shield for the Arduino, but it multiplexes only a single ADC input, which I think would mean that my sample rate on each sensor would be too low for my 50Hz hum rejection filter algorithm.)

But first, I need some more pressure sensors built up, so I got the extra parts I needed today, and set about building them.  Having done it once already, I was a bit more prepared.  Also, as I wanted to make several, I used a more production-line approach, doing the same step on all 5 I was building, before moving onto the next step.  As a result, the process was much faster: It took me maybe 4 hours to make the five from scratch, compared with about 3 or 4 hours each for the first two.

So let's walk through the process:

1. Cut anti-static foam and horseguard or similar electric fence tape into pieces about the same size. The width of the fence tape will dictate the width you need for the anti-static foam.  I used the foam from Jaycar Electronics.  I can get 5 x 45mm wide strips from one AU$16 sheet of foam.


2. You need two pieces of foam for each piece of electric fence tape:

This part is pretty easy, and after a few minutes I had all the parts for 5 sensors cut:


3. You will also need some wire to connect things. A cheap and easy way is to rip-apart from cheap CAT5/6 or similar Ethernet cable. This contains 4 nice twisted pairs, so you don't have the individual wires coming apart.  It's also fairly easy to make a slot cut in the blue sheath, and then pull on it and the cable to tear the sheath along the whole cable length to get the pairs of wires out.

4. You will also need some copper tabs for the contacts, as soldering directly to the electric fence tape is a horror, or uses chemicals that are super nasty.  I got a sheet of ~1mm thick copper from the local hobby store, and used some snips to cut pieces about 10 x 20mm, which I then fold part way around, so that I don't have to try to fold them after soldering on the contact wires:
5. Fold them all! You need 2 for each sensor.
6. Tin one side of the folded tabs, so that you can easily attach the wires after:
Here is my little army of them all tinned:

7. Prepare the wire pairs by unwinding some of the twists at one end, so that they can line reach where you want to put the contacts on the sensors. Note that the contacts have to be on opposite sides, so that they aren't both connected to the same wires running the length of the fence tape (remember that these sensors work by having the high-resistance anti-static foam bridging the wires in the fencing tape).

8.  Now solder the two wires onto contacts. It is helpful to tin the wires first, of course.

These are a little bit fiddly if you don't have something to hold the tabs still. But after a short while, I had all five done.

9. Now using a small wad of stainless-steel wool inside each copper tab, squash them onto opposite corners of the electric fence tape. Use pliers to crimp firmly.

Again, after a short while, I had my nice little pile of pieces:


 On the topic of the steel wool: It needs to be stainless steel, so that it won't rust, as its job is to improve the contact between the copper tabs and the stainless-steel wires that run through the electric fence tape.  I used about half of one steel wool pad for all 8 sensors I have built so far, leaving this much remaining, so you can get a sense of just how little you need:
10. Next, put insulation tape around both ends. It must cover the copper tab and the steel wool, so that these don't make contact with the conductive foam. This is important for the low-pressure sensitivity of the sensors, as that comes from the stainless steel threads in the tape not touching the conductive foam when the sensor is not being pressed on. (The high-force sensitivity comes from increasing the surface area of the foam material in contact with the stainless-steel threads reducing the resistance of the circuit).
11. Now place a piece of the conductive foam in front of and behind the electric fence tape, and use more insulation tape to tape around the ends to hold it all together.

12. Cut some squares of fabric to be used to contain the sensor.  These should be quite a bit larger than the sensors, so that you have flaps on all four sides after it has been stitched into place. Those flaps can be used to easily stitch it onto an object, when it comes to assemble everything.  I used 21x22cm pieces for my 180x45mm sensors.

13. Stitch one sensor in each fabric square, leaving some flap on all four sides:
My sewing speed and technique, while still quite rough, improved noticeably as I progressed with these, and I was able to stitch each one in in about 12 minutes in the end, leaving my with my nice pile of sensors:


The cost of these sensors has worked out to about AU$7 each. I'm guessing I will want 6 -- 12 on each side of the horse to cover the overall active area for leg aids, resulting in a cost somewhere around the AU$50 -- AU$100 mark, plus the Arduino and other minor components, for perhaps another AU$50.  So it looks like having a good leg sensor system should be possible for around AU$200 -- AU$250, which sounds acceptable to me in the first instance.

But it's now Sunday night, so wiring the sensors all up to the Arduino, and attaching them to a cloth I can lay over my mechanical horse body will now have to wait until another day.

Comments

Popular posts from this blog

A busy long-weekend rebuilding and improving the machine

Why do I want to build an open-source horse riding simulator?

Converting reins input to key presses for Unbridled: That Horse Game