Making a Martian Wrist Watch - Badly

The watch in use showing the all-important dust levels…

The watch in use showing the all-important dust levels…

Sometimes great ideas come to you at 3:00am in the morning. Sometimes you have ideas that turn out to be….. not so great.

After spending most of yesterday refining my air quality sensor I went to bed with no real plan of what to build for the Nasa Space Apps Challenge. Then, at 3:00am I woke up with an idea.

One of the “Can you build a….” challenges was to build a device to “Make sense of Mars”. The device could contain one or more senors and be used by those exploring the planet. So, all I have to do is take my Air Quality Sensor, add a wrist strap and presto, I have a Martian wrist watch. The idea is to make the kind of thing that a Martian might want to have on his or her person to track local environmental conditions and check for deadly dust storms.

Actually, at this point I must inform the reader that I’ve no idea whether or not dust storms would be a hazard to a martian, or whether or not any of the sensors I’m using (temperature, pressure, humidity and 10 and 25 micron dust particles) would generate any useful readings on Mars. But I’ve seen “The Martian” movie, and I reckon the hero would have found something useful to do with my device. He was a very resourceful chap.

Anyhoo, I reasoned that since there were things on the Martian surface that might be bad and I needed to make sure the wearer of the watch should be in no doubt when these happened. So I added a ring of pixels to my watch to give a strong and powerful warning. And it was at this point that my problems really started. Finding power for the pixel ring was easy, but I also needed a digital signal to select pixel colour.

This was tricky, since the Heltec device I’m using has pretty much all of the signals committed already. However eventually I managed to get the pixel ring to work without breaking any of the existing functionality. Or so I hoped.

The process involved three hours of tweaking drivers and moving devices around pins. During all this I was reminded of the old home truth: “Theory is when you know everything, but nothing works. Practice is when it works, but you really don’t know why.”

Testing the warning pixel with tissue paper…

Testing the warning pixel with tissue paper…

When the final judging time came we we were a judge short, and so I ended up doing judgely things, although I also insisted on presenting as well. After all, there is always the “People’s Choice” award to go for. I was on last, after some really superb presentations by the other teams.

Alas things did not go well. The network connection to the access point the watch was using was disconnected during the presentations so my watch had fallen off the network. And the pixel ring on the watch seemed to have failed. So I did a bit of arm waving, told a few bad jokes and then headed for the door….

Anyhoo, you can find my team page on Nasa here. And you can find a fantastic description of the event at c4di here, including overviews of all the teams and the winners.

Thanks to c4di for the use of the venue, Dileepa for sorting out the awesome pizza and Nasa for coming up with a set of thought provoking challenges.

Nasa Space Apps Challenge


We started the Nasa Space Apps challenge in Hull today. There are around 25 of us and we’re going to spend the weekend attacking some of the challenges set by Nasa. We did this last year and it was great fun, so we’re doing it again. I’m flying solo today, as well as giving Dileepa and the crew some help here and there.

As last time I’m impressed with the breadth of the challenges that Nasa has put together and enthusiasm of the teams.

And there will be pizza. It just so happens that since the last challenge we’ve had a pizza place open right next door. Wonderful.

Developing for Unity and HoloLens at NASA Space Apps Challenge

I've always said that a hackathon is a great place to investigate new technology. It's an occasion where you can spend time concentrating solely on something, and that can be both instructive and useful. So, when I signed up for the Nasa Space App event I was keen to try something new.

I had a tiny go with Unity a while back, which was fun, but I've never written code for a Microsoft HoloLens. Number one son had an idea for an app that let you see where satellites are in the sky or in the ground. The idea was that it would use satellite data to predict positions and then render them in a way that was locked to your present position and orientation. Then you can look around and see what is up there, even through the surface of the earth you're standing on. 

It was quite an objective, particularly as neither of us had developed for the HoloLens before. But we thought we'd have a go. Number one son was in charge of getting the satellite data and doing things with it, while I looked at finding and displaying a globe. 

You can get the Unity framework here. It's free for personal use. If you want to make HoloLens applications you'll need some other things which you can find out about here.  You don't need a physical HoloLens to get started, there's an emulator you can use to find out what your apps will look like. I managed to run the emulator, Unity and Visual Studio on my Surface Pro 3 with 8 Gb of memory and it worked OK (although it got a little upset when I tried to load Adobe LightRoom as well....).

Number one son was using a MacBook Pro for his part of the development, so he installed the Mac version of Unity and the .NET framework and set to. I was amazed that you can do HoloLens development on a Mac, but when we took his code and moved it to the Surface Pro it worked fine, which I found astonishing. Even compiled dll files added as assets moved across.

