Humber Care Tech Challenge Visioning Day

Getting started

Today I went along to the Humber Care Tech Challenge Visioning Day. This is where we get healthcare professionals to tell us about their problems and explore how to solve them. It's how we are setting the agenda for the Humber Health Care Challenge event itself, which is running in September.  During the event we want teams to come up with working prototypes of solutions. But to do that we need some idea of what we are facing. 

We had some great talks from people about the problems faced in healthcare. All the speakers were very open about the huge challenges that the future is going to bring. Nobody was saying these are easy things to address. But everybody was excited by the opportunities that new technology is bringing. I made some notes of things that people said during the talks. Apologies to the speakers that I didn't get all the names and if I've misquoted at any point:

  • Your home should be a proactive part of your healthcare.
  • People frequently interact with care services because they are lonely.
  • People will tend to opt-out of automated systems if they think that they will reduce the amount of human contact that they have. 
  • We need to establish a culture that make people and families able to provide appropriate support to allow independent living for as long as possible. Say in your home. Stay in control. Stay in contact. 
  • We should strive to make it as easy as possible to deliver and monitor care, so that the carers have time to focus on the person, and not just perform support tasks. Shared records across agencies would be a great step forward in this regard. 
  • Lots of technology already in use can be used in a care context. It might just be a way of connecting things and re-purposing existing devices.
  • We must plan for how the technology will be in 5-10 years time. Not what we can do now.
  • When considering disability; you are not what has happened to you - you are what you choose to become. And you should be empowered and supported to make that journey. 
  • Machine Learning and Artificial Intelligence bring with them an incredible potential for healthcare. So do connected devices such as Amazon Echo.
  • Very simple ideas can have a massive impact. 

Filling idea cards...

After the talks everyone spent some time filling in idea cards that set out the challenges that they saw and ideas for addressing them. We're going to spend some time going through these and getting back to the delegates who proposed them to turn them into challenges for the event. Things are getting very interesting. If you want to take part (and you should) you can still sign up here

As part of the presentation we recorded a bit of video with me talking about the event and why it is a good idea. This is one of those occasions when everybody wins. Everyone who takes part will have fun, learn things and improve themselves. And they might end up creating a solution that change lives. 

Cloud Connected Camping Lights

I was in the Pound Shop over the weekend looking for camping lights. What with we me going camping in a month or so. I'm going to the Electromagnetic Field event at the end of August, and I've been buying sleeping bags and contemplating life under canvas for a few days. 

I found a likely looking light in a camping shop for a fiver but being from Yorkshire I thought I'd take a look at cheaper solutions. I found the lights above, packed in a nice little box, for a pound a pop. Astonishing value, so I bought four. 

Then I got to thinking about making the light more interesting. I've done this kind of thing before and I had some pixel rings and Wemos devices lying around, so I thought I'd have a go. Worst case I'd break a light that cost me a pound. 

This is the light dismantled. I undid the screws that held the base on popped the top off and then slid the transparent cover down and off the bottom of the light. Then I used a knife blade to pop the plastic reflector off the top to reveal the pcb that holds the 11 white leds. I'm going to replace this with a 16 led neopixel ring which just fits. You can get these rings for around 8 pounds, or much less if you're prepared to wait for them to arrive from China. 

The plan is to fit the led ring a shown above, drill some holes in the plastic support and run the wires behind through them, providing a connection and also holding the ring in position. I can bring in the hot glue later if I want to make things even more secure. 

I held the led ring in position, scratched marks on the reflector and then drilled the holes. I'm not very pleased with the bottom hole, but I don't think anyone will see it. I'm only using three of the connections, but I drilled four holes so I didn't have to remember which was the one I don't need. 

These are the wires that I made up for the connections to the led ring. I used solid core wire. I'm connecting to the ground, 5Volt and Data input lines using black, red and white wires. The colour of the wires doesn't matter much, as electricity doesn't seem to care about wire colour.

If you read the Adafruit help pages for the Neopixel ring they talk sensible things about series resistors and capacitors that you can add to improve the signal to the led ring and reduce the chances of damage. I'm leaving those out because I like to "live on the edge", but you might want to add them if you build a light like mine. 

This is the led ring after I fitted it to the reflector with the wires pushed through the appropriate holes. Looks quite tidy to me. Next up we have to take a look at fitting the processor board to the light. 

This is how the lamps are made. They have a slide switch which controls power to the led ring. It's a bit hard to see, but there's a series resistor on the positive side which is wired from the battery terminal to the switch. I'll use the switch to turn the device on and off. 

I'm going to add an ESP8266 device on the Wemos platform. I love this device and configuration, and it just fits. It will give me WiFi for connectivity and my plan is to port my wedding light software onto the Wemos platform. 

This is the device with the signal and power wires soldered in. For some reason I was nervous about soldering solid core wires onto the Wemos PCB and so I soldered in some jumper cables instead. I've done this before and it's a good trick. Rather than soldering a socket and then plugging into it (and having the worry that the plug might come out) instead I just solder the plug straight in. I'll cut the plugs off the other end and wire things up by twisting wires together, soldering them and covering with heatshrink tubing. Probably not as posh as using proper connectors, but much cheaper and at least as reliable.

