Tuesday Dec 07, 2010

Harnessing viruses to build a better battery

NewImage.jpgOk, now this is cool. You may not think so, but I sure do. I spent a fair amount of time researching battery types and capacities, as well as costs, and to say that it is a dizzying and complicated area is to massively understate the problem.

Considering that just about everything we use these days needs (or could benefit from) a small, lightweight and energy-dense battery (you can't really get all 3 at this time), this could be a huge step forward.

Keep in mind that one of the reasons that electric cars don't really 'work' for most applications is that the weight of the required batteries decreases the efficiency of the vehicle and, at some point, becomes counterproductive. It's all about energy density. It's the same reason that personal jet-packs don't work: You can't carry enough fuel to fly any great distance.

So if you can increase the energy density of the battery, without significantly increasing its overall weight, you win. This reported 10-fold increase in energy capacity would make this a winner.

The first virus to be discovered was the Tobacco mosaic virus (TMV) back in 1898. It is a rigid, rod-shaped virus that, under an electron microscope, looks like uncooked spaghetti. This widespread virus devastates tobacco, tomatoes, peppers and other plants but in the lab, engineers at the University of Maryland's A. James Clark School of Engineering and College of Agriculture and Natural Resources, have managed to harness and exploit the self-replicating and self-renewing characteristics of TMV to build tiny components for more efficient lithium-ion batteries.

To create the highly efficient batteries the researchers first modified the TMV rods to bind perpendicularly to the metallic surface of a battery electrode and arrange the rods in intricate and orderly patterns on the electrode. Because TMV can be programmed to bind directly to metal, the resulting components are lighter, stronger and less expensive than conventional parts. They then coated the rods with a conductive thin film that acts as a current collector and finally the battery's active material that participates in the electrochemical reactions.

10-fold increase in energy capacity

This results in an electrode with a greatly increased surface area that increases its capacity to store energy and enables fast charge/discharge times. The new batteries boast up to a 10-fold increase in energy capacity over a standard lithium-ion battery. The researchers say that the use of the TMV virus in fabricating batteries can be scaled up to meet industrial application needs. And because the TMV becomes inert during the manufacturing process, the batteries do not spread the virus.

"The resulting batteries are a leap forward in many ways and will be ideal for use not only in small electronic devices but in novel applications that have been limited so far by the size of the required battery," said Ghodssi, director of the Institute for Systems Research and Herbert Rabin Professor of Electrical and Computer Engineering at the Clark School.

"The technology that we have developed can be used to produce energy storage devices for integrated microsystems such as wireless sensors networks. These systems have to be really small in size - millimeter or sub-millimeter - so that they can be deployed in large numbers in remote environments for applications like homeland security, agriculture, environmental monitoring and more; to power these devices, equally small batteries are required, without compromising in performance," added Ghodssi.

(Via Harnessing viruses to build a better battery.)

That may be too information-dense for some, but suffice to say that it's kind of cool that it is using the Tobacco mosaic virus to increase the energy density. It's not clear if this type of technology could be useful in larger batteries like those required for electric cars and other larger applications, but being applicable to small (as in really small) devices makes it very interesting to me. If this technology is able to come to market in a useful package, it would certainly validate a certain amount of the research bets that we made by putting relatively power-hungry 32-bit processors on our sensor platform.

As an side, it also looks like some of the smart folks at MIT have done something similar that they think could be used in larger applications like electric cars, etc.

Using a virus that infects bacteria but is harmless to humans known as a bacteriaphage, the team were able to show it is possible to build both the positively and negatively charged ends of a lithium-ion battery using genetically engineered viruses. According to Angela Belcher, the MIT materials scientist who led the research team, the resultant virus-produced batteries have the same energy capacity as state-of-the-art rechargeable batteries being considered to power plug-in hybrid cars, and they could also be used to power a range of personal electronic devices.The benefits of this process is that it's both cheap and green, since it takes place at or below room temperature in an environmentally benign process that requires no harmful organic solvents and no toxic materials.

(Via New virus-built battery could power cars, electronic devices.)

So there you have it. We're finally going to extract some revenge on the much-maligned virus and bacteria and make them work for us for a change. Until, of course, the batteries become self-aware, at which point Sky-Net will be complete and we'll be toast.

Thursday Oct 14, 2010

How a Physically Aware Internet Will Change the World

censors.jpg It's the beginning of SkyNet folks. Mark my words!

The next revolution of the Internet is not going to be built on manual input of information by 500 million or a billion users. Rather, there is much greater potential in connecting computers to sensors so that valuable new information can be created automatically without human data entry. Much like the early days of the Internet (which was purpose-built to help maintain our collective safety and connectivity), the next generation of sensor networks can monitor our environment and deliver relevant information –- automatically.

[From How a Physically Aware Internet Will Change the World]

Actually, this is something that I've been saying in talks for the last 4+ years! I've been saying that even if every person on the planet carried 3 cell phones, and had a personal computer, that would still be only about 20 Billion devices. Basing anything on the number of humans on the planet limits your market. On the other hand, if you put a sensor in every tire in every car, in every light socket, every switch, every everything that you can, then you're talking real numbers -- in the Trillions. Now that's a big market!

I'm just glad someone somewhere was apparently listening.

Wednesday Apr 07, 2010

Wireless sensor tags create an `instrumentation cloud`

This looks pretty cool ...


A US company has developed a wireless sensor card that introduces a new concept for performing measurement and analysis, known as the "instrumentation cloud". Cores Electronic's Tag4M WiFi sensor tag no longer relies on software running on a specific PC. Instead, it transmits data the Internet and uses Web pages as "instruments" that can be accessed by any device that that can surf the Web, including mobile phones.

According to Cores' president, Marius Ghercioiu, the tag "heralds a new way of collecting real-world data where we are throwing off the chains that bind us to specific hardware and software. Most wireless sensor units currently on the market are designed to work in local mode with a computer running a specific software application. In contrast, we designed the Tag4M to interface with a Web page, which can be hosted on any Web-enabled hardware, whether in your pocket or across the country."

More info here. [From Wireless sensor tags create an `instrumentation cloud`]

Tuesday Feb 12, 2008

Creative Spammery

I get some weird stuff, I'll grant you that. But this one ... well, it's almost as weird as the last spam I got from the "FBI." But this one ... well, I am at a loss as to what kind of job to give this guy. He obviously has skills.

From: chukegbub@yahoo.com

Subject: Application for any available job any where possible please

Dear Sir
How are you?
No matter what, i still appreciate God for my life and to God be all the glory(1st Thessalonians 5 vs 18), i've being a jobless person for sometimes now as a result of idealness that has actually culminated to a penurious lifestyle. therefore, for this golden reason and with all humility could you please give me a "hand" in getting any available job or work to do anywhere possible this is my mobile phone number 08061166955, i shall be forever gratefull to you for giving me the golden opportunity to seeing my life transform for the better and gloryfying God.
Thanks a million for your immense cooperations as i look forward to reading from you soonest with regards the contents of this marvellous mail.
Distinguished regards from
Chukwuma Egbubine.









TEL: +2348061166955

DATE OF BIRTH: 14/02/75


Well, with hobbies like that, and such a detailed resumé, it's hard not to hire him for something.

I hope someone out there has the perfect job for Chukwuma.

[ "I thought you were trying to get into shape."
"I am. The shape I've selected is a triangle." ]

Monday Feb 04, 2008

Muscle Wire

So I've been thinking about this stuff for a long time. Servos are all well and good, but I really think that Muscle Wire is way too cool not to play with. Also called Shape Memory Alloy it is basically a wire that, when heated, either externally or by running a current through it, changes its shape.

Much like when your muscles contract, a muscle wire shortens when heated. Not much, typically 3% - 5%, but that's enough to get some motion. Individually, they are not very strong, either, but then again, neither are individual muscle cells, or even small strands of muscle fiber. String them together in bundles, and you have something that can be very strong.

So I really want to try hooking some up to a Sun SPOT and seeing what I can do with it. The prices are coming down, so maybe I can find some cheap enough that I can experiment with them.

I've seen some rather simplistic videos on YouTube of folks doing some very simple things with Muscle Wires, but I think there is great potential for more.

[ Those who express random thoughts to legislative committees are often
surprised and appalled to find themselves the instigators of law.
-- Mark B. Cohen ]

Wednesday Jan 30, 2008

Our Luculent Leader

Apparently Jonathan has a wry sense of humor, buried in there somewhere.

From Wordnet:



  • S: (adj) limpid, lucid, luculent, pellucid, crystal clear, perspicuous ((of language) transparently clear; easily understandable) "writes in a limpid style"; "lucid directions"; "a luculent oration"- Robert Burton; "pellucid prose"; "a crystal clear explanation"; "a perspicuous argument"

But you have to read the whole thing to really get it.

[ Eat drink and be merry, for tomorrow they may make it illegal. ]

Friday Jan 25, 2008

SPOTwood Derby

So my son is in his final year as a Cub Scout (a Webelo), and has always entered the Pinewood Derby, though never for racing, just for design. He's either won, or come in second, every year.

But this year I decided that I had to enter, and get some much-needed telemetry from the car as it hurtled down the track.

Well, race-day is upon us. I have been busily building my car, and it's ready. I can't do the final assembly until race time, as I have to keep charging my on-car SPOT, but I can post some pictures here of the car in its current state.

Some explanations:

  1. It's ugly
  2. It uses the required zip-tie to hold the whole thing together
  3. it most likely will not win any awards for speed or design
  4. the red LEDs on the back, and the green LEDs on the front, will flash while the car is running.
  5. I will post the actual race telemetry (using the Sun SPOT Telemetry Demo shipped with every SPOT Kit, slightly modified).

So, here are the pictures:

P1250267 P1250268 P1250269

So, Telemetry numbers and graphs will follow after tonight's racing!

[ To every Ph.D. there is an equal and opposite Ph.D.
-- B. Duggan ]

Wednesday Dec 12, 2007

All I want for Christmas ...

No, not my two front teeth, silly. But I consider myself a "discerning geek" so this is, of course, a must. :-)

