One night over a Loftwork dinner that I invited myself to, we were talking about what projects were needed for the group. Nami and the other members proposed an office improvement project to detect when the womens toilet was occupied. At Loftwork, the majority of the workers are female. On each floor, theres a one-toilet mens bathroom and a one-toilet womens bathroom. Since there are a lot of women working there, the womens bathroom is often occupied and the girls keep having to get up from their desk, check the toilet, and if its occupied, have to walk back to their desk. Hence, the Loftwork Womens' Toilet Sensor Project was born.
I was initially doubtful about the project. I could pretty much piece together what was needed in my head and
truthfully, it wasnt very exciting.
Essentially, theres an infrared motion detector, some type of
communications, and LEDs. Rather than looking for a simple solution to a
simple problem, I wanted to make things a bit more interesting. I told
them we should make the solution as design-centric as possible and try
to over-engineer it to the point of absurdity. I figured if things went
wrong, we could just fall back on a simple solution, but itd be more
fun and exciting to go (ahem) balls out on a design to see what we can
come up with.
That was actually a good idea. Over the next week (we only meet once a week for about 2 hours), we fielded design ideas from all members. We decided to use a design by Momoko which I thought was beautiful. Her idea was to have the toilet occupancy indicator look as if it were floating in mid-air with geometric symbols to indicate occupancy on each floor. There were three floors total so there would be three symbols.
Once the design was decided on, we had to start thinking about implementation. Momoko, Nami, and the other members designed the enclosure based on Momoko's sketches. After that, they proceeded to do a mock-up. Since the LED indicator was supposed to look like it was floating, they decided to use clear acrylic supports. I taught them how to bend acrylic using a lighter as well as score and cut acrylic. They then started molding an acrylic work piece for the mockup and tested out how it would look in the target location.
Once I had an understanding of what was needed, I put together an electronic prototype for them. For the electronics, I decided to use a PIR infrared motion sensor. This would be located in the toilet area. The output of the PIR would go to a Freakduino which would then send a message wirelessly at 900 MHz to a remote receiver. I decided to use 900 MHz over 2.4 GHz because there were a few walls that the signal needed to go through. For object penetration, 900 MHz is much better than 2.4 GHz and has less attenuation. Also, at 10 mW, the power output on the 900 MHz Freakduinos is a bit higher than the 2.4 GHz radios which would also help get through more walls. Interfacing a PIR motion sensor is very straightforward. It puts out a high signal when motion is detected and a low signal when there's no motion. I connected the output of the sensor to an interrupt pin on the freakduino had an interrupt service routine set a flag whenever any transition was detected. This would later get sent wirelessly to the receiver.
On the receiver, I discussed the LED indicators with the girls and we would initially try out a few colors to see which color worked best. I decided to use 1W power LEDs rather than normal LEDs because the visibility was so much better. Also, they were using frosted acrylic so a stronger source was needed to diffuse evenly over the whole surface and still maintain good brightness in the daytime. The receiver was using a matching 900 MHz freakduino and I used a darlington transistors to drive the power LEDs. Other than that, I just controlled the current with current limiting resistors. If you've ever interfaced an LED before, it's a standard setup but with transistors to drive higher currents due to the power LEDs.
In keeping with the overengineering theme, I had originally just planned to use the freakduinos as prototyping boards and then design custom PCBs based on the final design. I was also planning to teach them how to design a custom PIR motion detector as well using off-the-shelf Fresnel lenses. Things kind of worked out backwards though. They used the dimensions of the freakduinos and motion sensor as the model to design the enclosure for the toilet sensor. So in this case, the prototype became the final version. At least for the initial release. Hopefully in a future version, we can refine the design and do a custom PCB.
The motion sensor enclosure looked nice. Momoko used frosted acrylic and laser cut a wood grain pattern on to it. If you look at these pictures on flickr in high res, you can see the pattern. The other members also laser cut the top and bottom faces of the enclosure at FabCafe which is just below Loftworks.
Once we had the system put together, we tested out the LED colors. The power LEDs with the frosted acrylic were a good choice and they were plenty bright, even at noon when the office was the brightest. There are three indicators, one for each floor. Since there's only one toilet on each floor, we decided it's important to know which toilet on which floor was occupied. That way, even if the one on the current floor was occupied, in the event of a bathroom emergency, it's easy to know which floor to check next.
After the transmitter and receiver checks passed, we did a trial run. I brought a pair of walkie-talkies that we could use to communicate. I had special code running on the receivers to display the motion sensor status as well as the signal strength. We were basically doing a site survey to see how strong of a signal we could expect from the bathroom to the office area. The initial results were great and the signal was loud and clear. Then, as always, a problem arose. The first few tests, we had the main bathroom door open since there were a few people loitering around watching. Once we closed the door, the signal became heavily attenuated. The problem was the women's bathroom door was made out of fairly thick steel and was directly in the "line of sight" to the receiver. It's wireless kryptonite. Since the signal had to go through it, the metal would attenuate the signal heavily and would be extremely weak out to the office area. Essentially, the signal was unreliable at those levels.
The wireless signal attenuation was a pretty difficult problem to get around. I came up with two solutions for it. The first one was to use a larger antenna at the receiver. This was feasible, but not too desirable. Although the receiver would be hidden, I would like to avoid having a monstrously large antenna in the main office area of a design firm. It was a solution, but not the best one. The other solution I came up with was to change the modulation on the 900 MHz radios.
The standard modulation for 802.15.4 radios is called O-QPSK. It's a fairly complex modulation scheme and it's designed to allow data transmission robustly at a decent speed of 250 kbps which is usually more than enough for sensor data. By changing the configuration registers, it's also possible to use a lessern known variant of 802.15.4 which uses a modulation scheme called BPSK. This is a much simpler modulation and can only support data rates up to 40 kbps. Because it's so simple, it's also much easier on the receiver and basically boosts the receiver sensitivity. Changing the modulation scheme and lowering the bitrate is a trick that wireless engineers do to squeeze out more range from a system and can increase the range quite a bit.
Anyways, the modulation scheme change worked out and we were able to get a clear signal without having to use the larger antenna. This also is another piece of evidence in my personal theory that there is no such thing as an easy wireless sensor network deployment.
Once we had a working system, Ryoko, who is the leader of the group summarized what was accomplished. The next step was to give a short presentation on the project to the rest of the company.
To prepare for the presentation, the group decided to shoot a video on how the system would be used. Satoko drew up the storyboard and the others helped with documentation and pictures showing the techniques they learned to make the design.
During the presentation, there were some issues. The live demo didn't work because one of the wires broke on a board. Also, the system wasn't fully operational yet because there were design details that hadn't been addressed. The demo was rushed because there was a deadline for all the groups to present their projects so it was a bit of a disappointment to everyone to not be able to show a working system.
At our next meeting, Joe from Safecast was finally back in Tokyo and he started helping out, too. We got together and fixed the original system and restored it to its previous state. Momoko's idea was that no wires would be visible on the system in the office. This was difficult to do in practice. The first idea was to use ITO which is Indium Tin Oxide. It's a conductive film placed over glass and is used in a lot of touch screen devices like the iPhone. If the resistance were low enough, we could run ITO film out to an inconspicuous place and then join it on to power cables to power the receiver. Unfortunately, the ITO had a high resistance and was an unsuitable medium to power the device. One small square had 31 ohms of resistance so chaining a bunch of squares together would be similar to chaining resistors in series. Basically, there'd be too much resistance and we couldn't get enough current to power the board and the LEDs.
Rather than using ITO, Joe suggested we use 30 gauge transformer wire. Transformer wire is thin enameled wire used for transformer windings. It's also used for jumper wires by some people since you don't need to strip the wire. Simply tinning the wire with molten solder is enough to melt the enamel and tin the underlying metallic wire. The transformer wire idea was brilliant. It's almost invisible at a distance. We also tested it and it could carry enough current to power up the boards and the LEDs.
Finally it came down to crunch time. The group's morale was getting low because the system wasn't deployed yet. We spent a lot of time testing and making sure things would work which is the correct thing to do from an engineering point of view. However for the girls, this was their first design/engineering project so I think they were surprised how long it takes to actually get a physical/hardware design working and deployed. I could understand the impatience since I used to be the same way. I figured we should start moving more aggressively and push forward to make visible progress. The system was now working reliably and there wasn't a huge penalty if the toilet occupancy sensor malfunctioned. Well, assuming there aren't any errr....mishaps due to the toilet being occupied.
We got to the final stage and were ready to do a first deployment of the design. We suffered one issue where I accidentally knocked over the toilet sensor enclosure. It broke and so we taped it back up to fix it and it actually ended up looking really cute. Anyways, we weren't going to let that stop the deployment. The girls helped put all the finishing touches on the system and Joe helped with the installation. With the software and hardware done, I was mainly a spectator.
The transformer wire worked great and here, you can see a beautiful shot of the system with no visible wires. The freakduino is at the top of the picture and it has wires from the wall wart powering it. From the freakduino to the LED sign, we used the transformer wire. We also taped the thin wire to the edge of the acrylic to make it even harder to see. It's pretty much invisible until you get really, really close to the sign and look hard.
And so the Loftwork's Makers group had its first success. The first version of the Loftworks' Women's Toilet Sensor has been deployed.
We're still working on it to add occupany sensing for the other two floors. We had a discussion about the next steps and the group will open source the design files so others can make something similar. The hardware is mainly using the Freakduino and chibiArduino library, both of which are already open source. However once the design files are finalized and released, I'll also package up the hardware, software, and Arduino sketches into one zip to make things easier for people to duplicate.
Congratulations, girls! You all did a great job!