I'm using one data pin to control the lights. Just because I'm moody, I decided to solder this wire in directly. I stuck the Wemos device onto the back of the reflector using some sticky velcro tape that I got from Maplin. I'm really going to miss that shop.

This is the completed processor fitted to the reflector. I've done the wiring and so I now just have to power up the device to get it going. This is also a useful stage to reach because now that I've connected the power lines for the leds and the processor together I can plug the Wemos device into the PC using a USB cable and test that the lights work. So I did this. There will now be a short break while I get the software together. 

Writing the software took longer than I expected because I found a bug. However, once I'd fixed that I turned my attention to the base of the light. I soldered some new wires to the switch and onto the battery terminals. Now I just have to connect the red and black cables to the ones on the processor and I'm good to go. 

This is the lights and the power all soldered together. I've made the wires much longer than they need to be, this is so that it will be easy to pop out the reflector and re-program the Wemos when I find another bug.

This is the light in action, just after I'd asked it to turn green.

I'm presently using MQTT to connect to the Azure IOT hub and sending text commands to configure the light. The commands are a subset of the HullOS language that I've been using on the Hull Pixelbot. Next I want to make a controller device that pushes commands up into the cloud to tell the light what to do. 

If you're looking for something to play with I can strongly recommend this light. There's a reasonable amount of space to play with - I'm thinking of adding a temperature sensor so that the light can change colour depending on how warm it is. I've discovered that I can perform my light flickering at the same time as wait for MQTT server commands and it all seems to work splendidly. I'll put the code up on GitHub when I've tidied it up a bit. 

 

With a bit of care you could  take the original 11 pixel ring and cut the tracks on the pcb so that each led could be controlled individually, perhaps by an Arduino Pro-Mini to get a really cheap controllable light device. 

Code like an idiot

Hmm. No matter how good you are at programming, developers will still put bugs in their programs. Including me. Lost a couple of hours today because of this little beauty.

if ((tickCount % lights[i].colourSpeed)!=0 || lights[i].colourSpeed==0)
    return;

This code has been working inside HullOS for a couple of years. No problems. However, when I tried to port the code onto a Wemos device it kept crashing with an invalid instruction message.

Wah. The idea is that the code will exit if is not time to update the colour animation (tick count is not an exact multiple of colourSpeed) or if no animation is being performed (colourSpeed is zero). 

It took me a while to figure out what was happening. Turns out this code is wrong, but under some circumstances it will work perfectly well. 

It's all to do with the % (modulus) operator. This gives the remainder that you get if you divide one number by another (or example 7 % 4 would be 3). If the modulus is zero that we have an exact multiple on our hands. So, every time tickCount reaches the next multiple of colourSpeed the program will perform an update. 

Snag is that I've been stupid, in that I use a colourSpeed value of 0 to mean that the light is not being updated. And the behaviour of a C++ program when you do x % 0 is undefined. In other words, any number modulus zero is a stupid question to ask.

To make things worse the fact that I'm doing this bad thing as one half of an or expression means that, depending on the whim of the compiler, the modulus calculation may not get evaluated when colourSpeed is zero. If the code produced by the compiler does the test for zero before the modulus my program works. If the tests are done the other way round the program explodes.

It's an easy fix, just break the single test into two tests so that I control the order they are performed:

if (lights[i].colourSpeed == 0)
    return;
if ((tickCount % lights[i].colourSpeed) != 0 )
    return;

Now we never use the value of 0 in a modulus expression.  

Oh well, just goes to show that you can learn stuff by doing stuff.....

Go see Incredibles 2

Went to see Incredibles 2 on my birthday. It's really good, you might even say it's incred...

But then you might not. However, the action is great, there are some lovely touches and the dialog is spot on. I want to go and see it again. You should see it at least once. 

However, for me the show peaked during an advert at the start for Disneyworld. On the screen in big letters it said "Where nobody has to grow up." And then on the bottom of the screen in tiny letters it said "Height restrictions apply".  

Connecting a ZPH01 Dust Sensor to Python

I've just noticed that one of the wires came of the connector while I was taking the photograph. Oh well.

Anyhoo, some time back I got a dust particle sensor to play with. Air quality is a big thing, but one that we don't have much information about at the moment. An air quality measurement device is also a perfect application for LoRa. Sensors can gather data and then send summaries over the network. As part of ConnectedHumber initiative (of which much more later) we're designing an air quality sensor with the intention of deploying some city wide.

As a start I've connected the sensor to my PC and written a little Python script that gets the readings from it. You can find the script on GitHub here, in the unlikely event that you've got a sensor just like mine.

To connect the sensor to my PC I just used a standard USB to serial adaptor, the kind of thing you use to program Arduino Pro-Mini devices. I connected all the signal pins, and also took the mode pin to ground, so that the sensor will output serial data rather than pulses. 

The sensor works fine, although I've no real idea what any of the numbers mean at the moment. The next step is to get one into a case with a Wemos or LoRa device connected to it. 

Humber Street Gallery: Measures for Life

