Friday, August 12, 2011

Accelerometer + Xbee = geekish fun



Hi there, I hope you are all having a nice holiday season.
As for me, I am keeping quite busy despite the loneliness and am desperately trying to do my job, some volunteer help for the Tohoku area, turning the website for our PTA upside-down, transforming a two storeys (stories?) open room type house in a 3+LDK, and helping out my lil brother on his science assignment. And there's today's story.

So introduce my brother, who has been playing with water rockets since he was in high school. Now for his first year at university he managed to get himself a science assignment dealing with those

very things. I won't explain the principle at hand here because I already have lots of things to say, so look up wikipedia (I suggest reading the discussion page there too, it is abysmal in epic proportions) or check out this NASA picture.

Now you can imagine that you can do lots of fun stuff with your own rocket, especially when you learn that the record height achieved is around 600 meters... Well, a 2L soda bottle won't go that high, but it is still a very interesting way to conduct extreme experiments around embedded/autonomous systems.

When I was around the parents' home back in France, he tells me about his latest experiments
and how they thought they wanted to get telemetry readings for the system. That sounded cool, and I was thinking about my co-worker here who does all those neat things with arduinos, xbees, sensors and so on...

Actually, my brother and his friends' main skills are neither geekygadgetry nor computer science, so the final picture is not as complex as I imagined, but still beyond their reach. Based on a survey around his friends and professors, he gathered that Xbees are cool and can work in an autonomous way without any microcontroller, which is good when you don't have a clue. They are small chips (see pic on the right) that do 802.15.4, present a serial emulation to the user, feature 5 analog inputs and an associated ADC, and have a decent (depending on your own definition of decent) sampling frequency.

Well, to be honest he actually told me about this all on the phone before I came back, so that I could do a small shopping trip around akiba and bring an accelerometer. There it is : KXM52-1050, straight from Akizukidenki, behind the now defunct Yamagiwa/Livina (just saw they were doing some construction work there, something happening soon I guess). So this little chip eats 3.3V which is all great because most of the boards that can host the Xbee provide a 3.3v regulator to feed the sensors.

Now here's his plan : one Xbee on the rocket, with some form of power supply, hosted on a regulated board, where to hook the accelerometer sensor as well. On the receiving side, another Xbee (using just one doesn't make sense, does it ?) on a USB board plugged directly into a computer, and voila. It sounded so EASY.

Now that I look back on the whole process, it was. But for some reasons, the Xbee manufacturers went through great pain to write a very detailed yet completely useless documentation. All the information needed is inside, but after reading the whole 68 pages, I felt like I did not know what to do. Also there has been several versions of the chip, things changed, and there is no clear history of what went and what didn't. One important thing I learned at my expense is that the ADC used to do the conversion on the fixed 0~1.2V range only. But, in the latest document there is no mention about the voltage range. There is a two-line section about ADC that states that "Xbee supports ADC and here is how to enable it". Period. After lots of digging I found out that the "Pin signals" table stated that Pin14 is for "Voltage reference for A/D input". If the 68 pages were a haystack, this line would be the needle.

And then, the plan worked ! That is, until I saw the "software" that some friend gave to him in order to do the Xbee monitoring. If you can call a VB 20-liner a software, that is. Which is way I made another one for him that does .csv export and much more. More on it in another article but meanwhile, enjoy the output. Guess which line's the Z ?


PS: I know I am getting behind schedule with the follow-up to the pachube article. It is still in the pipeline...

Tuesday, June 7, 2011

The internet of things is good for your health


At some point, the "Internet of Things" (IoT) was a quite popular topic. I guess they lost the buzz war against the clouds but yeah, it's a fight you'll never win... However, the whispering shadows of sensor mania and IoT can still be heard if you listen closely. And, IoT can actually be good for your health !


As a concept, IoT is as loosely defined as "cloud", but what did you expect from a buzz war contender anyway ? For this article we will focus on an instance of a very specific IoT concept and platform, called pachube. In just one sentence, Pachube is a web service that provides centralized hosting for sensor data. As most web services it is rate limited, and offers different limits based on the premium you pay. There is also a free service.

On the other hand, I guess that by now most of the people reading this have learned about the twin disaster that hit Japan, followed by both an unlikely nuclear meltdown and unfortunate radioactive leaks in the air, soil and water. In this context, people suddenly realized about Geiger counters and they quickly sold out. A few brave people put theirs on the web, through various means (digitizer software, webcams, etc...).

