Stulpe Circuit (2014)

Working with Katharina Bredies to create an improved circuit to go with the CTS Therapy Gauntlet. The documentation in this post is organized from top to bottom, with the beginning of the process starting at the bottom and progressing towards the top.

Links:

>> CTS Therapy Gauntlet
>> http://www.design-research-lab.org/projects/cts-gauntlet-ver-2/”>CTS Therapy Gauntlet V2
>> Code on GitHub
>> Circuit on GitHub
>> Flickr set


Fix

Problem: Bad connection(s) causing misbehavior. Speaker does not always work…

From examining the stulpe circuit, the failure comes from the fact that plugging and unplugging the FTDI or Bluetooth module is exerting too much strain on the edge pins of the 6-pin header. These edge pins represent the GND connection and the SCK connection. GND is vital and has been repaired. SCK still remains somewhat in tact and is only relevant for re-programming which can also be done via the SMD chip clip (which i would recommend anyway).

GND connection fixed by peeling back some of the soldermask and enlarging the solder area to overlap the probably crack in copper.

Area of reinforcement to the back of the microcontroller and 6-pin header area so that strain is relieved from solder joints in this area. Plus, when bent the bend does not happen at solder points. This reinforcement is standard in flex PCBs and probably a good thing to add to future editions of this design.


Final Version Documentation

SUGGESTIONS for improvement of current implementation:
– Program circuits to trigger alarm if EITHER sensor is past threshold for given time-limit.
– Mark on/off of switch somewhere on circuit
– Re-make stulpe with knit sensors in ranges under 500K Ohm, so that skin resistance does not interfere

Photos

ATtiny microcontroller with programming headers:

Speaker, LED, Snap connector and Slide-Switch:

1uF filter capacitor (left), 1M Ohm pull-up resistor (right) on each sensor input:

Battery pouch can hold one or two 3V coin-cells:

Parts

– ATtiny85V (this version of the chip can run at lower voltages: 0 – 4 MHz @ 1.8 – 5.5V, 0 – 10 MHz @ 2.7 – 5.5V)
see datasheet >> http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
– SMD LED
– Speaker
– Resistor
– Capacitor
– 6-pin header
– Slide switch
– Snaps
– 3V coin-cell (CR2032)
– Knit sensors (see bellow)

Knit Sensors

Knit from XXX yarn. The ranges of the variable resistance knit sensors vary. They were measured to be between 8M Ohm (fully relaxed) and 500K Ohm (fully stretched/compressed on wrist) 10K Ohm (fully stretched off wrist). After some use the range generally shifts down to around 2M Ohm – 600K Ohm. Though this may vary again over time. Based on the measured ranges of the knit sensors, 1M Ohm pull-up resistors were chosen for the voltage dividers.

It is almost impossible to trigger the top sensor without triggering the bottom sensor.

Circuit

The final circuit is designed in Eagle, although the size of it exceeds the board space provided by the free Eagle version, so that components are confined to limited area. An elongated variation of the final circuit allows for the circuit to wrap around and fit a larger variety of wrist circumferences. This elongation of the circuit was done in Illustrator. The final circuits were etched at the TU from one-sided copper plated Kapton film. The soldermask is lasercut from black silk fabric with fusible adhesive backing.
>> Circuit on GitHub
Etched circuits and soldermask:

Arduino Code

>> Code on GitHub
The Arduino code is the same for both circuits and incorporates both stand-alone and Serial modes. Meaning the sensor values are always being sent over the soft Serial port regardless whether they are being received on the other end. Because of the huge variation in sensor ranges, the thresholds for each Stulpe will likely need to be adjusted regularly.

Stand-Alone Circuit Behavior:
When the circuit powers up the speaker sounds short beep tone and the LED light fades on and off to indicate the circuit has come on and both outputs are functional.

If the TOP sensor is past it’s threshold the LED will blink slowly. If the BOTTOM sensor is past it’s threshold the LED will blink fast. If both sensors are over their thresholds the LED will be on. If both thresholds are exceeded for over 200 cycles (roughly 10 seconds) then the speaker will sound the beep alarm until one or both sensors fall back passed their threshold.

In summary:
TOP –> blink slow
BOTTOM –> blink fast
BOTH –> always on
BOTH && TIME –> beep and blink

The LED is connected to a PWM pin so that it’s brightness can be dimmed if it is too bright to look at.
analogWrite(ledPin, [0-266]);

Serial Circuit Behavior:
(same as above with the addition of the following:)
The ATtiny is constantly transmitting the following comma-separated-value message over it’s soft Serial port: “TOPsensorValue[0-1023], BOTTOMsensorValue[0-1023], state[0-4]”, where state values mean the following:
0 = neither sensor value has past threshold
1 = TOP sensor value is past threshold
2 = BOTTOM sensor value is past threshold
3 = BOTH sensor values are past their thresholds
4 = both sensor values have past threshold for long enough and alarm is sounding

Screen-shot of Serial COM:

Processing Sketch

>> Code on GitHub
The processing sketch reads the Serial message and graphs the first two values. If the value of a sensor is passed it’s threshold the graph line will be drawn red, else black.

