xbee hello world!

Today I’ve had my first success with communicating between two Xbees. Mostly thanks to this simple but clear tutorial. After installing the XCTU software with Thijs a few months back I had forgotten quite a lot of his private class “introduction to Xbee”. From his instructions I ordered 7 Xbee antenna’s and one Xbee explorer USB. My goal is to make an Xbee network without using Arduinos with the Xbees. This apparently is possible. But before getting to that point I had to make an Xbee “hello world” to grasp the concept and get the basics right.

In this picture you see the a light sensor attached to an Arduino and Xbee antenna. The Arduino prints the measurements to the serial port. Through the TX and RX pin the Arduino is connected to the Xbee antenna. This sends data to the other Xbee antenna that acts as a receiver. The data is printed in red in the XCTU terminal on the right.

On to the next step: running the Xbee on a battery and programming the Xbee pins to read and send the wind sensor data. To be continued…

device and software

I’m currently developing the device design and the software for breathing_time. I realise now that the form factor of the device must come from the possibilities of the wind sensor. It works best when the breath is guided to the sensor. That way I can detect inhaling and exhaling. I’ve been trying out different sizes of cones to fit on my face:

And finally settled for a size in between:

In this prototype I build the sensor into the cone which makes it nice and stable and catches the breath in an optimal way. I also tried a collar type design:

Where the “collar” catches the wind. It works fine and has some advantages but you can’t capture inhaling this way.

I’ve done some work on the software. I take the wind values and the temperature values from the sensor. The temperature values give a good indication of the direction of the breath. The combined data I use now to determine the direction of the animation (depending on in- or exhaling) and the colour. But of course a lot more things are possible.

I’ve constructed a “brush” from various shapes in different sizes. It will be nice to generate “brushes” dynamically, depending on the data. But for now I’m still refining the basic detection and I will continue with the aesthetics when that is stable.

wind sensor demo

Yesterday we managed to get the first wind sensor working. Together with Richard I  connected the sensor to the RBBB board, calibrated it and read some wind/breath data from the serial port into Processing. It works surprisingly well:

I have already noticed that the distance from the sensor to the nostrils is critical. I’ll have to experiment. Richard had a nice idea. I should use the tubes to direct the air from the nostrils straight to the sensor for the most accurate result. I will give it a try. It will make the wearable more scary but that doesn’t have to be a problem :)

breathing device

Constructing the RBBB Arduino isn’t as easy as suggested. The manual says 30 minutes. If I don’t make any mistakes (to which I’m prone) I might be able to do it in an hour but no less. After I didn’t manage to get the first one to work I started out with a fresh one (I’ve got to build five.) I only made one mistake and when I plugged in the USB cable (be sure to chose Uno from the board list) and uploaded the blink sketch it worked!

I want to give the users of the device some direct feedback about their own breathing pattern. So I’m thinking about an LED that dims when you exhale and brightens when you inhale. I tried just putting an LED in the tube and the result was really nice:

Apart from the light I want to make the users more aware of their breathing getting input straight from their body. Tying the micro-controller to the chest (inside some kind of tubing) with an elastic band you become more aware of your breath in a subtle way:

And I did some research on flexible tubing. It looks nice and it is functional so I’ll probably go for this solution:

So things are shaping up. I’m eagerly awaiting the wind sensors from the states…

curing Bluetooth

Yesterday I worked with Michel from the A&T lab to discover what was wrong with my Bluetooth connection. It was interesting to see how Michel went about it:

Michel testing the Bluetooth module

  • We first tried to get data from the set up as it was. Nothing happened just like last week.
  • We then used another Arduino to check of we could connect to the Bluetooth module. With the Mac software CoolTerm we verified that data was send over Bluetooth.
  • When this was the case we tried my code. The was an error with the Wire library. We commented out that bit of code and tested it and for the first time since a long time I saw the formatted string with sensor values.
  • The next step was to test the code on the Arduino mini in the wearable. Michel made sure the TR and TX wires were crossed. Still nothing happened.
  • We then replaced the rechargeable batteries with the 9 volt battery Michel had used. It worked in CoolTerm!
  • I started the test AQAb app on my Android and yes! a nice formatted string appeared on the screen.