Now this is the kind of Thing that can go into the Internet of Things. So a few of the people that had digital probes or probes with digitizer software set up a pachube account to host measurement data. Then someone stepped forward to put together a user interface for all those values and plot near-realtime measurements on a map. Here it is : http://japan.failedrobot.com



Next I will show you how to get some values from pachube to put on display in your own webpage, so stay tuned...

Monday, April 18, 2011

User interfaces gone fuzzy, a case against new interaction devices

So this is a rant about all the trendy new interaction devices. In fact, not so much against the devices themselves, but the way people keep trying to use them to emulate old things.

Our knowledge, our science, our tools have been built in an incremental way. Of course, who would invent a spanner when nuts and bolts don't exist ? And even though sometimes, someone has a great idea that is very far-fetched, it also often meets with doubts and perplexity. This is how we just avoided getting computers 100 years early, which might have bumped human technology on a very different path.

And so this is how after getting computers and monitors, people feeling the urge to interact with those beasts soon made out the keyboard, and then the mouse. For a very long time keyboard and mouse have reigned supreme over the world of user interfaces.

Hypertext Editing System. Original photo by Greg LloydHypertext Editing System.
Original photo by Greg Lloyd
source: wikipedia

Of course there had been attempts at alternative ways, but these interfaces never took off and were doomed to stay a niche market. Probably a few schoolboys and girls from the 80s in France remember the Thomson light pen ? And there have been graphical tablets for decades now, and people using 3DVR stations have those gloves, and videogames have their own things filled with buttons.

But we all know the latest trend that seems to take off for real, is touch screens. This is not the dawn of touch interfaces, it has been pioneered for long by the graphics industry. Despite a few attempts at PDAs and smartphones (P900 anyone ?) that were expensive toys, the widespread use of touch devices has more likely begun with the nintendoDS and then the iPhone.

So what's wrong with touch devices ? I would say feedback. When you learnt to use a keyboard for so long, feedback is what makes you know you mistyped even before seeing it. This does not happen with touchscreen emulated keyboards. Now worse, the software thinks it is smart enough to guess what you intended to type, even in some situations where you did *NOT* make a mistake.

This is all because we want to use touchscreens the way we used keyboards. But touchscreens will never be keyboards, they are screens ! Kids like to look at pictures and slide them to see the next one. This is intuitive and cool. Probably the kids born around now will never have to use a real keyboard and won't miss it. But for me, as much as the mouse supplements the keyboard but can't substitute to it, so much can be said about the touchscreen. How many people use mouse emulation with the numpad ?

Don't type technical words !

This all-touch trend, I call it "fuzzy interface". And by the way, I find it much more straining to type on the touchscreen because you have to check continuously that no error has been made, either by you OR the software. Here is an anecdote to close this case, redacted from a Google Summer of Code mailing list for mentors :

. Random person says ''company XYZ can help assess candidate students abilities blablabla....''
. Person in charge from Google answers ''actually I am hot interested in other companies reviewing our students..."
... 8hrs later, same Google person : ''Not, not hot. Touch screen keyboard :-)"

Happy touching !

Thursday, January 6, 2011

Best wishes for 2011

Hi dear readers, and welcome to the year 2011 (of the cute bunny) that should hopefully be more peaceful than year 2010 (of the tiger).

As some people might know, my hobbies include (a lot of) cooking so it is with a recipe that I am going to kick off the new year. All ingredients can be bought here in Japan, so you can probably cook this one almost everywhere in the world.

Tuesday, August 31, 2010

read.air : How to sort a "Vacances" worth of pictures on-the-go ?

This is the story of a pet project I called read.air.

So the holidays are nearing the end, and I am so happy that I am back to Tokyo for the hot days. When I say I am going to take 3 weeks off, people here dub it "vacances" (read: bakansu) because apparently French people are customary to long holidays, so much so that the name has been borrowed.

More alarmingly, my wife has been gone for 2 months with a borrowed SLR digital camera (thanks to the generous sponsor by the way). So this means that instead of having thousand of pictures piling up in the iphone camera roll, they are now piling up on SD cards. She took around 4 or 5 of these 4Gb cards and since she is experimenting with the camera a lot, there are many many blurry, over/under-exposed, or just failed pictures.

As convenient as the back panel LCD might be, it is not as efficient as handling them from a much more powerful touch device, however I hate it. Also, the designers of the iphone did a perfect job at crippling it as far as interoperation is concerned. So how do you read a SD card with an iphone ? You don't.