Screen-shot of Processing graph:

Re-Programming

CAUTION: when powering the circuit over the 6 pin header connection (for example via FTDI) make sure the power switch is turned OFF. If the battery is left in the pouch then the 5V USB + 3V battery power will be too much for the circuit! If the battery is not in the pouch the + and – of the battery connections are shorted inside the pouch! Alternatively you can insert a non-conductive spacer into the pouch to separate the + and – connections.

To re-program the ATtiny on the Stulpe circuit the easiest way is to make a custom ISP connector that will plug directly on to the 6 pin header. The 1uF capacitor on pin2 needs to be removed before programming.

Diagram of custom connections, photo of connector/adapter:

Serial COM vs. programming connections:

Differences Between Circuits

The two final circuits (marked A and B) are the same in all respects, except:
– Circuit A has 6 pin header pins soldered to flex pcb for easy programming and FTID/Bluetooth connection, and B does not have this header pin attached.
– Circuit A and B have different on/off switches: A has upward facing, B has sidewards facing.
– Circuit A is paired with Stulpe yellow. Circuit B is paired with Stulpe pink.

FTDI Serial Connection

The TX pin of the serial connection interferes with the analog reading of the bottom sensor connected to pin 2 (ADC1), which is wired to the 6 pin connector for programming because pin 2 is also SCK. The following adapter only makes the necessary connections for the one-way Serial communication that the Stulpe circuit uses (VCC, GND and TX).

Bluetooth Serial Connection

Use same adapter as for FTDI board. I could not get the UdK Bluetooth module to pair with my computer! Does it have a different pairing code than the default 1234?

Circuit A


Circuit B



For the Future

Improvements for Future Iterations

– Knit sensors should be lower resistance (KOhm – Ohm) so as not to come close to skin resistance range (1-2MOhm)
– Knit structure should be optimized for more consistent sensor values. Partial elastication could allow for pre-stretched material and tighter fit. Ribbing could allow for greater range of yarn deformation when pressured/bent/stretched
– Jumper connections under soldermask
– Placement of top sensor (pin3) pull-up resistor and capacitor not so close to speaker footprint
– Center battery pouch on underside of wrist
– Recede header pins so that they don’t stick out

Remaining Issues and Workarounds

– Bottom sensor’s capacitor interferes with programming the ATtiny –> has to be removed to re-program chip
– Bottom sensor’s SCK connection to TX on FTDI board interferes with reading analog value (pulls it high) –> workarounds: (1) cut TX connection on FTDI, (2) use adapter that skips TX pin, (3) find a way of setting TX pin on FTDI board to be neither high, nor low, (4) check possibility of switching current SCK and RST pins on custom 6-pin header (could result in other implications…)


ASCI CIRCUIT DIAGRAM

///////// CIRCUIT DIAGRAM /////////
// _______
// RST –|° |– VCC
// BOTsen/3 –| |– 2/ADC1/TOPsen/SCK
// SPEAK/4 –| |– 1/tx/MISO
// GND –| |– 0/LED/MOSI
// _______
////////////////////////////////////


Updated Circuit

Updates made in this version:

– added toggle switch for programming connection (Pin1 — TX)
– larger pads for larger snaps with holes through both copper and base substrate for males snaps to poke through
– smaller pads for resistors and capacitors
– smaller soldermask window for ATtiny
– single-colour LED
– smaller speaker/buzzer
– remove snap power switch and include toggle power switch

Final updates made in Illustrator to lengthen ends to allow for different wrist sizes and for the circuit to wrap around and close on itself, rather than on the knit fabric.

Schematic and layout in Eagle:


Cut files traced in Illustrator:


Ideas for power source…

coin cell
– 3 x 1.5V button cells in series (4.5V). using SMD holders like one bellow
– 3V CR927 button cell in SMD holder >> http://de.rs-online.com/web/p/batteriehalter-halterungen/4814178/
– 3V CR2032 coin cell in nice black holder >> https://solarbotics.com/product/BHold2032/
– make own coin cell holder from fabric and magnets
– rechargeable coin cell battery that can be hard wired with charging connections broken out >> http://www.megabatteries.com/item_details2.asp?id=14509&cat_id=469&uid=1718

lipo
– small lipo battery with shortened cable. include charging circuitry on board? or have to unplug to charge? JST connectors are a pain to plug and unplug!
– lipo battery inside pocket inside stulpe and power connections travel from inside to outside through snaps


Option 3) Flexible (flexible and spaced, wraps around wrist)

Instead of grouping parts into hard nodes as in option 1, spread them evenly and space them out over the full circumference of the wrist to keep the circuitboard as flexible as possible. For this option it would be great to have access to a flexible circuit etching facility.



Issues with previous version:

switching the circuit back and forth between stand-alone and serial-bluetooth modes, the following issues arise with current design.

1) ATtiny Pin1 connected to LED(blue) and is TX connection when doing Serial communication via Bluetooth. LED gets in the way of TX–>RX!
solutions:
– insert toggle switch between LED(blue) and is TX connection – – probably the way to go. but adds extra component
– only use one LED, leaving Pin1 free for TX serial com