A Unity solution is driven by the assets that it contains. These can be images, models, scripts, dll files, shaders, sounds and lots of other different things. You create scenes by bringing assets together and create behaviours by binding scripts to events. The scripts can be written in C#. I really like that. 

The items in a scene are fiercely hierarchical. Changes a container will affect the things in it. Scripts can be bound to objects and there are start and update behaviours that you fill in to get your scripts to act on your objects. Variables in your scripts can be mapped onto elements in game objects and used to affect their appearance and behaviour.

If you've played with game development in XNA you'll find the "set things up and then update them every frame" way of working very familiar. But it is both more powerful and more confusing, in that every item in your game can have its own start and update, rather than being driven from a single, central, game engine. You can run your game in the editing environment at any time, and you can turn elements on and off at will. 

Unity have created an asset store that plugs directly into game projects so that it is very easy to find paid (and free) items that you can include in your game. In no time at all we'd found a really nice globe and I'd kind of managed to get it into a Unity project.

There are some settings that need to be customised in Unity for HoloLens development. You can do this by hand (there are instructions here) or you can find a ToolKit that automates the process. 

You create your software in Unity and then use it to build a Visual Studio solution that is compiled and deployed to the target device. We had the HoloLens attached to the Surface Pro via a USB cable, and we ran the program that way. You can use WiFi deployment too, but one of the golden rules of hackathons is that once you've got something to work you stop working on it and move on to the next problem.

Number one son made awesome progress. He found some tools online for computing orbits and even tracked down some 3D models for the satellites themselves. I learned a lot (which is software engineer speak for went more slowly) but I did manage to get a globe displayed and spinning.

With half an hour to go before judging we brought the software over from the Mac, fixed a tiny issue with exceptions in the satellite code and then built and deployed the program to the HoloLens. And then the problems started.

Everything was upside down and wrong way round. The code worked fine in Unity on the PC, but on the device it was wrong. And, since we'd not done anything that could cause this behaviour, we didn't really know how to fix it. Not good. 

After a bit of frantic searching we managed to find this which fixed the problem. By turning off an apparently irrelevant option (MSAA) we got the code to work. This was very annoying. There is no mention of this issue in any of the release notes anywhere. It means that anyone who carefully follows the "getting started" sequence for the HoloLens would be rewarded with a solution that does not work properly and no information as to how to fix it. Not good. 

I was really impressed by the ease with which you can get started and the power of the HoloLens itself. I'm going to try and hang on to my loaned device for as long as I can.

Space Apps Challenge Judging

A tense moment in the judging.....

A tense moment in the judging.....

That was such fun. At the end we had four teams that produced projects that gave Derek, our judge, some meaty developments to get his teeth into. In the end the overall winner was the Fire Finder app, although everyone who took part produced some lovely results. 

I was part of Team "What'sUp", trying to build a HoloLens application that let you look into the "sky" (or the ground) and see what satellite are around relative to your position. It was my first foray into Unity and HoloLens development and it's worthy of a blog post all it's own. Which it will get....

You can find details of what the teams got up to here. Many thanks to c4di for the use of their lovely work area and to Dileepa for hosting the event. And getting us pizza.

Everyone who took part had a whale of a time. All of the starters finished with a working solution. Here's to next year.

NASA Space Apps Challenge

We started our NASA Space Apps Challenge at c4di first thing this morning. We've got teams looking at the NASA challenges and getting to grips with them. We've got satellite trackers, fire reporting systems, solar power simulations and orbiting robots. And another 24 hours or so to finish.....

..although of course it's really all about the stickers...and the pizza....

NASA Space Apps Challenge at c4di Hull

I love hackathons. I actually won a prize at one once. And at another I was part of a team that won a special "most ambitious failure" award (perhaps less impressive). I also love hackathons because they are so good for those that take part. They broaden your skills, let you try out new ideas, meet new people and stretch yourself a bit. They look good on your CV, you can talk about them at interviews. And you get to eat pizza. Lots of pizza.

I'm helping to run a hackathon at the c4di at the end of April. It's in partnership with NASA, and the winners of the Hull heats are entered into the NASA round of the competition for consideration for worldwide acclaim. There'll be a bunch of space related themes that we aren't allowed to tell you about just yet, and all kinds of fun things to do.

It's over the weekend of the 29th-30th of April. You can work all night, or you can nip home for a few hours sleep (which is what I'll be doing). We'll be working at the c4di down at the waterfront, so if we are lucky we should get a nice sunset and sunrise over the water to spur us on.

You can sign up here, and you really should. I'm after team members; get in touch if you fancy working with me.