To conclude I think the problem was a mixture of problems: wrong wiring, an error in the code (Wire library) and not enough power. But now we can continue with the app, with a big thank you to Michel.

Ups and downs

measuring electricity

Paul explaines how to measure the power used for the heating of the fabric

I’m having a hard time with my wearable. There are different areas where I’m experiencing problems:
- The thermochromic ink deteriorates very fast. Under influence of UV radiation for which I haven’t been able to find a solution. The amount of electricity it needs to heat up is very much depending on the air temperature. Also the width of the strip of fabric (this has to be equal for the whole length) is crucial for successful colour change. So there’s a lot of testing ahead before this will work well. I have switched from reflective strip to using reflective fabric, I wonder if the performance will improve.

bt-arduino

Arduino talking to Nokia

- I’ve been talking to a lot of experts lately but Friday last I got a pretty disturbing e-mail from the RIVM which is a leading Dutch centre of expertise and research, it advises and supports policy-makers and professionals in public health and environmental areas. The gases I’m measuring are a good indication of air quality but the sensors I’m using aren’t sensitive enough. I was happy to find gas sensors in the first place but now they appear to be worthless for my purpose.
- Programming the Bluetooth connection has made some progress. I can now connect with the Arduino board and send and receive bytes. Now I’m at the final stage of sending all of my sensor data in a single string to the Nokia. I also have to find out how to let Python check for incoming serial data continuously. Some sort of event listener.
- I keep having trouble using the internal GPS. It seems to break down after I’ve used it once. Only a restart will make it work again.
- On the bright side I’ve made two dummies for my vest. Saturday I worked together with my tailor on my second dummy, using the actual fabric. This gave me a lot of insight in what I want. Discussing it with AnnaMariaCornelia it became clear that I have to take a radical turn to make my vest look like true work ware. I’m really looking forward to designing my vest and make it look sturdy and cool to wear.

dummy_2

The second dummy which at this stage looks too much like an apron

Hardware integration

Buttons, temperature and humidity sensor

Buttons, temperature and humidity sensor

On the photograph you  can see the 5 volt circuit. It houses two sensors and two buttons. At the workshop last Saturday I put together button circuit, if you press the white one it means it smells good, the brown one indicates it smells bad. This is of course just a functional setup, purely for testing hardware and code. Later I’ll make soft buttons which will be integrated in the vest. We also made the humidity sensor (the kinky copper plate, we ran out of circuit board.)  It will take some time to calculate the actual humidity from the output and before I can use it with the ozone sensor. A period of extensive callibration is due anyway.
I worked on the code which I completed today. The Arduino now collects data from all sensors (except the gas sensors which somehow have stopped working at the moment) and outputs an ‘e’ when no buttons was pressed, a ‘+’ when the smells good button was pressed and a ‘-’ when the bad button was pressed. It works in a two minute loop which is broken when a button is pressed, then data is immediately collected and send.
As for the sending part, I’m still working on the Bluetooth connection between the Arduino and the phone.

Building a heart-rate sensor with Richard

Date: 20-06-08, present: Danielle & Richard van Bemmelen

I asked my friend Richard to look at the instability of our current heart rate sensor. Richard is a programmer and engineer so exactly the right man for the job :) It was kind of hard to analyze the current device as everything was soldered together. But Richard discovered that there was a flaw in the design with caused the device generating random measurements.

We had to totally reconstruct the sensor. Using an extra potmeter to stabilize the measurements. This will later be substituted by a resistor. We also used a new light sensor which has a range of 2 – 20 k.

For testing we used a make shift setting with an LED connected to the laptop USB port :) We did three tests: no exertion, heavy exertion and a blank test to look for deviations. The latter appeared to be almost none existing. For this test we wrote a processing script which captures the data from the arduino and writes the results to a csv file (text file). With Excel we can easily visualize this data in a line.

If I find out how I’ll post the Scheme heart-rate sensor and processing pde code .