Week 13: Sensor Success and Next Steps

 

I got the baby kick sensor working! I had big dreams of creating the piezoresistive pressure matrix by sewing contacts with conductive thread, but it turns out that making circuits with conductive thread super sucks. So, I used ShieldIt Super, which is a conductive fabric that you can just iron on, and it’s amazing. Using ShieldIt to make a sensor is kind of hilariously ironic, because the company that makes it (Less EMF), creates fabrics to cater to people that are paranoid about electromagnetic radiation. So, while they’re marketing fabrics to protect people from electricity, the irony is that their materials are extremely good at conducting electricity and for creating wearables. I ironed the ShieldIt on to some pieces of old pajama pants that didn’t fit (upcycling for the win), put some velostat in between, and that’s how you make a 40-point pressure sensing matrix.

 

I also got my visualization sketch working (link to code here). This is what the baby kicks will look like coming out of the sensor:

Click on the box to start the program.
Spacebar for full screen.

My brother, who is a musician, pointed out that I had basically created digital wind chimes. I’m okay with that. I also made a derivative code, which I’m calling Simple Harmonium for Meditation (code here).

Click on the box to start the program

The next thing to do is to map all 40 points of data from the pressure sensor to this sketch, and Bob’s your uncle (at least for getting the real-time sketch working). I also got my SD card module working, although I haven’t connected it to the sensor yet. But I’ve already written the code in Arduino so that it will write the sensor data to a text file over time, including a time stamp of when the sensor data happened (using Arduino’s RTC). Then I can make a similar .p5 sketch that will visualize the sensor data as sort of a time lapse. My hope is to have two screens up at the Winter Show (if my project gets accepted), and have one screen showing real-time kicks, and the other showing a time lapse of logged data from my SD card data logger.

I met with Tom Igoe to figure out how to clean up some of the noise in my sensor. The nice thing about using the ground-switching matrix (I can’t for the life of me keep what the process is actually called in my head), where it reads across the sensor by changing where the ground is systematically, is that while there are 40 data reads coming out of my sensor, technically there are only 5 real sensors being scanned across 8 points several hundred times a second.

What that means for cleaning up the sensor data is that I’m only cleaning up 5 reads, and not actually 40. Tom suggested that I use trimpots (trimming potentiometers) to calibrate them before they even get processed by the code. I hadn’t heard of trimpots before, but they’re basically just potentiometers that aren’t big, unreliable and dumb like the ones we usually use at ITP. They’re tiny potentiometers where you change the resistance with a screwdriver. Click here to buy some. This way I can adjust the resistance in each of the 5 analog reads on the circuit, and get the values to line up with each other at rest. Right now my circuit is employing 220 resistors, so I will either use 500 ohm trimpots or 1000 ohm trimpots. This means that (because I’m using pull-up resistors), if the reading is too low, I can turn the trimpots resistance down to almost zero, and for the ones that are reading on the higher end of the 1023 scale, I can turn the trimpots up. As the sensor stands right now with static 220 resistors, the range of the noise is only about 100 points, which is not that bad actually. It’s going to make my life a lot easier in code to just match up the readings with trimpots on the circuit board though. Then I can take an average of the readings in code to clean up the noise, or probably use a Kalman filter.

This weekend I have to get my sensor off of alligator clips and into a permanent circuit. Again, my original plan was to sew the whole circuit using conductive thread, but I am completely over that. I spent so much time fighting with conductive thread, and I thought to myself, “You know what conducts electricity really, really well? Wires.”

So, my sensor will probably have more of a steam punk vibe. Maybe some day I could revisit the sensor and sleek it up with a conductive thread circuit, but for this prototype I’m going to just use wires and run them to a small solderable bread board, and then I’ll sew all of that with non-conductive thread to a tight-fitting shirt. Then I just have to connect a portable power source, set up WiFi serial, and this thing will be fully wireless. I’ll probably use a lithium polymer battery. More soon, and wish me luck on getting accepted into the Winter Show.