Plus it looks so cool with that bow!

Check out the whole thing at Research.sun.com

[ The law will never make men free; it is men who have got to make the law free. -- Henry David Thoreau ]

Mobile & Embedded Conference

So I got an announcement for a Java Mobile & Embedded Developer Days Conference coming up, and it sounds like it is going to be a great one. Our own (the Sun SPOTs team, that is) Eric Arseneau will be presenting, so of course it will rock.

Check it out, sign up, and show up!!!

[ "Last week a cop stopped me in my car. He asked me if I had a police record. I said, no, but I have the new DEVO album. Cops have no sense of humor." ]

Tuesday Oct 30, 2007

Underwater SPOTs

So I just got the following in an email from our guys at Warren-Wilson College:

"We just tested the SPOTs in our study area and were able to get close to 400 feet from the basestation to a SPOT that was enclosed in an Otterbox and submerged in the Swannanoa River (running the tempsensor code sample). I think we're going to start shopping around for some external sensors on Sparkfun..."

They also posted some pictures to our Facebook Group of their Otterbox setup.

[When a Banker jumps out of a window, jump after him -- that's where the
money is.
-- Robespierre ]

Embedded.com Sa...

Embedded.com Says that Sun SPOTs are "the fastest prototyping platform available at the moment." Which I think is pretty high praise. Of course, they complain that we don't have Zigbee, which we don't, and that we don't have Mesh Routing, which we do. But all in all it is a very good article, and hey, they love us, so how bad can that be?

[It is now 10 p.m. Do you know where Henry Kissinger is? -- Elizabeth Carpenter ]

Sunday Oct 21, 2007

We're on Engadget

I guess that this is our "we've really arrived" moment. Or maybe our You like me! You really, reallly like me! moment, but Sun SPOTs have been mentioned on Engadget ...

Check us out ...

Sun's SPOT: a poor man's Minority Report interface:

[Cabbage, n.: A familiar kitchen-garden vegetable about as large and wise as a man's head. -- Ambrose Bierce, "The Devil's Dictionary" ]

Monday Oct 01, 2007

Sun SPOTs in GIS

63623533_9af837fb83_b We have just (well, a few weeks ago really) begun a collaboration, of sorts, with some folks at Warren Wilson College to do some exploration of GIS application of Sun SPOT technology.

This is cool stuff. Professor David Abernathy from Warren Wilson College in Asheville, NC is exploring the possibility of using Sun SPOTs in an installation in a rain forrest in Panama.

To begin with, they will do a Campus Sensor Network to test the viability of the Sun SPOTs, and from their move to deploying more Sun SPOTs as part of the project in Panama.

I just hope I get to go to Panama, though I'd settle for Asheville for now.

[When we are planning for posterity, we ought to remember that virtue is
not hereditary.
-- Thomas Paine ]

Technorati Tags: , , ,

Friday Jun 08, 2007

I feel better already

After reading this blog entry (Crossbow and Microsoft Create .NET Wireless Sensor Development Framework) I feel much better.
We took a certain amount of grief over the price of the Sun SPOT development kits. Some folks complained that they were too expensive, etc. Reading the above, I feel that we have been thoroughly vindicated in our pricing structure.
Plus their kit comes with " ... an evaluation copy of Microsoft Visual Studio 2005." Heck, we give you a full version of NetBeans right on the CD!
Anyway, As I said, I feel that we are now fully vindicated, and way ahead on this one. We are turning Sensor Network application development from a hardware problem to a software problem. And we're leading the charge.

["All snakes who wish to remain in Ireland will please raise their right hands." -- Saint Patrick ]

Tuesday Jun 05, 2007

Free Sun SPOTs are cool!

This 'Deputy Tester' program sounds really cool, and I hope to take part in it for other things. Not for this one, for obvious reasons, but I’ve got two free Sun SPOT Java Development Kits (value $550) for the ZDNet readers who… seems cool to me for obvious reasons!

So all of you that want a free Sun SPOT Development kit, get to it!!!

[You can only live once, but if you do it right, once is enough. ]

Thursday May 24, 2007

Sensor Muffins

Ok, so if you were at either Burning Man (no, I'm not giving you a link to Burning Man) or the Maker's Faire you saw the Muffin People. I love the Muffin People. These are the Muffin People in action:

Not only are the Muffin People themselves very cool, but they have built some cool Muffin Cars. I want a Muffin Car.

But that's not the point of this blog entry. See, we have (for about a year or more) called our co-worker, Arshan, "The Big Muffin." Sometimes Muffy for short. So when we showed up at the Maker's Faire and found our booth right next to the Muffin People, well, how perfect was that?

So of course we had to get a picture of Arshan in a Muffin (or cupcake, we weren't going to be picky). Of course we succeeded.


Of course it gets better. It turns out that Ms. Blueberry Muffin also wears a special Cupcake Bra. So she agreed to let Arshan wear that, too (quite sporting of her, really!). Of course we have a picture of that, too.


So there you have it.

Next, I want to collaborate with the Muffin People to make some Sun SPOT controlled mini-muffins that can follow them around like little ducklings (muffin-lings?).

I hate my job. :-)

["Our vision is to speed up time, eventually eliminating it." -- Alex Schure ]

Tuesday Apr 24, 2007

On the internet, no one knows you are a dog ...

Well, that used to be true, but now, thanks to this innovative, brilliant, and completely awesome project, based on Sun SPOTs and detailed here we know that's not always the case anymore.

I have to say, this is exactly the kind of thing I had hoped we would see happen once Sun SPOTs were released into the wild: Creative and imaginative people doing amazing, wild, crazy, and totally unexpected things with them.

So far, this project is the first (of which I am aware) such project. But I want to see more. Lots more.

[One nice thing about egotists: they don't talk about other people. ]

Saturday Apr 21, 2007

Link between dog and Internet

Link between dog and Internet

Now this is exactly the kind of important research and innovation that we here at Project Sun SPOT were hoping to see come about as a result of the release of Sun SPOTs to the general public.

We here at Sun Labs have done some of the initial experiments such as Sharks, with frickin' lasers on their heads, determining with scientific accuracy that the light does, indeed, go off when you close the refrigerator door (still need to blog that one, but maybe I'll wait until I'm allowed to sacrifice one of the cats to do the whole Schrodinger's Cat/Refrigerator experiment at once), etc.

But this whole Dog on the Internet thing is huge.

The follow-up post from my boss is a classic, too.

[Chicken Little was right. ]

Friday Apr 06, 2007

Sun SPOTs Hit the ground running

So it's been all of a week since the Sun SPOTs went on the market and started shipping.

I'll let that soak in for a minute....

Yes, Sun SPOTs are now on sale, and are shipping (often shipping the same day that they are ordered!) You can order one (or more!) here (http://www.sunspotworld.com/products/).

This may not seem like a huge deal to you, and maybe it only seems like a huge deal to me because I've been in the middle of it for so long, but this is a huge deal!!!

We have been working on Sun SPOTs for only about 2 years. This is the next generation of Sensor Networks technology, and it's all running Java. Java on the metal. Small, embeddable, wireless sensors that you can easily program in Java. All you software jockeys that drool when the hardware geeks get out their soldering guns, step right up! I've posted before about how easy it is to add hardware to these things -- about how it's now a software problem -- and it really is true! See this project, and this one, or even this one. And those are just mine!

We've got them all over the Project Blackbox Tour

SPOTs Rock!

This is a research project gone horribly wrong. :-) Horribly wrong in the sense that it has taken on a life of its own, and gone screaming out of control into the world. A success-disaster. We are shipping these things. And they are selling like hotcakes! 100 kits in 5 days of sales is rather remarkable. The hits on SunSPOTWorld.com went from ~100/day to well over 1,000/day.

They are doing great things for Sun. North Carolina State University has now based their Senior Design course in Sensor Networks on Sun SPOTs. University of North Carolina's Renaissance Computing Institute is dropping them out of autonomous helicopters for disaster detection. NASA wants to send them into space. The Myth Busters have some. The list goes on.

Once these are gone, we'll have some that will be RoHS compliant, so we'll be able to sell them to the EU and places other than just the US. Sun SPOTs are about to take the world by storm, but we like to start small. :-)

Ok, I'm in the midst of a huge new 'deliverable' of my own right now, so I can't write much more than that, but go, order kits. Develop cool new applications in Java for sensor networks. Post your questions or successes to our forums on Sun SPOT World.

[Lizzie Borden took an axe,
And plunged it deep into the VAX;
Don't you envy people who
Do all the things ___YOU want to do? ]

Thursday Mar 08, 2007

Camera Whitepaper

So in the interest of making things easy, I have written up this blog entry on the Servo-controlled camera as a pseudo-whitepaper which you can download here if you're interested.

[Never trust a child farther than you can throw it.]

Tuesday Feb 27, 2007

Technology Awareness Day with Sun SPOTs

I love it when a blog post shows up in my email already written. Makes my life so much easier. :-)

