Studio Contrechoc

design & textile & technology entries

Monthly Archives: June 2010

RFM01 and RFM02 libraries (version 0.1) for arduino 18

We bought RFM01’s RFM02’s and RFM12, a few month ago.

Eventually the RFM12’s worked with the library of jeelabs.com. We modified this library  a little bit to seperate it from the Ports.h.

The RFM12’s communicated very well, and we did (and will do) several first projects with these transceiver. (see former posts) Although it is sufficient to use these RF12’s we still had a bunch of RF01’s and RF02’s.

So we set out to get also these senders and receivers working.

First we tried to modify the library of jeelabs for the RF12 to get it working for the RF01 and RF02. We learnt about the SPI of the ATmega168 (and 328), the fixed (Master Slave) registers PB5 – PB2, and about the interrupt on PD2. (Of course in a first stage we tried to change the pin numbers but that failed, we now knew why.)

But the RF01 nor the RF02 worked. Finally after trying A tiny remark in the descriptions of the RF01 and RF02 explained why: before the datatransmission you have to send the command 0xC6 and this cannot be done SPI. SO this is why the examples use different (slower?) methods.

see for instance: http://winavr.scienceprog.com/avr-gcc-tutorial/serial-peripheral-interface-spi-of-avr-microcontrollers.html, but more to the point just the datasheet of the atmega168. There you can also read about the interrupts.

Even before the RF12 lib of jeelabs.com we found the RF01 and RF02 examples of Benedikt on http://www.mikrocontroller.net/topic/65984#541030 but the first time around these did not function. Now, with more experience in settings and wiring these examples worked.

We got transmission using these slightly modified avr projects. The frequency is 434 MHz with the idea of also talking to the RF12. This last attempt failed, are there other settings?

two arduino’s with floating rf modules 01 and 02 working with the libraries

We used the RFM01_Eva (together with RFM02_Eva, and RFM12_Eva) to compare all kinds of settings.

The programming was done using AVR Studio 4 using a AVRISP mkII. We have made our own experimental board (minimal components) but also used the arduino with the programmer.

Then we made a first version of RF01 and RF02 libraries for the Arduino (arduino 18). This is relatively easy and gives us the freedom to include the wireless stuff in other arduino projects.

We combined it with the library we assembled using wiring and a liquid crystal display, to check what was sent and if it was sent well. ( using the liquid crystal I2C lib we had made earlier.)

Then we had these two test (arduino-) projects used to send and receive a simple text. (The receiver uses the Liquid Crystal AT161.) The pins used can be found in the library scripts.

Now we face the question: do we facilitate lots of fancy stuff and make the library less accessible or do we just provide a testing base for everyone to be extended?

🙂 the answer is this: sketches of the RF01 RF02 libs, working in the arduino version 018 can be downloaded here if you want another frequency than 433 you have to look at the code in the lib.

We always try to document the technical side togehter with experiments in design, so also a few pictures of PCB we made using ferroIIchloride. We have drawn with a marker on the copperplate and etched it for about an hour. This way we can make PCB’s which are more fun than the usual very straight rectangular boards…

a test of etching with a working sender RF02
a banana shaped etched pcb for an atmega168 and an RF01 and RF02, the components will all be surface mounted
Advertisements

Darlington Array…conductive thread

Research!