2) ATtiny Pin2 and DTR of Serial/Bluetooth connection as this pulls pin low and gets in the way of reading sensor input from Pin2/ADC1!
solutions:
– swap SCK and MOSI connections on 6 pin custom ISP connector so that sensor Pin2 does not connect to DTR of Serial/Bluetooth connection – – good to do anyway (and solves problem)!
– insert toggle switch between Pin2 and DTR connection
– cut DTR connection on bluetooth module as we are not using it and it is in the way

Alternative solutions to both above problems:

– have two separate circuits, one for stand-alone demo, one for serial-bluetooth visualization demo

3) (small issue) battery pouch shorts + and – when there is no battery inside. this is only an issue when operating using separate power supply over ISP connector and closing the full wristband. always leave wrist-band open when connecting power via 6-pin headers.

Hard/soft connections

the hard/soft electrical connections are made with hand-sewable snaps. on the side of the stulpe the snaps are sewn with the remaining conductive thread from the knit sensor leads. on the side of the flex PCB the snap is mounted through a hole from above so that when removing the circuit from the stulpe the forces are not on a connecting thread. this is holding up really well in terms of connection and robustness.
the ordering of connections is altered on the circuitboard. on the stulpe it is: sensor1 – GND – sensor2, on the circuitboard it is: GND – sensor 1 – sensor 2

Battery and holder

current solution is a self-made coin-cell holder made using conductive fabric (+) and a magnet (-). the battery is easy to insert and remove and the connections are good. it also fits with the design. and two coin-cells can be inserted for more power. i could imagine assembling a wireless power module with lipo battery into a similar form-factor as the coin-cell battery so that it could sit inside the pouch and make contact the same way. although the consequences of a lipo battery shorting out are much much worse.

Power switch

the power switch for turning the circuit on/off is made by closing the final snap connection next to the battery on the stulpe. the strap anyway has to come off here so that you can put the stulpe over you hand.

Kapton Folien

Müller-Ahlhorn:
>> http://www.mueller-ahlhorn.com/de/produkte-materialien/material/technische-folien/pi-polyimid-folien/
Krempel Group:
>> http://www.krempel-group.com/deutsch/home/produkte/spezialfolien-und-papiere/kapton-polyimidfolien.html
RS:
KAPTON FILM 304X200X0.05MM, 53,10 €
>> http://de.rs-online.com/web/p/warmeisolierende-folien/5363952/
Wärmeisolierfolie Kapton HN PA 304mm x 200mm x 0.075mm, 69,42
>> http://de.rs-online.com/web/p/warmeisolierende-folien/5363968/?origin=PSF_436275|alt


Option 2) Length-Wise (hard and long)

Instead of mounting the 3 snaps around the circumference of the wrist, have them placed in a line running along the wrist. This would allow for a circuitboard design that does not need to flex around the wrist and could be made on hard PCB. For this option it would be nice to have hard pcb manufactured with fritzing.


Option 1) Modules (hard and tiny)

To keep the circuit flexible, parts and functionality are groups into small areas with flexible areas in between. one option is to make the hard nodes from hard PCB material and solder wire connections in between (see photos). Another option would be to design a hybrid circuitboard that transitions between hard and flexible pcb materials. For this option it would be nice to have hard pcb nodes manufactured by fritzing. Their boards are white and most of the electronic parts are black. The black/white aesthetic would go well with the colours of the stulpe.

Modules…

Module string

On stulpe

Detaching

Comments and Observations

– In order to attach and remove the circuitboard from the snaps on the stulpe a considerable amount of strain is exerted on both the knit fabric of the stulpe surrounding the snap, as well as the snap mounted on the circuitboard. reinforcement backing added to the knit fabric helps relieve and distribute this strain on the side of the stulpe.
– There are a number of small components on the circuit and if the circuit is made super small then all these small parts end up very close together forming a firm surface, even if they are mounted on flexible circuitboard.
– Machwerk has had to move out of their space so i currently don’t have access to an etching bath. for now my options are vinylcut coppertape or lasercut copper fabric.
– A flexible circuitboard made of copper tape (vinylcut) or copper fabric (lasercut) is very fragile when bent and strained at the solder joints.
– Stulpe knit fabric is not very stretchy or tight fitting so sensors are not stretched/pressured much through bending the wrist up and down. Pressuring of the wrist against the surface of the table is most reliable.


Parts

– Male and female metal snaps
– ATtiny mircorontroller
– RGB LED
– Speaker (or vibration motor) — make the speaker coil directly on the pcb and just add magnet
– 2 Pull-up resistors
– 2 Capacitors
– JST socket
– LiPo battery
– Slide switch
(- Programming pins)


Initial Circuit


Challenge

To design a circuitboard that connects to two knit stretch/pressure sensors embedded in the Stulpe (German for wrist warmer). The circuit should read the values of the resistive sensors, visualize when sensors are triggered (threshold exceeded) with coloured light and sound alarm (speaker beep or vibration motor?) when both sensors are triggered for certain amount of time.

Images of Stulpe in different positions:

One sensor triggered:

Both sensors triggered (TOP, BOTTOM):

Spacing of contacts…

Reinforcement in back…