Wednesday, 29 March 2017

Counting the people in space with the ESP8266 and the internet

Continuing the theme of basic projects to do some learning with, I discovered that a while back I bought a grab bag of displays from Maplins.

I promptly burnt out one side of a double 7 segment display, leaving me with just a single display. Having a slight fascination with all things space travel it seemed obvious to me that wiring the display up to a teeny computer that could retrieve how many people were in space was a good idea. Unfortunately, the current maximum is 9 people at any time. Disappointing from a SPACE perspective, but perfect for a single 7 segment display.

Stage 1

The first task was to make something work using a computing unit that I already knew. Enter stage left an original Model B Raspberry Pi. Bought on the original launch and occasionally dragged out when I fancied doing a project like this. Fortunately, python is my day job and it was mostly just wiring some bits on a breadboard.

Wired and working

Unfortunately, the Pi is a bit large for what I was after, and the original B doesn’t have WiFi, which would make wiring it all together a bit more awkward. After staring into the box labelled ‘tiny computers’, I rediscovered the 5 ESP8266 (Wemos D1 Mini) that I had bought on a friends recommendation a couple of years ago and never really used.

No, really. That’s what I labelled it a while ago. Strong labelling game, past me.

The Wemos is basically a clone of the NodeMCU development board, which means it can also run micropython without too much of a hassle. Downloading the latest and flashing it to the board was pretty straightforward, and then rewriting the original code didn’t take that much longer.

The main problem at this point was understanding how to get scripts and files onto the Wemos board. The webrepl method of copying files was the most straightforward, but takes a little bit of bootstrapping. The machine has to be on the network before you can copy the file that means it will auto connect to the network. Lots of typing into picocom and some faffage later, I had it working.

The next challenge was building a map of what pins are connected to which parts of the 7 segment display, and figuring out what pins of the 7 segment display actually did anything. The internet turned up a datasheet, which I don’t fully understand, but it at least had a pin diagram label on it. The twist for this is that my display is a Common Anode display, so the joint leg is connect to 3.3V, while the display pins must be grounded (or low), in order for the display to light up.

A search of the internet turned up an awesome api for the people in space, which could be fed into the urequestslibrary shipped with micropython.

Code written, flashed to the ESP8266 gave me this:

Working ESP8266 version

Then, everything went on pause as I broke my soldering iron.

Diversion into 3d printing

Given that I couldn’t do much else with the electronics, I decided to try and build something using the new 3d printer at work. This involved spending a weekend watching Fusion 460 tutorials.

After that, I had this designed:

Version 1 of a case

And then printed:

Printer at work

Unfortunately, I was a little bit off in my measurements:

Bit hard to see, but the board is at an angle due to the pocket being too short

A redesign later seemed to solve that, but then I decided I’d be optimistic and order some 4 digit displays. These haven’t arrived yet, but…

Arrival of the soldering iron

My soldering iron arrived!

TS100 soldering iron

I have no real idea why a soldering iron needs an STM32 chip and an accelerometer, but it was recommended and seems pretty good from what little I can tell. Soldering is definitely something I need to practise a bit more. Or a lot. Lets go with a lot.

As the displays hadn’t arrived yet it seemed easier to build something temporary as soldering practise (see above). A bit of hook up wire, some foam core, a glue gun and some super glue led to this…

Mounted on some foam board

And then some scrap left over from another project, some more application of hot glue and this…



‘Finished’ product

I intend to rebuild this with a 4 digit display as I believe in optimism that we will eventually need it. And if I ever need more than 4 digits to display the number of people in space, I’ll happily call this project redundant.

Displayed in the corner of my workbench

Things learnt

  • I need more soldering practice
  • Measure a lot
  • Don’t assume the measurements are correct
  • Fusion 360 is kind of nice
  • ESP8266 get hot enough to melt hot glue

Future Plans

  • 4 digit display
  • Mountable display case
  • Experimenting with low power modes in micropython


Saturday, 25 March 2017

Sewing a Saddle Bag – Part 1

I needed a basic sewing project beyond a fabric box, something that might be of some use. I decided that I needed a second saddle bag for my road bikes as I currently only have the one bag and kept forgetting to swap it between bikes.

Some research on the internet suggested that the ‘tool roll‘ style would be reasonably straightforward to make. I had bought some medium weight cotton (actually curtain lining, but it was cheap in the shop) earlier and had some velcro ready for a future project. Given I had the the materials I needed on hand, I figured I’d give it a try.

Current saddle bag contents

The first job was laying out the contents of my current saddle bag and taking some measurements. After looking at photos online, it turns out that I appear to carry a lot of emergency kit on a ride. Oh well…

Some doodling and some measurements

Once that was done, it was to the project book and some doodling and planning. The original plan was 3 different compartments with a top flap to keep the contents in. I know nothing about sewing velcro or the correct method of attaching it so it won’t come loose. But then, that’s the point of a learning project…

With the planning done, it was time to head to the rotary cutter, the sewing machine and a lot of swearing.

Not a complex stitch in sight. Although rounded corners were also new to me. I figured for the velcro that I’d just stitch around it, then across it. Time will tell if it works, but it’s held together so far.


Some time later, a test to proved it all fits! All just straight stitching, with double lines for the dividier and the hem. I may have to go around join of the pockets to the body again, as it’s already coming a bit loose.



And then, on the bike! Excuse the washing in the background…

I’m yet to actually test it out on a ride, as it’s not really been the weather for outdoor rides until this weekend.

Changes from the doodles

  • Made the bag slightly longer, evened out the spacing of the pockets

Future plans

  • Experiment with waxing the outer for some waterproofness
  • Rebuild it in a stronger material, possibly canvas.
  • Take Less Stuff.