Studio Contrechoc

art & textile & technology entries

Teensy 3.0, BlueSMiRF and Mindwave

In the last post the Serial and SoftWareSerial of the Arduino and Coolterm and the UART of the BlueSMiRF were performing some acrobatics, but it is all possible.


After buying a Teensy LC and Teensy 3.0 this acrobatics was made much more simpler using the possibilities of combining USBSerial and Serial1. On the Teensy 3 Serial Ports are available.

With the Teensy the BlueSMiRF is connected to a Serial Port and the data can be seen in a Serial Window:

Screen Shot 2015-05-12 at 09.02.17

And because this project involves servo motors, it is nice the Teensy has so many PWM Pins and Timers!

The basic Arduino BlueSMiRF test script can be found here:

You can find how to configure the BlueSMiRF for connecting to the Mindwave here:—hacking-mindwave-mobile

The Teensy page on Serial UART:




Bluetooth boards and the Neurosky Mindwave

For some project the Mindwave Neurosky with bluetooth was interesting. Jostie quickly made an Android App, which could connect to the Mindwave during the 2015 NASA App Challenge weekend in our neural network attempt:


His app can be found here:

bt9 From Mindflex, with Serial to Mindwave Mobile with bluetooth

But we wanted the signals directly available for a wearable. For this a bluetooth board was needed, which could connect to the Mindwave. Several options were available.

By studying two tutorials constraints for this setup are becoming clear:

  • The board has to have the possiblity to behave as a master, connecting to the Mindwave.
  • The communication has to be Serial (that is fast) and not SoftWareSerial (two reasons for this!)


We tried different boards (although we could have guessed that only the boards mentioned in the tutorials would function :-) —stubborn!—

bt3  older BT board, old – hard – school – command coding RX-TX connection

Easy Bluetooth ( not for sale anymore?)
This is an “older” board, from a few years ago. No problem connecting and using as a slave. There is more: In this pdf of 100 pages you can see that you can enter the command mode, and make this board a master. But … this is the real stuff in command BT-coding, will cost some time to study.

bt5 see the wires: SPI connection: 6 besides the V and GND