Date: February 27, 2007 9:25:41 AM PST
Subject: Technology Awareness Day (TAD)

I had the opportunity to see a demo of the Sun SPOTS when I attended
the Software and Java Ambassador training in January. I talked to you about
obtaining a development kit for a Community Event that we do in
Fort Worth, TX. I have participated in Technology Awareness Days for
7 years and find the students very interested in learning about our
technology. The event is for low income students and they are there
to learn about Technology and Educational opportunities so both companies
and Colleges/Universities participate.
The Sun SPOT development kit was a huge success and I wanted to
share a couple of pics of the event so you could see how it is being
used. I have also been able to demo it at a Texas Instruments Developers
Symposium and took it to Austin and Houston when I was doing
Partner updates on our technology.

Last year we demo'd Looking Glass and I had a student come by this year and
ask for more info. This shows that they really do listen to what we say
and are interested in technology.

So thanks for providing a great tool to showcase Sun Technology.

-Roger Lippert
Dallas, TX

Img 6268

Img 6263

Img 6255

[Did you hear about the model who sat on a broken bottle and cut a nice figure?]

Friday Feb 09, 2007

Sun SPOTs mentioned as "innovative"

SmugBlog: Don MacAskill » Blog Archive » Server Analysis - Sun victory!:
Yeah, he listed just about everything else Sun does, but he mentioned Sun SPOTs, so I have to link back to it.