The Humber Street Gallery has a splendid new exhibition on at the moment. It runs until the end of September. On the ground floor they've got some neat little devices but further upstairs they've got this awesome cityscape made up of computer circuit boards and lights. It's constantly changing and just looks amazing. I've tried to take some pictures of it, but I've not really done it justice. 

The exhibition is free, and there are loads of lovely places to eat or grab a coffee in the Humber Street area too. 

Hull Minster is Awesome

I was really pleased when they made Hull Trinity Church into a minster last year. It hasn't made the building any more beautiful, but it does give it the status it richly deserves.

They've done a lot of work on the building inside too, removing pews and really opening up the space. That, plus the renaissance of Hull Trinity Market (definitely worth a look) makes this part of the town a must-see. 

Running up and down hills turns out to be fun

I've never been that keen on the outdoors. What, with it not having a roof or air conditioning. 

However, on the basis of this trip I'm having to modify this opinion a bit. I think you have to choose your outdoors carefully, and be lucky with the weather, but we've done a couple of walks that I've really enjoyed. I'm not quite at the point of buying an Ordnance Survey map and a pair of waterproof trousers yet, but I'm thinking about it. 

Smart Meter Time

Suitably redacted....

I've probably missed a trick here. I got a message a while back offering a smart meter for my electricity and I said yes. I didn't know that the energy companies were still installing the "old new technology" smart meters. According to what I'd read a while back, by this time everyone would be getting the new type, but for some reason (perhaps because it makes it harder to change energy suppliers without losing meter "smartness") the old-new meters are still being rolled out. And I've ended up with one.

It seems typical of the way that things are presently working in this country that an initiative that is supposed to bring us to the forefront of energy management has been sabotaged right from the start by short sighted decision making driven by commercial interests. Not that I'm particularly worried. The way I see it, if I'm in the 9 million who've got the old meters there's a lot of incentive for companies to make us happy in the future.

I reckon it's quite possible that the potential of the second generation of meters will never be realised because nobody will bother implementing the back end services to make them work. They'll just claim that there aren't enough of them out there to make it worthwhile. Yes, that is very cynical. And probably right. And anyway, the firmware in my meter is upgradeable......

Anyhoo, the meter is now in place and beaming my electricity usage to a remarkably cheap looking device that lets me see what happens when I use the kettle. It is supposed to motivate me to save power, but the first thing I wanted to find out was how far into the red I could send the readout by turning things on.....

Inadvertent Storytelling

I love it when I go through pictures I've taken and every now and then find one that really tells a story. I took this one at the Steam Rally recently, hoping to get a good shot of the car instruments and totally failed to notice the figures in the background.

But, having revisited the pictures I really like the way that this one seems to be all about a couple and their dog, and their shiny MG. 

LoRa Build a Node Workshop at c4di

We've just had a bunch of folks around to build some LoRa nodes. Robin had put together some kits and we came up with a set of instructions. By the end of the day we expected our attendees to have their LoRa nodes sampling temperature, air pressure and humidity and maybe even be viewing the values on The Things Network website. 

Well, we got that and more. One person had the information going into Microsoft Power BI and was using Machine Learning to predict future room temperatures. Another used If This Then That to tweet temperature readings to his phone. Others left with plans to install LoRa gateways and sprinkle LoRa powered sensors all over their properties.

Very successful, in spite of the fact that we were soldering surface mount components and some folks hadn't soldered since they were 14, or even at all. Thanks for coming folks and being so determined. At some points during workshop you could have heard a pin (or other tiny component) drop. 

We're doing another one in September, ping me an email if you want to get your name on the list. You can find our notes and sample programs here.

If you want to play with LoRa (and anything else that takes your fancy) take a look at the Humber Health Care Challenge. We'll make sure we've got some LoRa kits available there for people to have a go with this technology. 

Mightier Than sword or pen?

LoRa at Humber Street Gallery

Today finds us at Humber Street Gallery. We're looking for locations for a LoRa gateway for the area. They've got a lovely rooftop bar which looks perfect, and has some amazing views. Of course, I happened to have my camera with me. 

We were telling the folks at the gallery about LoRa and we're going to go back and find out a bit more about the possibility of LoRa enabled artworks. Could lead to some interesting discussions. 

Bad Telly

Scene 1: A meeting room, a bunch of TV transmitter engineers are sitting round a table. With an accountant.

Engineer 1: 'If we use this form of broadcast antenna we'll have good strong signals all year round.'
Engineer 2: 'Which is what we want. Right?'
Accountant: 'Hmmm. Looks a bit pricey to me. How about this design, which is cheaper.'
Engineer 1: 'Yes, but with that one the signal will drop in the summer.'
Accountant: 'People should be outside rather than watching telly in the summer. Use the cheaper one'

Scene 2: Another meeting room, another bunch of engineers, this time they are the designers of TV input circuits. And of course there is an accountant there too.

Engineer 1: 'If we use this circuit the TV will work, even with low level signals.'
Engineer 2: 'Which is what we want. Right?'
Accountant: 'Yes, but if we take out that amplifier the TV will work for most people, save us some cash in components and we can also make a fortune selling aerial amplifiers.'

And this folks is why every summer televisions in our area stop working....