Bluefruit LE – Bluetooth Low Energy (BLE 4.0) – nRF8001 Breakout (

A recent board. Communicating easily with an app, sending to a wearable. This board is easy to connect to, but functions as a slave. So for our purpose this board cannot be used. Besides, compared to the other boards, the SPI connection has a lot of wires…

The documentation from Nordic is also extensive:…/2981/…/nRF8001_PS_v1.3.pdf .

bt4 very nice, “designed” connection at the FTDI of this RF12 board

Bluefruit EZ-Link – Bluetooth Serial Link & Arduino Programmer – v1.3 (

This is a board with some nice possibilities as can be discovered here:

It can be connected to the FTDI header of a Jeenode, making the Jeenode having both the RF12 and bluetooth wirless.

The board has an optional JST connection. So you can make a standalone module witha lipo attached. Only problem: the lipo in the JST connector is always on: no on-off switch. So in practice this connector requires soldering a switch in the wiring to the lipo, which is not fun.

But as can be read in the FAQ of Adafruit:
Can EZ-Link act as a BT ‘master’?
No, it is a client-mode only device.

End of story for our purposes.

bt1 without the BEE carrier, programming with the AVR SPI mkII

Bluetooth Bee – Standalone ( )

This board has a bluetooth part combined with a ATmega168P (Not an ATmega168 as told in the wiki).

The wiki can be found here:

Getting this board working did cost more time. Using an AVR ISP mkII programmer (not the X Bee carrier) was the first hurdle. After a while the J1 connector functioned – or the configuration was understood.. Uploading code was possible after adding the ATmega168P code to the Arduino boards.txt file, using the shift-U command in the Arduino environment.

Screen Shot 2015-05-07 at 09.54.15 Screen Shot 2015-05-07 at 09.55.27

(Our AVR ISP mkII is hacked so that it provides either 5V or 3.3V directly to the board – this one needs 3.3V.)

The LED’s (red-blue) on the BT board code as follows (no the description in the wiki): Master mode: double fast blue: not connected, single blue: connected. Waiting to pair: red, blue alternating.

If paired right from the laptop you get a BT – Serial link in the Arduino environment. Opening this as a serial monitor initiates the pairing, the key “0000” is given automatically. The board is in slave mode. The example code worked, the led could be lit and “shut”.

Screen Shot 2015-05-07 at 09.55.02

But the master mode is needed.

At this page about the Bluetooth Bee you can find the commands :

The code used to get the master mode using the commands can be in the scripts at github:

The communication is done using SoftwareSerial. On this board communication is hard wired using pin’s 2 and 3. See the schematics at:

This hard wired connection is the problem for our project. For the Mindwave to give signales regularly a faster connection is needed than the SoftWareSerial can provide—the “normal” Serial connection on pin 0,1 is much faster—, as will be seen in the last bluetooth board which is tried out. The signales are coming through with SoftWareSerial, but apparently there are so many bits falling out that sometimes you have to wait seconds or even 10’s of seconds for new values of the Mindwave.

The script using this Bee Standalone board can be found here: (mind the baudrate which is set at 57600, default 38400 – start using this value to set the baudrate at 57600). It functions, the LED signals received values from the Mindwave, but not too often and at irregular intervals.

The second problem for our project is also related to using SoftwareSerial. We want to transfer the values from the Mindwave to servomotors. But the Servo lib and the SoftWareSerial lib are incompatible (probably they use the same timer).

So also this board is not what we needed.

Nice post in Japanese:,

bt2 nice and clean, connected to an ATmega328 board with RF12

 BlueSMiRF Silver (

This board was mentioned in both the relevant tutorials. So no wonder that this board functions. Using the command mode it can be programmed in Master mode and the MAC address of the Mindwave can be entered. Connection and reconnection is done automatically.

In our project we spent time using the SoftWareSerial instead of the Serial port, with the intention of debugging. The speed difference resulted in dataloss (apparently) and only some packages of the Mindwave were received in minutes. With the Serial, pin 0,1, Mindwave values enter once or even twice a second.

SoftWareSerial was used to communicate with Coolterm (or other Serial monitor) to see what was happening and debugging. This interfered with the servo motor lib.

The ATmega328 board (Jeenode) with the RF12 provided a solution: bluetooth signals from the Mindwave are received using the UART of the Smirf, then the signals can be transmitted using the RF12 transceiver. These signals can be received in a similar board.

Scripts using the Mindwave and this board can be found at:

The projects with these boards and scripts will be presentated later…


Bremen King’s day presentation

Five projects were presented at Bremen, Hochschule für Künste, during the Dutch celebration of King’s Day, 28 April (Bremen date of this day). We did this presentation of e-textile projects together with 5 projects of (which can be found there).

The dummies with the projects were placed in the middle of the people attending the celebration. The wearables were blending in so well, that there interactivity could be conisdered as “normal”. Also, because of this interactivity on these puppets, the normal clothing the visitors were wearing could easily be imagined interactive. The future of garments and clothing is near, because it cannot be considered “alien” anymore.


Overview, Solar Rim Dress, Victory over the Sun, Social Wind, Je Suis, Supernova t-shirt


Solar Rim Dress



Social Wind


Supernova t-shirt in the “Geburtstaggeschenkvortrag” at Galerie Am Schwarzen Meer, Bremen.


Small Talk Timer in action



Social Wind together with the Spine Warming Dress and the Solar Fiber project of


Back of “Je suis”



Front of “Je suis”


About Interfaces of wearables

Designing a wearable has many aspects. The fabric shape and the functioning are the first concerns. After these parts are solved other things which doesn’t seem important are added.

Within the interface part a division can be made between the expressive part and the interaction part: the expressivity can be movement (Je Suis, Social Wind), some sort of light information (Solar Rim, Change Partners, Supernova shirt), etc. About this expressivity see this post:

The interaction part is about switching the wearable on and off, charging or changing the batteries.

This last part of the interafce is one of the tricky aspects of every wearable.

Interfaces of the last sort for wearables are tricky because at first it is outside the scope of the design. The on/off switch is added when the project is finished. You have to figure out the most convenient spot on the wearable. It “main switch” also has to be a spot which can be found but also is hidden in the sense that it not obvious. This means you have to solve a paradox.

Then the wearable can have different modes. For instance the normal functioning mode, where a laptop sends data wireless to the wearable for display, and a presentation mode with programmed data without the laptop.

To study possibilities, difficulties etc a list of wearables and interfaces/modes:

Project modes interface
Social Wind, ventilator module normal mode (temperature/humidity sensor), display mode switch, button
Solar Rim dress normal mode, display mode 1: one month of data, display mode 2: block data around the circle of 64 LED’s, display mode 3: epicycle mode. textile switches at sleeves, snap fasteners
Victory over the Sun one normal  game mode switch
Je Suis one normal mode – distance sensor, extra button for activation by hand switch, button
Supernova Shirt and trousers one normal mode switch
Change Partners / Talking Timer one normal mode, interaction soft button switch, conductive patches

Pictures of interfaces:

int2 Victory over the Sun, switch. Hidden

int7  Solar Rim Dress, soft buttons, left mode options, right snap fastener-  switch. Visible

int6Je suis module, back side, switch and button (right top, near motor). Visible

int5 Social Wind, Ventilator Module, switch. Hidden

int4 Social Wind, Led panel module, switch. Hidden

int3 Change Partners, Talking timer, switch.  Hidden

First conclusion:

If the electronics is designed separate from the wearable shape, the switch ends up hidden, on the electronics board. Hidden switches are difficult to find, even for the designer, after a few months.

So, the switch should be part of the wearable design, see the snap fastener design of Solar Rim.


If the switch is part of the fabric design then the electronics gets entangled with the fabric. This has two related disadvantages: testing gets more complicated because you cannot test the electronics without the wearable, and recycling that is separation after use gets more difficult.

The solution could be to add one switch to the electronic design and connect this switch to a second switch in the fabric. After integrating the electronic switch is switched on, and having the material switch in series this last switch will be used after all is assembled.

Victory over the Sun: technical testing

The dress described in former posts was finished finally.

The dress as a result of an artistic research into energy harvesting and design is presenting a game situation. By rotating a dynamo you have to compete with the Sun and a solar panel in generating energy. The game is created in a wearable so that you can change to another location. Playing the game in different locations makes you aware of the power of the Sun’s energy in comparison to your own muscle energy.

The dress is very much a prototype. As can be seen from the electronics a large amount of testing is needed to make some sort of a playable game.

The electronics was fitted inside 4 acrylic casings:


dynamo charger, supercaps/lipo, the brains: 2 ATtiny85’s and bitshifters, and an LTC3105 energy harvesting chip.

then fitted to the side of the dress: (which makes us aware that we should have thought of a better wiring :-)


Up left: the charging dynamo, up right, the ATtiny85’s, and the bit shifters, down left, the supercaps, and lipo, then bottom right, the LTC3105 for recharging the discharged energy into the lipo.

After fitting the casings will be covered with small pieces of jeans, only the dynamo charger will be visible.


Two out of the three casings covered.

The choice for 2 ATtiny85’s was made from the first version where we had only 4 LED’s for the two sources of energy. But now after making it all we realized that the 2 ATtiny85 with the bit shifters should have been replaced by one ATmega328, with a LED-block script, avoiding the bit shifters. This would have saved one casing. This will be done in the next (third) version of the electronics.


Besides the solar panel a battery pack is installed to make testing in a room without the Sun easier, you can test by switching to battery pack (right side, next to the solar panel). The wiring between all the casings and groups of electronics is done by female – male connectors. This makes testing easier.


The second version of the script discharged the supercaps after winning. Winning is reaching the 5V mark. But what about starting a new game after abandoning a game half way? It was decided to discharge the supercaps at the start, when you switch on. Discharging is not what is seems. Following the voltage of the supercaps to about 0V, you see the voltage rise again without any charging. So discharging is now done in steps, then some delay, then measure the voltage again, if it is above a limit, discharge another round and so on.

This repeated discharging worked…until the dress was put in the full sun. The solar panel is generating so much energy that the discharging is not fully obtained. The discharging time had to be made bigger.

The installed solar panel is doing 0.1V a second so it will win in 50 seconds if the Sun is not hindered by clouds. At the moment it is practically impossible to win this using this hand crank dynamo hacked from the Ljusa.

Besides that, as could have been expected :-) the big LED’s are not visibly on or off in the full Sun. Another interface should be added, or these LED’s like this removed and giving it a try with small superbright LED’s.

A movie of the solar panel racing towards the 5V:

After observing the problem of the LED’s not visibly lit in sunlight, we tested bright LED’s in a simple script at 3V:

So the big 10mm LED’s will be replaced by these 3mm bright LED’s.

Interactive top

Fot the presentation in Bremen we made a simple interactive piece for a possible fundraising auction.

The piece is made of five sided regular shapes. The fabric is lasercutted and the pattern of the the bigger form is coming back in the middle of the shape as a pattern.

From 6 regular five sided shapes a top is constructed in a way we did for 10 years in painting. The difference is that the fabric folds itself around the body, being different from 2D tessalation.

p1 Screen Shot 2015-04-19 at 10.12.19

(see more paintings here:

One of the fabric shapes and some of the paintings in the same configuration as used for the top. Added are two basic shapes one to the right and one to left side. In painting this would have meant that the 2D plane was abandoned. For the textile top this means we get a spatial form slightly coming outwards.

Pattern of the top:

Screen Shot 2015-04-19 at 11.34.05

A picture of a model (Jasna Rokegem) wearing the top:


For interactivite we added three LED’s in the middle of the sides of the central shape. These LED’s are soft glowing, faster or slower depending on the value read by a light sensor exactly at the middle of the protruding shape(LDR).

The nice thing about this top is that you can even hang it on the wall and enjoy its abstract reflections without wearing it yourself :-)

The script is fairly simple and can be found here:
version 1: glowing led’s:
version 2 (meant for the back): led’s shwoing light variations:
Both scripts can also be found at github:

Needed: ATtiny85, three LED’s, 1 resistor of 2K, 1 LDR, coin cell battery holder, 3V coin cell battery.

Victory over the Sun version 1.0, design and energy considerations

Second version of the Victory over the Sun project.

After the sketch version (see post the recycled jeans dress is totally modified. The front is reordered in horitontal strips, where the big LED’s form two curved lines. These 8 LED’s plus one at the bottom will  report about the game between the solar cell and the dynamo which is operated and powered by your hand and arm.


The back side is decorated with a pattern using the laser cutter.

vic3 backside

The material is recycled jeans. The idea is that there should be a match between the concept of energy generating and the material that is recycled. The jeans were worn for a few years and the worn out parts were removed. From the left over parts, which seemed still ok the dress was assembled. But in handling the fabric it was noted that also the seemingly good parts were deteriorating fast. In total contrast with the energy of course. Energy is energy, even if it is transformed many times. There is no comparison between fabric and energy, although we humans tend to associate green, “nice” energy with green recycling of goods and fabrics. Our tender ideas are not appreciated by reality.

The electronics is improved after the first skethc version. The LED’s are extended to 8. In the dress there are 9 LED’s. The two bottom ones will be used to indicate that a game is going on.


Inside of the dress, connecting the LED’s. The parts of the electronics, LED’s, circuitry, supercaps are all connected using connectors, so that testing is made easier.

In the electronics the supercap of 1.0 for each of the participants was replaced by two supercap’s of 10F at 2.5V in series. Now a player has to work to get to 5V!

One problem remained and remains. After the game a lot of energy is stored in the supercaps of 10F at 5.0V. You can calculate this energy: the formula is Energy of a capacitor = .5*C*V*V.

See for instance:

This means 125 J. In the first version this was only 12.5J because the Cap was 1.0F instead of 10F.

After the game this energy has to be dissipated to start a new game. But this getting rid of the energy costs time. The first try was using a ventilator. Even a cooling ven for a computer running normally at 12V could be used and took minutes to get the voltage of the supercaps down.

vic5 The ven is visible at the left bottom.

The last experiment was to charge the lipo used for the circuitry of the game.

During dissipation the voltage of the supercaps drops from 5.0V to hopefully 0V. The lipo battery is between 4.1V and 3.6V. So to charge the lipo a special LTC chip is needed (LTC3105) , to keep the voltage at 4.2V during charging back the energy of the game into the lipo. This LTC is actually a harvesting chip studied during a research on energy harvesting:

So the supercap should be connected to this chip and the output of the chip fed back into the lipo.


Expected was a fairly normal exponential behavior while discharging. Not quite so!

This is a typical graph of the Voltage over the supercap and the charging current to the lipo:

Screen Shot 2015-04-06 at 19.55.27

The time axis is not linear, noted were values of tens of mA of current and the corresponding remaining Voltage over supercaps. The LTC3588 took care of keeping the charging voltage to the lipo n 4.5V, even till the supercaps were at 1.5V.

There is a spike in the middle of the graph which was reproduced.

The drop-off is not exponential, probably because the charge pump is being cleverly regulated, this LTC 3588 chip is fairly complex.

The discharging is made interesting, but the last problem remains: the charge on the supercaps will not be brought back to 0V, which is the ideal starting point for the game. On the other hand with the 10F caps, the game takes long enough for the human arm to get tired. So maybe we keep this way of discharging.

One might get anxious about the lipo. If the lipo is charged to quick, things may get nasty. But the voltage of the lipo changed during charging only 1mV, from 3.81 to 3.82. The energy density of the lipo is far more bigger than the supercaps:

Lipo battery of 1400mAh * 3.8V = 3600 * 1.4 * 3.8 =~ 19000 J. So the 120 of the supercap does not really impress the lipo.

Adding an oscilloscope picture:


Yellow line: voltage over the supercap,

Blue line: inverted voltage over a shunt of .5 Ohm. For a square this means 10 mA. Maximum current 24mA. The current is different from the former graph because of the shunt

Start: first 4.9V being above the voltage fed to the lipo 4.2V (so the chip DC-DC downwards), then you see the crossing of this set voltage, the chip has to DC-DC upwards to 4.2V, there is a discontinuity, the current delivered is bigger -more efficent? After that the exponential. The last part is still interesting, the chip really keeps the voltage up to 4.2V while the supercaps ar at 1.5V.

Bremen Presentation pieces

At the Dutch Koningsdag event – Bremen version, one day later than the Dutch version – 10 pieces of Dutch interactive clothing will be shown during a meeting of Dutch citizens working in and around Bremen.

Five pieces of Contrechoc will be shown together with 5 pieces from Marina Toeters,, during the meeting “koningsdag” in Bremen in the entrance hall of the Hochschule für Künste Bremen.

For the presentation in Bremen these 5 wearables (Contrechoc) are chosen:

  • Solar Rim Dress, 2014
  • Super Nova shirt, with added data trousers, 2014
  • Social Wind, 2015
  • Je Suis, 2015
  • Victory over the Sun, 2015

Solar Rim Dress and Super Nova shirt are datavisualisations. Je Suis is a hacked dress. Social wind is a humoristic comment on a cooling wearable and Victory over the Sun is an artistic research result.

Solar Rim dress show the actual activity of the Sun, on the rim. The 64 LED’s are placed in a circle on the side of the dress. On the dress itself some loop structures refer to the shapes which are created by magnetic fields on the Sun.

The Super Nova shirt shows the observed supernova’s of the first half year of 2014 displayed on a printed picture of the Micro Wave Background radiation. The Supernova’s are displayed in a time sequence. The flashing clearly shows “the code” of the stellar explosions. Added to the t-shirt are trousers which show the data in a printed version.

Social Wind is a jacket which is made in bright yellow fleece. The back is open and 5 ventilators are rotating gentle at that side of the jacket when the temperature inside is to high or the humidity exceeds a certain value. The Social Wind jacket is a wearable reaction to a cooling dress of

Je Suis is a hacked party dress. The text is a reduction of the “Je suis Charley” protest. When the dress is approached 5 small plates with four versions of  “Je suis” and one image version of “the hand of God” in a retro style are lifted and hidden again.

Victory over the Sun is the result of an investigation into energy harvesting. The piece is a game wearable. The game allows for two ways of energy generations to compete with each other: one solar cell against your muscles. LED’s indicate how the Sun is beaten (or not) by your muscle power.



From left to right:

Solar Rim Dress, Victory over the Sun, Social Wind, Je Suis, and Supernova t-shirt with data-trousers.

You can find more info on these wearables in other posts.


2015 NASA App Challenge

Two years ago we participated with friends in the 2013 NASA App Challenge with a wearable. Last year we did a game for the 2014 App Challenge. Now we do another wearable challenge in the 2015 NASA App Challenge:

This is the first time we really try to make “intelligent” garments. We will integrate a neural network in the wearable. This network will “learn” by trying to recognize patterns. This learning will be made visible by changing the shape of the wearable, or even morphing.

The neural network will be small, and the learning capacities will be very limited, but this is a start at “really (somehow) smart” fashion.

Details about this project can be found in this hackpad:

images will follow next week when we try to finish two wearables in one weekend, where normally it takes about a month for a wearable…

But now we come with a group of expert programmers, designers and e-textilers, together with a car full of equipment…

(Making tags for this post … nearly all tags created for this blog are indicated, which means that something will be happening!)

Project page:

Supernova t-shirt with trousers

The t-shirt showing the sequence of observed supernovas of the first 6 month of 2014 was first shown at Paillard in the summer of 2014 during the exhibition Cuvée at Paillard.

Recently trousers were added with all the data which are used engraved with a laser cutter on the fabric of the trousers.

The idea of adding the trouwers is to show the contrast between “raw data” – as text and number items,  and this way of visualising the data of a time sequence on a surface area.

So the supernova observations with coordinates and time and date indication are shown as blinks on the t-shirt and as text on the trousers.

In discussions it appeared that the meaning of the blue/green ellipse on the t-shirt is difficult to understand if you are not a little bit into astronomy. For most people it is possible to look at all the countries of the Earth mapped on one page in an atlas, but the idea that the whole sky is projected into one ellips is not easy. But of course this is the same transformation: the surface of a sphere is projected on a plane into an ellipse. We know that the Universe is “space”, but we percieve it as a sphere, because the distance of the objects in space is so large compared to what we as humans are used to.

This blue green ellipse on the t-shirt is a picture of the Microwave background radiation. This represents the distribution of mass just after the Big Bang (well 350.000 years according to the theories).

On top of this – or rather through this picture – are the observations of stars exploding in the universe. We can see these explosions which are really far away because for some time these stars are as bright as galaxies. So you get a comparison between stars exploding and the ancient mass distribution. Stars like that (very big compared to the our Sun) have a short life time (compared to our Sun). They will end in an explosion after about 10 million years. So these explosions are like leaves falling of a tree, the tree representing the universe. And of course these observations revealed that apparently the Universe is expanding in an accelerating way, indicating that the law of gravity is not the only long distance force…

Back to the wearable, some pictures, textual data on the trousers:

su3 su2 su1

The engraving, done with a laser cutter, is perforating the very light weight fabric, which is not really fabric for trousers, it was chosen more for having a nicely colored surface. (Next time, better fabrics!)


Under the t-shirt is the electronics. Five big led panels are playing the part of exploding stars. The sky is divided into 5 big area’s, for the 5 panels.  The voltage used for the led panels is 12V provided by 3 lipo batteries in series.


The datavisualisation as a time sequence can only bee seen in a movie:






Get every new post delivered to your Inbox.

Join 26 other followers