[You know you're a little fat if you have stretch marks on your car. -- Cyrus, Chicago Reader 1/22/82 ]

Wednesday Dec 20, 2006

Renaissance Computing Institute Deploys SPOTs

The Renaissance Computing Institute is doing some cool stuff! They have gotten one of the toys thatI have been pestering my boss to buy me for years (and I can't understand why he won't!) and have been using it to deploy remote SPOTs.

They have a cool video of it, too, and a write-up on the whole thing.

Plus Dan Reed is an incredibly smart guy that does amazing things, so the fact that we got them using SPOTs at all is just cool all on its own.

[A can of ASPARAGUS, 73 pigeons, some LIVE ammo, and a FROZEN DAQUIRI!!]

Tuesday Nov 21, 2006

Relative Humidity Project

So, how hard would it be to hook up a Relative Humidity Sensor to a Sun SPOT? I was asked that question not long ago, and of course I said "Easy. Shouldn't take long at all!"

So then I had to put my money where my (big) mouth was. So I Googled "Humidity Sensor" and found Precon USA that had both analog and digital Temperature and Humidity sensors. And they are cheap (relatively) at only $29.95 each. So, of course, I ordered two.

They arrived a few days later, and looking at the datasheet, it appeared that even I could hook it up relatively easily. Four leads, analog output, voltage-based. Easy.

Here's what the sensor looks like out of the box:


No, the quarter didn't come with it, but everyone uses a US Quarter to show the relative size, so I have to as well.

Next it was time to test it out. So before doing any serious wiring, I hooked it up with jumpers to get some data off of it and see if I could make it work. Turns out it was easier than I thought. Once hooked in with jumpers (which looks like this)


I grabbed a snippet of code to access the sensors, and ran it. The code is as follows:

    protected void startApp() throws MIDletStateChangeException { 
        ITemperatureInput temp = EDemoBoard.getInstance().getADCTemperature();
        IScalarInput rh = EDemoBoard.getInstance().bindScalarInput(EDemoBoard.A3);
        IScalarInput tmp = EDemoBoard.getInstance().bindScalarInput(EDemoBoard.A2);
        IScalarInput vref = EDemoBoard.getInstance().bindScalarInput(EDemoBoard.A1);       
        while ( true ) {
            try {
                double rhVal = ((double)rh.getValue()/(double)vref.getValue()) \* 100;
                double tmpVal = (((double)tmp.getValue()-115) / (double)vref.getValue()) \* 100;
                System.out.println("current RH       : " + rhVal  + "%");
                System.out.println("current Temp     : " + tmpVal + " deg. C");
                System.out.println("Onboard Temp     : " + temp.getCelsius());
            } catch ( Exception e ) {
Yes, that is pretty much the entire application (minus the import statements and other surrounding cruft). Granted it doesn't do much other than print out the Relative Humidity reading and the two temperature readings every 3 seconds, but it only took me about 5 minutes to write it. The only interesting things to note are that the Relative Humidity and Temperature readings are scaled values based on the voltage, so I just pulled a lead from the 5.5+ pin to analog pin 1, and I have my reference voltage.

So once I had that all working, I decided to wire it up a little more permanently, so I put some jumpers on a connector, soldered a 4-lead socket to the leads, and hot glued the whole thing to the header. In order, it looks like this:


Finally, I just plugged the sensor into the socket, and the header onto the Sun SPOT, and I was done. I now have a Sun SPOT that measures temperature twice, and Relative Humidity.

And it took me less than an hour. So I guess I was right in the beginning when I said I could do it, and it wouldn't take long at all!

[17th Rule of Friendship: A friend will refrain from telling you he picked up the same amount of life insurance coverage you did for half the price when yours is noncancellable. -- Esquire, May 1977]

Monday Nov 06, 2006

How to attach Servo Motors to a Sun SPOT to create a remote-controlled pan-and-tilt Web Camera

While pan-and-tilt camera mounts are plentiful and cheap these days, the ability to quickly and easily create your own pan-and-tilt camera mount based on Sun SPOTs is still an interesting and worthwhile project to pursue as an introductory exercise in how to develop full-featured Sun SPOT applications.

As part of this development exercise, I have also developed some extensions to the BaseStation itself which I use to dynamically add, and update, BaseStation applications, but those additions will be detailed in a separate post rather than being included here.

Connecting Sensors and Actuators, Development and Debugging on the Sun SPOT Platform

Part of the design goals of the entire Sun SPOT Project was to make connecting and controlling external devices – both sensors and actuators – as easy and as straightforward a process as possible. This project was an exercise in validating that goal, and testing to see how easy the process was, and what, if any, difficulties or issues might be encountered by an end user in connecting servos to the Sun SPOT platform. Once connected, control of the servos through software needed to be thoroughly tested, and finally, in order to add some real-world usefulness to the project, the ability to control the SPOT and its associated servos remotely, specifically via a web-interface, was developed.

Completing this entire project, from wiring the servos to developing the control software to integrating the entire thing with a web service took about a day of diligent work by a single developer (me, of course). All development, debugging and testing was done using the NetBeans Integrated Development Environment (IDE) including using the remote deployment and debugging capabilities of the Sun SPOT platform.

What you'll need to complete this project

I will provide a short materials list here, but feel free to substitute other, more convenient or available parts as you see fit. Remember, this was my project, and yours can, and probably should, be slightly different based on your needs, your skill-level, and your available components.
  1. 2 Servos. I used 2 HiTech servos from an RC Car supply store. Specifically an HS-311 and an HS-81MG, but any servos should suffice.
  2. 2 Sun SPOTs. One base station and one with a Sensor board for connecting the servos
  3. 1 120V AC to 5.0v DC adapter (I used an old one I had laying around)
  4. 1 Firewire camera (I used an Apple iSight, but you could use any USB or Firewire camera)
  5. Standoffs, crimp-style wire connectors, misc. screws, nuts and wire ties
  6. Mounting block for the Servos/Camera
You will also probably need a soldering iron in order to connect the servos to the Sun SPOT. A USB Wall Charging unit to power the Sun SPOT might also be useful, though this is not specifically required in order to make the project complete.

Wiring the Servos and Sun SPOT

The wiring of the Servos and the Sun SPOTs was very easy and straight forward. The Servos involved( made by HiTec) require more power than the High Current pins can reliably deliver, so an external power source was needed to power the servos. Given that my lab has a plethora of leftover wall-warts from various electronic devices, I just grabbed one that seemed to produce the correct amount of power for the servos and wired it directly to the servos themselves. All ground wires were tied together to the Sun SPOT ground pin to provide a common ground.

The servo control wires were each hooked to a High Current pin in this example, though use of the High Current pins was not required. Each servo was connected to a separate pin (tilt was connected to pin H1, and pan was connected to pin H2, though the exact pin numberings could be changed without any issues as long as pin changes were also made in the software. For a complete schematic of how the entire project was wired together, please refer to Figures 1 and 2. Figure 2 shows the details of the header on the eDemoSensorBoard and which wires were soldered to which positions.

figure 1 Figure 2

All of this wiring required very little soldering to complete. The recycled wall power supply had to be slightly modified by removing the existing barrel-plug and connecting the positive and negative wires to the positive terminals of the servos and the ground pin of the Sun SPOT (I used a simple volt meter to determine which wire was positive and which was negative once I had removed the barrel connector).

Once that wiring was completed, the control-wires of the servos were connected directly to the Output Control pins on the Sun SPOT. Then all ground wires (from the 2 servos and from the wall power supply) were connected together and tied to one of the ground pins on the eDemoSensorBoard.

This completed all of the required wiring for the project. With the exception of the connections to the eDemoSensorBoard pins, the other connections could all be made without soldering at all. Connecting to the eDemoSensorBoard, however, does require soldering, though the soldering skills required are minimal.

To avoid any issues of battery life on the Servo-control Sun SPOT a USB Power Adapter was used to provide continuous power to the Sun SPOT. This power adapter required no additional wiring as a standard USB mini-B power adapter provides the required connector and the correct voltage for continuous operation of a Sun SPOT.

Sun SPOT Servo Control Software

While the actual code to control a Servo from a Sun SPOT is extremely easy to write, I was interested in expanding on basic servo control and testing some of the performance capabilities of the Sun SPOTs themselves. In order to push the Sun SPOTs a bit further, I made each servo controller run in a separate Thread inside the VM, and each Servo Controller also listened for control commands on a Message Queue. By moving control of each servo to its own thread I allow for the ability to move the camera in 2 directions simultaneously rather than having to wait for each servo operation to complete before beginning the next servo operation.

The Servo Control project consist of only two classes: CameraController.java and ServoDrive.java. The ServoDrive class is a more generic Servo Controller class that handles the direct manipulation of the Servos . The ServoDrive class implements Runnable so that it can run in its own Thread, thereby enabling the simultaneous operation of several servos. This class could be re-used to control any number of servos. Some of the other important aspects of the ServoDrive class include:

  • Name: The ability to name the Servo
  • Min, Max and Center points defined: Each ServoDrive object allows for the definition of the Minimum value (the bottom-end of the servo's range), the Maximum value (the top-end of the servo's range) and the center point of the servo's range.
  • Center: Causes the servo to automatically move to its defined centerpoint.
  • Scan: Causes the servo to move through its entire range of motion and return to the current resting point.
  • Move: the motion of the servo itself (even within the ServoDrive class itself) is all done through a MoveServo handler which smooths the motion of the servo and prevents the servo from moving too rapidly which would cause blurring of the image. The speed of the servo's motion can be controlled by setting a sleep property of the ServoDrive object (and in fact this value is over-ridden during the scan operation mentioned above to provide for a faster, smoother scan of the servo's range).

ServoDrive Class Object

The ServoDrive class object is instantiated by the following Object Creation Method:
public ServoDrive(Servo drive){
        this.myServo = drive;
Of course, this implies that the Servo itself, and its control-pin, is claimed by the instantiating object and indeed the controlling Object should have already claimed the required Pin as a Servo pin.

While not initialized during object creating, the ServoDrive message queue must be initialized before starting the thread or the operation will fail. I chose not to include an Object Creation Method which would also initialize the Queues (since the Object takes both an input and an output queue) but instead rely on get and set methods for initializing the queues.

Once the ServoDrive Object has been properly initialized, a new Thread object can be created and started which will cause the ServoDrive Object to center the controlled servo (based upon its center-point) and then begin listening for movement messages.

Moving the servos is all done in small increments to make the servo movement smooth and even while keeping it from being too rapid and 'jerky.' To accomplish this, I use the moveServo() method in the ServoDrive class, illustrated here:

private void moveServo(int amt, char dir){
        if(dir == '+'){
            if(myServo.getValue() + amt < servo_max){
                int tgt = myServo.getValue()+amt;
                for(int x = (myServo.getValue() + 10); x <= tgt; x+=10){
                    try {
                    } catch (InterruptedException ex) {}
            } else {
                for(int x = myServo.getValue() + 10; x <= servo_max;x+=10){
                    try {
                    } catch (InterruptedException ex) {}
        } else if(dir == '-'){
            if(myServo.getValue() - amt >= servo_min){
                int tgt = myServo.getValue()-amt;
                for(int x = (myServo.getValue() - 10); x >= tgt; x-=10){
                    try {
                    } catch (InterruptedException ex) {}
            } else {
                for(int x = myServo.getValue() - 10; x >= servo_min;x-=10){
                    try {
                    } catch (InterruptedException ex) {}
The method also keeps the servo from attempting to move beyond its limit points at either the low or the high end. By moving the Servo in steps of 10 each time the movement is smooth and clean, without being either too slow or too fast. By setting the value of servo_sleep (using the associated set method) you can increase or decrease the overall speed of the servo's movement.

Instantiating a Servo

While I have talked about how to control a servo with the above ServoDrive object, I have not specifically shown how to claim the necessary pins on the eDemoBoard to actually drive a servo. One reason for this is that it is so alarmingly easy that making a special section just to cover it seemed superfluous, but it does need to be covered. So, here is the code needed to actually instantiate a Servo object and claim a pin to control a servo:

Servo panServo = (Servo)eDemoBoard.getInstance().bindServo(EDemoBoard.H2);

Yes, that is all that is required. For the tilt servo, I just change the variable name to tiltServo and the pin designation to EdemoBoard.H1 and I have 2 servo objects claimed and assigned pins and ready to be controlled. I can now pass those servo objects in to the ServoDrive objects and begin.

There are several ways to control the movement of a servo. One is through Pulse Width Modulation (PWM) and the other is through setting the absolute value of the Servo's location. I chose to use the latter method simply because I knew the values of the servo's range, and setting absolute values for the servo's movement was the easiest and most expedient method of controlling the servos for my purposes. You may find that using PWM is a more accurate, more useful or easier method for your purposes and I encourage you to experiment with both methods to determine what works best for your application.

Sun SPOT Radio Connection Software

Creating and maintaining radio communications between Sun SPOTs is almost as easy as instantiating and controlling servos. I chose, in this application example, to use single-hop Radiogram transmissions to communicate between my Sun SPOT BaseStation and the servo-controlling Sun SPOT, but there is no right- or wrong-way to do your radio communications. It is all a matter of what works best for your application.

Again in my application I chose to do bi-directional communications between the BaseStation and the Servo-controlling Sun SPOT so that I could bot set and get the servo's value over the air. Also, I chose once again to have the communications channels be asynchronous by running them each in a separate thread on the BaseStation. I opened a DataGram communications channel to the Sun SPOT BaseStation with:

private String SERVO_SERVER_ID = "0014.4F01.0000.024A";
DatagramConnection webServoConn = null;
try {
	webServoConn = (DatagramConnection) Connector.open("radiogram://" + SERVO_SERVER_ID + ":100");
} catch (IOException ex) { }
This simple snippet of code opens a DataGram Connection between the Sun SPOT controlling the Servos (this one) and the BaseStation Sun SPOT which will be sending the Servo commands (identified by it's IEEE address as SERVO_SERVER_ID above). Once this communications channel is open, I can then create a RadioGram Object and either read from it, or write data to it and send it to the BaseStation via:
Datagram dgIn = null;
try {
   dgIn = myConn.newDatagram(myConn.getMaximumLength());
} catch (IOException ex) {}
To read data from the connection, or:
Datagram dgOut = myConn.newDatagram(myConn.getMaximumLength());
int vLocInt = tilt.getLocation();
To write to it. It is important to remember the reset() call to the Datagram object in order to prevent resending the same data repeatedly, and having the Datagram object grow out of control over time until an exception is generated because you have attempted to write beyond the end of the Datagram's size restrictions.

Sun SPOT Base Station and Web-integration Software

I wanted to make this project a web-controlled pan-and-tilt camera, so having the controls displayed in an interactive web-page was crucial. While I could have achieved this by having a cgi script communicate from an existing web server to the Sun SPOT BaseStation, I decided to implement at least the bare bones of a web server from the Sun SPOT BaseStation itself. This approach allowed me to do a real bridging application between the Internet and the world of 802.15.4 devices.

To run the webserver end of the application, I simply opened up a socket on port 8888 on the host computer (using the high port number relieved me of the restriction, on my UNIX-based computer, of having to run the process with increased permissions. I did not, however, want to implement everything required to be a complete web server, so my process only handles a specific set of commands.

To make the form, I hard-coded the HTML necessary for the form into private static final String objects within the server object itself. The process then simply listens for connections on the open socket, reads the incoming requests, and forwards them to the Servo-controlling Sun SPOT over the radio. Once the message has been sent to the Servo-controlling Sun SPOT, the process then waits for that Sun SPOT to reply with the current location of the Servo so that I can put that value back out in the web-page.

To make sure that the requesting browser understands the response, I just made the first part of the response conformant to what the browser expects with:

            private static String page1="" +
            System.getProperty("line.separator") + "" +
            System.getProperty("line.separator") + "" + ...
The key was the first portion, telling the receiving browser what was coming. The rest is just standard HTML. I could also have created HTML file fragments and had the process read them from disk and relay their contents back to the receiving browser, but using Strings just seemed more expedient.

Finally, I had to write some methods to parse the incoming messages from the requesting browsers so that I could send appropriate messages to the Sun SPOT controlling the Servos. I chose to use form elements in the web page so that I could easily read and discard all of the browser-based data except the portions contained within the form elements I was interested in using. I could then scan the incoming data for 'left', 'right', 'up', 'down', etc. and for the number to move. Then, just relay that information to the remote Sun SPOT over the radio connection.

Putting it all together

Finally, after all the code was done, and all the wiring was done, I decided to make a reasonably decent-looking mounting system for the entire apparatus. I found a 3” x 3” x 5” rectangular block of white lexan in the machine shop which I used for a base. I drilled out a rectangular hole to accommodate one of the servos and hot-glued it in place. I then used 2 tie-wrap wire ties to attach the second servo, lying flat on its side, to the top of the first servo and I had the pan and tilt axies both covered.

Finally I needed to mount the camera to the servo assembly. To make an arm for the camera i took 2 1” standoffs (used for keeping computer parts apart from one another) and mounted a round-ended wire connector to each end. I was then able to screw one end of the arm to the servo arm, and attach the other end to the camera.

The Apple iSight camera had no easy way to mount the camera to the servos. To accomplish the mounting I found a small strip of scrap aluminum and drilled a hole in each end. I then put a screw through the holes and through a round-end wire connector and tightened the screw so that the aluminum strip was pulled tight around the camera body. I used some more wire ties to secure the camera's cable to the arm assembly, and the camera unit was completed. To secure the Sun SPOT to the device I used the Sun SPOT bracket included in the Sun SPOT Developers Kit by screwing it to the lexan block.

So, what do you have when you're all done? Well, yours will look vastly different, I suspect, but here are a few pictures of what mine looks like:

The Sun SPOT Mounting bracket
Sun SPOT Mount

The Camera Mount made from Standoffs
Camera Mount

The entire thing ...
Complete Camera

[Freedom is what you do with what's been done to you. -- Jean-Paul Sartre]

Friday Oct 13, 2006

GPS Spot Part 2

So at least one of you managed to read yesterday's entry about the GPS SPOT and then read my posting on the Sun SPOT Forums about it and ask about the 31' skew I encountered.

True enough, I found that the GPS receiver was off by 31' (minutes) in its location. At least, 31' was my estimation based on looking at a bunch of reading and then doing a lookup of my address. My new theory is that it is actually a factor of something called the 'GEOID Separation.' The GPS Unit puts out a value for this at 33. So, I surmise that my receiver data needs to be 'adjusted' by the GOID Separation value, and that my estimation of being off by 31' is actually off by 2' itself, and that if I adjust by the GEOID Separation value of 33, I will be right on.

I have not tested this, but it may be correct.

If anyone knows a lot about GPS data, and all that stuff, please feel free to let me know if I am correct, close to correct, or wildly off-base and making myself look foolish. :-)

[Millihelen, adj: The amount of beauty required to launch one ship. ]

Thursday Oct 12, 2006


I've finally finished working on the Sun SPOT Installer -- an experience I don't really wish to repeat -- and have had some time to go back to working on some Sun SPOT applications. This is what I'd much rather do, really.

So I ordered a bunch of parts from Spark Fun Electronics which, if you've never been there, is a really cool site. They have a great selection of very inexpensive sensors and gadgets and gizmos. So I ordered a bunch of stuff. The GPS Unit I got was even relatively cheap. A nice SIRF III unit, I couldn't wait to get it hooked up but was a little worried about the complexity.

I had met with a potential customer that had a grad student working on hooking up GPS units to Motes, and he had been at it for a while without much success, so I was not actually all that hopeful. Ah, ye of little faith!

Turns out that this unit puts out it's data as ASCII formatted NMEA Messages. Basically, a comma-separated message containing all the GPS data. So I had to get to a UART on the Sun SPOT. Arshan provided me with a hacked sensorboard firmware that gave me access to the on-board UART through a couple of the Digital I/O Pins on the board. Never one to be intimidated by stuff I know very little about, I plunged ahead.

I got the schematic for the GPS Unit and did a temporary wiring job using jumper wires, and wrote a quick bit of software, and ... guess what? It worked the first time!!! I got NMEA messages immediately. But what did they mean?? Well, luckily, there is a Reference Manual that explained how to interpret the messages.

Turns out that the hardest part of the whole project was going to be parsing the messages. Actually hooking up the GPS unit and getting data was dead-simple and took me less than an hour to hook it up and get data off of it. I'm currently only parsing the GPGGA messages, though I have parsers for all of them built in to the unit now. After I was sure it was working properly, I constructed a proper GPS SPOT. Check it out:


So that's the GPS unit hot-glued on top of a Sun SPOT (I drilled a hole in the 'Sun Roof' for the wires to go through) and it looks pretty cool!

To complete the whole thing, I had to develop a little Web 2.0 Application to show the GPS Location of the SPOT on a Google Map.


Next I have to do on-SPOT data-logging so that the SPOT can collect where it's been, and then download that information to the server when it comes back in range. Next version, for sure.

[Talking much about oneself can also be a means to conceal oneself. -- Friedrich Nietzsche ]

Wednesday Oct 11, 2006

NL-JUG JFall Conference Review [Alan Williamson]

NL-JUG JFall Conference Review [Alan Williamson]:
Pretty cool that Sun SPOTs are showing up at all the best Java events around the world! Angie and Simon are promoting our stuff heavily, and we appreciate it immensely! Plus they make some cool demos!! I've actually been working on a few new demos myself lately, which I will blog shortly.

[The Heineken Uncertainty Principle: You can never be sure how many beers you had last night. ]

Saturday Feb 25, 2006

Houston, we have telemetry

Well, after much processing (not to mention head-scratching), we have crunched the numbers and made a pretty chart of the Sun Labs Space Program Telemetry. Note that this is one feed, from one rocket. Being a proper Space Program, we had redundant systems, and were actually gathering real-time telemetry from two sensors to two ground stations.


We had to interpret this data ourselves, as we had no built-in mechanism to identify the various sequences of the launch such as ignition, lift-off, ejection charge firing, return flight, or landing. We stared long and hard at the data and came up with our best-estimate.

The one thing we are proud of is that we managed to pull 6 Gs on the launch, as is evidenced by the sustained height of the launch spike. That is, if you look at the actual numbers and not just the pretty picture, a maximum value on the 6G accelerometer. (Of course, you can't currently look at the actual numbers, since I am only posting the pretty picture, but if there is sufficient interest, I can post the raw data, too.)

Friday Feb 17, 2006

The birth of the Sun Labs Space Program

Yes, the Sun Labs Space Program has officially begun! Last Friday (so it takes me a week to blog about something, get over it!) we made the maiden flight of the Sun Labs Space Program. It was extremely well attended by Sun Labs personnel, Labs visitors, and even Greg P. himself. It was a huge success.

But why is Sun Labs starting a Space Program? Well, mostly because there are just enough wing-nuts around here that want to try something fun, slightly dangerous, and mildly interesting. We also have this thing we do every few weeks. We decide (in advance) on a project that we will attempt to start, and complete, in one day. We design a 'project' that can be fairly ambitious, and then we attempt to execute it all in one day. The Space Program is one such project.

We had several reasons for doing this one. First (and not insignificantly) we had been having a hard time ... ummm ... maintaining focus and momentum, shall we say, throughout the day and the project. We'd get in first thing in the morning, all pumped up to get something started, and then after lunch people would wander off to do email, or something pressing, and we'd lose momentum and fall short of completion. Such is the nature of these things.

So, after our meeting with The Mythbuster, we decided that maybe, just maybe if there was the possibility of an explosion, or something getting destroyed, we'd keep people's interest high and sustained. So we decided on a rocket launch. And not just a rocket launch for the sake of launching a rocket, but we thought we'd try to gather some real-time telemetry from the rocket using Sun SPOTs. See, it's not just a total waste of time!

So, the list of things we had to do:

  1. Build a rocket
  2. Outfit the rocket with SPOTs for telemetry readings
  3. Write the ground-telemetry software
  4. Make some antena extenders in case we exceeded the range of the Sun SPOTs
  5. Document the entire thing from start to finish

Sounds easy, right? Well, not quite so easy. We did do some prep-work prior to the project day. Pete St. Pierre and Arshan went to a hobby shop and bought a suitable rocket kit. I contacted the Menlo Park Fire Department and made sure we didn't need a permit, or authorization from them, in order to launch. You only need FAA approval if you plan to go over 5,000 feet, and we didn't have ambitions that high (yet).

Scott Nazarian designed the Sun Labs Space Program Logo:


which you have to admit is pretty cool looking. How can you have a project that doesn't have a logo?

So, we had to build the Rocket. Pete caused the first failure of the day:


Yes, folks, he read the instructions. How could you Pete?! The horror. But we soldiered on. It wouldn't be a true launch if we didn't have some fancy-looking calculations and graphs on the white-board to Arshan (Dr. Von Arshan now) did some for us:


Now that the calculations were out of the way, we completed modifying the rocket to hold Sun SPOTs (the rocket is designed to split in half at the top of its flight and float back to earth, so we decided to outfit each side with a Sun SPOT for double-telemetry and symetry -- and to keep the rocket from veering off wildly into the Bay.


(The madman with the modified rocket is Scott).

So that's two off the list (plus an extra credit for the logo, way to go Scott!). Arshan and I spent the better part of the day writing the telemtery software so we could record, in real time, the data from the Sun SPOT 3-axis 6-G accelerometer (would we peg it??), the light sensor and the temperature sensor. We didn't expect much really useful data off of those last two, but since they are onboard, we ought to collect the data, right? Right. Soldier on.

Rob Tow was in charge of the ground stations. He came up with both a foil-enhanced parabolic dish and a "cantenna" made from a coffee can. It was supposed to be a Pringles can, but I didn't want to choke down the required Pringles chips. :-)

PICT0029 PICT0063

Excellent! Ground-tracking stations? Check! Rocket? Check! Software? Hold your horses, we're still hacking!


After a much-deserved lunch of Pizza, it occurred to us that maybe we ought to weigh the newly-modified Rocket. After all, we only had Class C motors, and they are only designed to lift about 175 grams. So off we went to the Menlo Park Campus Mailroom.


Big surprise, we're over 200 grams. No way we're getting off the launch pad this way. Maybe those calculations would have been a good idea after all? But Pete saved the day by making a mad-dash back to the hobby shop for a couple of Class D engines (300 grams payload!). But we had to modify the rocket again!! And we were less than an hour from launch time!

PICT0051 PICT0049 PICT0053

Maybe at this point I should mention that I wrote a short AppleScript application early in the morning that was counting down the time to launch. It started announcing "T-minus X hours, Y minutes and Z seconds until launch" every half-hour. After noon, it sped up to every fifteen minutes. After 2 pm, every 10 minutes, and for the last half-hour before launch, about every 2 minutes. It definitely added to the atmosphere, and the pressure, to have the launch announcer beating the drum.

By 5 minutes to 3, launch time, Arshan and I were still madly hacking the telemetry software, and a large crowd was gathering in the Software Lab. So we moved the launch crew outside to the launch area.


Quite a crowd. We decided at the last minute that maybe the parking lot wasn't the best place, so we quickly relocated to the basketball court by the fitness center, and set up the launch. Rocket, Cantenna, and Parabolic, all ready. SPOTs running live telemetry, ready for launch!

PICT0085 PICT0083 PICT0086

Countdown ...


IMG_7916 IMG_7917 IMG_7919

It was wildly successful, and we got real data from the launch. And yes, we pegged the accelerometer, meaning we exceeded 6Gs. Cool! I'll post the data later, if anyone cares.

And it was even successful enough of a launch that we could re-use the rocket afterwards!


Which the team did (without me, as I had a flight to catch).

In hindsight, we should have cleared the launch with Sun Security, as they got a little bent out of shape, and collected a few names and badge numbers. Oh well, it isn't the first time I've gotten in trouble here, and I am willing to bet it won't be the last. :-)

More later ... But the Sun Labs Space Program Lives!!! Next, we shoot for low-earth orbit with mesh-networking of the telemetry back to earth. What do you say?

[I'm going to give my psychoanalyst one more year, then I'm going to Lourdes. -- Woody Allen]




« July 2016