Air Quality Fun at Leeds Sharp

Some of the audience at the start. Note my lovely Surface Go running the whole thing…

Had a great time at the Leeds Sharp meetup tonight. I was there to talk about Air Quality, Azure Functions and Lora. With a guest appearance of my Air Quality top hat. I’m pleased to be able to report that every demo worked. Even the impromptu one that I wasn’t expecting to…If you want a look at the slide deck you can find it here.

One of the lovely things about the night was that the first two folks that I saw at the venue were a couple of Hull alumni, Joshua and Andrew . They were there to make a video of the event. So they did. It’s really good, they’ve caught the presentation content along with some shots of me prowling around looking nervous. I think I’ll hire them for all my events. They’ve put the video on YouTube, you can find it below.

Simple Bluetooth BLE between ESP32 devices

There are lots of things in life that are supposed to be difficult. One of them is getting Bluetooth to work between devices. However, this is now not the case. Because I can do it.

It’s not quite a simple as you might expect though, the BLE server and client examples for the ESP32 devices distribution don’t work straight out of the box (they really should) because they use different service and characteristic ids and (and this is the tricky one folks) the device name for the server is more than three characters long (which for some reason stops the client from recognising it).

Anyhoo, to make things really useful for you I’ve slightly fettled the samples and dropped them on GitHub for you to just grab and go. They make it super-easy to send messages from one ESP32 to the other.

You can find the library here: https://github.com/CrazyRobMiles/SimpleESP32BluetoothBLE

ESP32 Bluetooth BLE to Windows 10 Universal Apps

So I’ve got this lovely little M5Stack device with an ESP32 processor on it and it is supposed to support Bluetooth BLE. So I thought I’d see if it did. So fired up the example Bluetooth BLE program in the Arduino SDK and then I fired up the Bluetooth sample from the Windows-Universal-Samples and tried to get them to connect.

And they just did. Astonishing. In no time at all I was sending messages from the PC to the M5Stack, and with a bit of fiddling I managed to get data values going the other way as well. I find this amazing and wonderful. Previous attempts to get Bluetooth working like this have always been fairly horrid and fraught. With this I just hit the pair button inside the app on Windows 10, accept a security prompt and then I’m sending packets of data backwards and forwards. I’m definitely going to build something based on this,

Air Quality, Lora and Azure Functions at Leeds

I’m treading the boards again on Thursday evening this week in Leeds. I’m talking about our work with Air Quality sensors and whatnot. With a special guest appearance of the Air Quality Top hat. Should be fun.

If you live in Leeds you can register here. If you don’t live in Leeds you can still travel there and attend if you wish, but I’d probably draw the line at intercontinental flights to get there…..

Please note that, in a break with recent tradition, this session will not be rhyme. (unless they offer me money)

Adventures in Colour at the Connected Humber Hardware Group

We had a great time at the Connected Humber Hardware group meetup tonight. We talked air quality, transistor design, top hats (of course) and making colours.

There’s nothing like playing with something to build your understanding of what is happening. Jay has been making remote controlled lights and has built a remote controlled a three colour led. Individual colours worked fine, but mixing them didn’t give the colours that we were expecting. This turned out to be because the individual red, green and blue light sources in the led were all very different in brightness. However after a bit of experimentation with series resistors he managed to get a reasonably balanced result, as you can see above. What’s more this serves as a lovely illustration of how primary colours can be combined to make others.

Great fun. If you want to take part (and why wouldn’t you), our next meeting is on the 3rd of April at 6:00. You can find our more about our meetups here.

Laser Cutting at Hull Makerspace

I really like it when I head out of the house with the intention of achieving something and then actually manage to complete the task. Today I headed down to the wonderful Hull Makerspace with the intention of completing my air quality sensor mount design and maybe even cutting it out of perspex.

And that’s exactly what I did.

Fair enough, some of the holes are in the wrong places and some are completely missing. But a little drill work and my first prototype is now ready to be fitted.

The holder has our custom circuit board on one side and the SDS011 sensor on the other.

Using an Edge Triggered Serial Interface with the ESP8266

The Air Quality sensor that I’m working on uses a GPS receiver and particle sensor. Both these devices use a serial connection to deliver their values into the processor. This poses a problem, in that the esp8266 (the chip that I’m using) doesn’t have very many serial connections. The usual solution is to use a software simulation of a serial port instead of a “proper” hardware one. The difficulty with this approach is that software serial ports slow down the processor because the processor has to stop and wait for each incoming character.

To solve this problem I’ve written an interrupt driven serial port that uses the edges of the serial data stream to trigger readings, which means that it doesn’t hold things up as much. You can find out more in the video above. You can download the code and play with it here.

Making an Air Quality Top Hat

This how I made my Air Quality Top Hat. It’s actually more of an Air Quality belt really, in that the sensors and the lights are attached to a strip of webbing which can then be fitted around the hat. I’ve made it slightly too long, so that it can also be turned into an Air Quality belt if you prefer.

Click on the image for a large version on Flickr

I’m using a Wemos D1 Mini and a Winsen ZPH01 particle sensor. The sensor will detect 2.5 micron particles but it’s not super stable (mind you - it is very cheap). For the light display I’ve added a strip of NeoPixels.

The wiring is just point to point, with some wires twisted together, soldered and then covered with heat shrink cable. The ground line is connected to the grounds on the pixel strip, the Wenos, the ZPH01 ground and the ZPH01 control line to pull that line low and request that the sensor sends serial data out of the TX line. The 5V line from the WEMOS is connected to V+ on the ZPH01 and the V+ of the NeoPixels.

The data line of the NeoPixels is connected to D4 on the WEMOS which is actually GPIO2. I’m using a lovely pixel library from Makuna which uses the onboard UART on the ESP8266 to drive the pixels. This forces them to be connected to GPIO2.

I’m using a specially hand tampered SoftwareSeral driver to get the sensor data, which is read on GPIO12 which is exposed as D6 on the WEMOS device.

The device is powered by a short usb cable that I’ve plugged into the WEMOS and then taped in place. I can use a USB extension lead to program the Wemos and plug it directly into a usb power bank to power the whole thing.

Rather than find a plug and wire up a cable, I’ve actually soldered the wires directly to the back of the sensor. I’m not proud of this, but it does seem to work. The Air Quality sensor and the Wemos are secured to the belt by double sided adhesive foam.

The software I’m using is an early release of my Monitair software for Air Quality sensors. You can find the “Top Hat” version on GitHub here.

Red Nose Day Screencast Recorded and Ready for Premiere

I’m actually ahead of myself. Amazing. I’ve got the words for the lecture written (a mere 96 slides), the Air Quality Top Hat works, and I’ve even had time to record a quick screencast of the material.

The screencast goes live after the lecture, at 14:00 GMT tomorrow on Red Nose Day.

I’ll update it with footage of the event over the weekend.

Oh, and you can still sponsor me here.

Azure Storage Explorer

I’ve been playing with Azure Functions and storing values in Azure Tables. It’s very easy to do. If you decide to have a to have a play with these (and you should - you can do it for free) you should download Azure Storage Explorer. It lets you explore your storage (the clue’s in the name) but it also lets you download CSV files, manage binary objects and lots of other nice things. And it works a treat.