We have used a darlington array of two transistors in the touch shirt to get input from simple touching with the fingers.
( http://www.kpsec.freeuk.com/trancirc.htm )

We had a t-shirt with a rubber coating which worked perfect for this setting.
(see this blog entry:  https://myfablab.wordpress.com/2010/06/10/wireless-touch-shirt/ )
But this was pure luck! Later on we tried the same darlington trick on a normal cotton t-shirt and the darlington array fired all the time.

on the shirt which always fires the darlington array

Also a cap of 100% cotton had this problem. We sewed the conductive thread in the lid. But it fired without touching.  First we thought it had to do with the conductive thread which consists of very tiny threads of silver. These threads tend to spread across the cloth and could have given this trigger short cut.

But no. Probably statical electrivity gathered by the cotton in combination with the body and or movement is responsable for the triggering of the darlington array.

Also the drawdio glove (see this post: https://myfablab.wordpress.com/2010/04/22/super-simple-drawdio/) had a promising start on a cyclist glove (functioning well) and a disaster on a second more fashionable glove of 90% cotton and 10% lycra.

So we started doing research with different cloth, also testing wool, linen and several synthetical textiles.

cloth for testing

The problem is that the information about the cloth is not very detailed and sometimes not available.

Another problem is the nature of statical electricity. This depends on many factors like the wheather, the kind of body, temperature etc.

So we don’t know exactly what we are measuring!

Maybe we only test the behavior of the darlington array in combination with conductive thread?

small darlingtons with very bright led’s
the ‘normal’ touch, with conductive thread

But something came out of this research already: we need only one wire instead of two: the hand has sufficient electricity on it fingertips to start the darlington array triggering.
We look for a nice clear trigger at touching the cloth, and no triggering all the time.

Then we could make areas on this special cloth using conductive thread which can serve as triggers, so avoiding real buttons.

So for the moment we still have the touch shirt with the rubber coated synthetic cloth,and the cyclist glove which function well, but no reliable other textiles, although wool and leather are promising.

Party necktie

Party Necktie or partying cravate… .(preliminaries of Gossip: communicating clothes, the idea is that clothes in the future will take care of the boring stages of human conversation, trying to find out what interesting subjects there are between you and me, the trying to find the needles in the haystack….)

blog in progress…work in progress…studying in progress…experimenting in progress…

🙂

This idea is a variation of the blessing sleeve. For a party I had to come up with an idea quickly.
The blessing sleeve was ready. The problem with the blessing sleeve is that it does not show it’s sending
blessing words. This shirt without a tie gave me a solution: make the tie from an EL wire and connect the on and off of the EL wire with the sending of the blessing words.
The first thought was to blink when a word is sent. But then the “display” becomes rather boring. I constructed a Morse lib using these two pages with the necessary information about Morse:

http://www.arduino.cc/en/Hacking/LibraryTutorial
http://www.flatline.net/journal/wp-content/uploads/2008/04/morse_out.pde

And then using a relay the EL wire forming the tie is showing the blessing words in Morse code.

The Jeenode with a relais letting the EL wire flash the Morse code.

So the problem of the blessing sleeve (not showing any inner workings) is a bit solved. But the ‘behavior’ of the blessing necktie is still rather mechanical. Could it not show a sort of mood?

The cravat necktie of EL wire on a black shirt

As told in the blessing sleeve entry this is a small step in the direction of intelligent clothing…

Here you can download the partying cravate script. (Arduino script for the at328, using a TM161a, and a rfm12s)
Here you can download the libraries I made. (for Arduino 18, LCD)

about the transceivers and technical details https://myfablab.wordpress.com/2010/06/06/rf-transceivers/

Wireless touch shirt

For this shirt we experimented with conductive thread in parallel lines, so that the touch of a finger is enough to trigger a sound. The shirt is made of a synthetic textile coated with rubber.

The sound is generated by sending pulses to a speaker, so you get the blips and sqweeks usual for micro controllers trying to generate sound.

the shirt

The conductive thread is connected to a Darlington array of two transistors to amplify the signal and then fed into a micro controller, an atmega168. On this micro controller an Arduino generated programing is running producing the sounds.

the circuitry

Later on we add a transceiver to speak words of touch to other trnasceivers or the central listening unit, the laptop.

the not to straight circuitry

The wireless shirt becomes a member of my wireless wordrobe family of sleeves and cravats.

real surface mount, only with normal component, to create a abnormal way of soldering, you are looking at the spot where the RFM02 sender will be soldered

We were lucky using the material of rubber coated fabric, because other experiments with conductive thread and cotton in combination with a darlington array or a 555 amplifier resulted in a constant triggering, probably due to static electricity.

transistors, on high heels, forming ive Darlington arrays

The first version of the electronics was rather technical, but for the second version we made a drawing on a copper plate and etched it in FerroIIIchloride. This gives the possibility to make other shapes than only the rectangular technical. Soldering the components on the plate rather than drilling holes gives a notion of architecture in a city scape. The part should be worn as a piece of jewelry….of course this is not sturdy at all, but really fragile!
What bothers us at the moment is the color of the bare PCB. This is really terrible at the moment. Maybe try buying other colors of PCB.
At the time of the pictures, the transceiver was not soldered on yet.
The sender RFM02 will send touching messages around in space, for who wants to hear them.
Imagine by the way having everywhere these parallel lines, and that the lines react to pressure too! In important places the sensors should be fairly close, in other areas further apart. Imagine the wiring! In fact we are well accustomed to this many sensor situation: it is our skin!
The script can be found here. It is rather long due to all kind of experiments making the noises.

RF transceivers

I wanted to do concepts on wireless clothing.

Most people grab an XBEE, but I was looking for cheaper things.

I found senders, receivers, transceivers from http://www.hoperf.com, but this company is far away. Pollin (www.pollin.com ) sells these modules, but you can only order having a bank account in Germany. A friend Tilman Rothermel was so kind to order the parts or me. Datasheets were available at both sites. But somehow there seemed to be mistakes in these sheets and coding and given the steps in the configuration the chance of doing all the steps the right way was minimal. But other people had discovered these RF modules and there already was a (German) forum about the transceivers:

http://www.mikrocontroller.net/topic/67273

I had an ARDUINO with the module hanging above it: (picture)

you can see the sending JeeNode at the left, at the right the LCD shows the received words.

But then I found the dutch site (in english) : http://shop.jeelabs.com/ which has a PCB with ATmega328 and the transceiver all tested and ready. Also there is an extensive blog showing all the experiments and experiences with the RF12.

Making my own Barebones Arduino always is a few hours work, and the result is never very esthetically convincing .

So I decided to use these JeeNodes and the library provided for the Arduino.

Of course once on the right track with links you can find links to these RF12 modules everywhere…:-)

like http://blog.strobotics.com.au/topics/embedded/rfm12-embedded/ also referring to Jeelabs.

The technical part worked. Using the Library from Jeelabs and my own mixture of libraries form the ARDUINO-18 (Liquid Crystal and Wire put into one folder so to initialized wire and twi the right way) I quickly had a sketch simple sending words and receiving the words in another Jeenode with Liquid Crystal attached.

But I wanted to do some concepts!

Which will be shown in the next blogs:

These projects all have three components:

  • the technical stuff, ATmega328, JeeNode, RF12 module and sensors
  • the design stuff, giving the idea material and shape
  • the programming stuff, action and reaction to sensors and behaviour, that is a simple AI, ARtificial intelligence layer.

These three layers make life complicated!

In principle the technical layer is the most simple, because this is just following blogs everywhere available on the internet.

The design layer….well you have to start with an idea, search the materials for it, sew it….that is hard work, and nobody can explain this creative work, it has to be developed!

The programming layer has the same property: programming is easy, but you need nice ideas for the combination of microcontroller and sensors and a bit of AI, to go together with your design.

So making things like this will never be easy, combining the three layers is a real challenge. But then, what is life without a challenge.

And also in the near future the computers we know nowadays will be replaced by smaller ones, embedded into clothing, chairs, walls, and these computers will accompany us all the time (of course also not using cell phones anymore, also these will be embedded everywhere.)

Having explained this stuff leaves me free to present the results of a fruitful cooperation with by-wire.net, innovative fashion designer in Utrecht, the Netherlands. She advised me with the sewing and did the sewing herself for her own ideas and versions.

Blessing sleeve

Blessing Sleeve, wireless, first version…(preliminaries of Gossip: communicating clothes)

blog in progress…

In another blog entry I have told you more about the technical aspects. (atmega328, rf12, LCD with Wire lib, jeenode.)

This entry tells something about the blessing sleeve as a whole.

This whole is the idea, the design, the scripting, the making, the testing, the using.

My challenge is to try the imagining and designing and constructing at the same time.

This involves designing, sewing, scripting, thinking about “intelligence”…making lot’s of mistakes!

The blessing sleeve has a few sensors built in: a tilt sensor and a light sensor. This is all very nice
but how to make something that is really needing this sensors and doing something with this information.
This has to be improved.

the sleeve with the microcontroller and sensors

What was needed was a simple soft button. And this easiest of all things was the most difficult to solve on design level.
See this blog about the perfect soft button.

the pockets in the sleeve, with the atmega 328 and rfm12 on a jeenode

The problem is that the sleeve does not show the words sent.
Indeed it doesn’t show any form of “life”.
So should we believe this?
The solution is a kind of “blessing words watch”. A chip with a receiver and a display…
At the moment this “blessing words watch” is still very much an arduino and a LCD with a RF12 hoovering above it…

The idea behind this all is to explore the possibilities of intelligent clothing. So is this blessing sleeve
very intelligent?
No! We have to add behavior, a sort of purpose, and problem solving techniques to get to this goal…then
more communication possibilities…..(see version 42)

But we have to get started on this long road to intelligence in a very crude way.
Consider this blog as a diary!

Here you can download the blessing sleeves script. (Arduino script for the at328, and a rfm12s)
Here you can download the libraries I made. (for Arduino 18)

about the transceivers and technical details https://myfablab.wordpress.com/2010/06/06/rf-transceivers/

Your challenge is to come up with a better design, better script, better interface, ….

By the way, why just make a sleeve? This question will be answered in a future blog entry. Just for now: take the sleeve as a fashionable accessoire!

Design assistance: by-wire.net

Recycling Sleeve

Recycling Sleeve, wireless sending and receiving, first version….(preliminaries of Gossip: communicating clothes)

blog in progress…

This recycling sleeve is designed by by-wire.net. The scripting and assembling is done by contrechoc.com.

sleeve designed by by-wire.net

The basic technical stuff of the sending and receiving is done with an atmega328 and a rf12 fitted on a jeenode.
Details about this are told in another blog.

detail of Jeenode on a five sided shape embroidered, just below shoulder

The material is used for protecting your furniture during house moving. It is recycled material.

I combined this idea of the textile with a script that recycles received words. The takes the words it receives
apart, it stores the characters. And it looks if it is possible to form certain words from these stored letters.
When it is possible to make a word like “green” it sends this word in space and reduces the letters from the words received with the letters of this word green.

embroidering the pentagon

In this way not only the textile is recycled but also the words, the ideas received through radio frequency modulation.

The words received and sent can be inspected on a LCD display built in the sleeve.

Here you can download the recycling script. (Arduino script for the at328, using a TM161a, and a rfm12s)
Here you can download the libraries I made. (for Arduino 18)

about the transceivers and technical details https://myfablab.wordpress.com/2010/06/06/rf-transceivers/

As told in the blessing sleeve entry this is a small step in the direction of intelligent clothing…

By the way, why just make a sleeve? This question will be answered in a futrue blog entry. Just for now: take the sleeve as a fashionable accessoire!

Pro: good design,

Con: no further sensors, so at the moment nothing to get real life involved, so nothing to “talk” about (?)

Adapted or new libraries for the arduino 18

For the blessing sleeve, the recycling sleeve and the blessing cravate I needed a few libraries, adapted or modified.

These libraries could be useful? Anyway with the scripts you need them.

For the rfm12 module, transceiver.)
I got the really good library from Jeelabs.com, but modified it so that i didn’t have to inculde his Ports.h anymore. Actually this was only adding a clicktimer class.
RF12.zip (so only slightly different from JeeLabs.com, Ports.h is not needed, all credits to Jeelabs.com)

LiquidCrystal.h is very good, only it uses many pins! But I wanted to use the data pins for other purposes. So i switched to I2C. But then you need wire.h. But wire.h is a singleton? Based on twi.h which is in C. Anyway i had to build the wire commands into the LiquidCrystal class.
The solution is not perfect but it works.
LiquidCrystal_I2C.zip (LiquidCrystal.h plus Wire.h to be able to I2C to the LCD)

For the blessing cravate I wanted to show strings in morse code, so working from the arduino example of a library class and some script i found with all the morse code i constructed the class i needed.
http://www.arduino.cc/en/Hacking/LibraryTutorial
http://www.flatline.net/journal/wp-content/uploads/2008/04/morse_out.pde
This is a very simple class compared to the Wire.h and the RF12.h
Morse.zip

The perfect soft button

Making a perfect soft button.

Once in your life you should make a perfect soft button, my grandma always said.
And you will know when this time has come!

This was the time. I badly needed a soft button. I already had a blessing sleeve.
This blessing sleeve had two modes: fast sending a simple blessing and slowly sending a variety of nice blessings into the world.

I needed a button to switch between the modes.

You want to make this button fast, because the essence of this sleeve is in the blessings and the sending and receiving and the design of the sleeve.

Wrong.

This button eventually held up the finishing of the first version of this project. I had to do it perfect.
It had to be “mine”. What is mine, well that means for me related to the things I did in the past.
I did things with five sided shapes, called pentagons. There were two reasons:
One: the five sided regular shapes combines more interestingly with each other than squares do.
(Sorry Mondrian.)

This was a button of five sides made earlier, in this one i tried to stress the “soft”:

Two: (hold on!) in a soft space, (or curved space) like we have in the universe, you can measure
the curvature using a parallelogram, but the joining of the points (after left right and right left) requires a fifth side, so you end up with
a pentagon. The length of the fifth side is a measure for how soft the space is.
(Long live Gauss and Einstein!).

Here is that pentagon in curved space:

This meant my perfect soft button should be a pentagon in textile.
But how to construct this? Of course: there is only one perfect way that is the natural way!

I remembered an architect showing me how to make a pentagon with a single strip of paper, just making the most simple knot possible.
This was a solution for textiles too. It avoids drawing a pentagon on cloth, it is a natural way to
knot the cloth and obtaining a five sided shape. And it provides a pocket inside for the soft button.

This is the result fro a small button: (made of organza, difficult to take a picture of, it changes color when touched )

So this is my perfect soft button:-). Strange enough on a picture is still does not look perfect. Clearly it is not the perfect picture of the perfect soft button. I’ll try to improve on the perfect picture 🙂

(As told before this perfect soft button is used in the blessing sleeve.)

How to knot a pentagon:

starting with a simple knot

flatten it…

when having a soft pentagon, just sew the borders together, trying not to close everywhere

and the nice things is the pockets inside perfect soft button, which are perfect places to hide your conductive surfaces (usually aluminum foil on tape)