LG201: IoT Prototype Development - Start
With Why

The first thing you require in order to prototype a device, is a requirement that needs to be met. Whilst this may seem like an obvious and logical statement, it’s one that I have sometimes been guilty of ignoring both whilst writing software and designing devices.

“Alexa, ask Wezmondo to grind the coffee”, where wezmondo is my son’s nickname, and the name I gave the Alexa Skill I just wrote…

“How many cups?”, she enquires...

“2 please”, I reply, where please is required, robots deserve respect too!

“Grinding coffee”, she replies, as the old Italian coffee grinder, whose guts I stripped out and replaced with a 240v relay switch and a microcontroller, screams into life!

So, what need has been met? Well, none really…

I still have to walk over to the grinder and put the ground coffee in the AeroPress, I’ve saved, what, maybe 40 seconds of standing over it whilst it grinds. Simon Sinek titled his 2011 book about pioneering individuals and corporations, Start With Why[1] which he believes is the question that separates us, objectively I failed to do that in this case.

But there was a why, there was method in my madness. I took an analogue Thing (with a capital T), connected it to the Internet (with a capital I), and instructed another device to control it.

The why, was to learn, where the what, was how to develop IoT devices. Which leads us back to this, the first module of my MSc, and the requirement for a requirement.

Left: "Alexa, ask Wezmondo to grind the coffee", see the project HERE.

Development Requirement

For the next two years, I will be building, programming devices, and developing services in the cloud that these devices communicate through. I work partly from home, partly from the Platf9rm co-working space in Hove, and partly from the University of Brighton. I can’t be carrying coffee grinders around with me, I already have a rucksack full of microprocessors, breadboards, breadboard wires, breakouts, resistors and buttons.

There is my requirement, a generic prototyping device that can be configured to test my code, a device that protects the components and is easily modified to incorporate different inputs and outputs. A go-to device that I can use over-and-over again during the course.

Let’s specify these requirements slightly more formally, we’ll revisit this in detail in the next article:

  • Protective Case – I’m sick of searching for snapped off capacitors in the bottom of my bag.
  • Microcontroller Development Board – No point re-inventing the wheel during prototyping.
  • Programming Interfaces – USB during development, Wi-Fi or Bluetooth for updates.
  • Power Management – Some configurations will require rechargeable battery power.
  • 5v and 3.3v Logic – Why choose a logic level when you can have both!
  • Swappable Inputs & Outputs – Custom breakout boards for various purposes.

So that’s what I’m prototyping, a prototype prototyping device if you like.

Something I can pull out my bag undamaged, something I can connect to my laptop and load sketches onto, something that will give me and other stakeholders feedback, something that helps to prove the concepts I develop.

Why? Because you can’t have the Internet of Things without, well, without a Thing!

Development Tools

“A bad tradesman always blames his tools”, my father the tradesman, used to say… but then he had great tools!

That said, he could do a better job of plastering a wall with a soup spoon than I could with the correct tools, but when I needed to plaster a wall, he provided the tools that would make my job easier. He didn’t give me a soup spoon, tell me I wasn’t a plasterer if I couldn’t use a soup spoon, sit back and wait for me to fail. Yeah sure, he laughed about how long it took me, but he showed me how to solve a problem, and enabled me to develop a solution.

The developer community needs to learn from this, amongst our soup spoons are the Terminal Window and the Offline Interview, maybe the correct tools are the IDE, the GUI, and the Internet!

The design industry has known this for decades, so the choice of tools for the physical design of my prototype is wide and varied, we are spoilt for choice. For the electronics and programming elements, I will try to choose software with GUI’s, software that will make prototyping accessible to more people, rather than software that makes me look clever in my girlfriend’s eyes.

Shall we concentrate on what we develop rather than taking pride in how hard we made it to get there?

These are the tools I’ll start with, let us see if I need to change any of them during the development:

  • Adobe Photoshop - I don’t know what for, but I bet I use it, I always do! In fact, I just used it to get a HEX value for this webpage from a screengrab.
  • Adobe Illustrator - 3D design starts with 2D design, so this is a given for me, any required vector-based shapes beyond regular polygons will be created here
  • Fusion 360 – It reminds me of the Isometric Projection we did in Technical Drawing at school, draw the top, front, side and project to create the model… it makes sense to me.
  • Fritzing - A breadboard GUI that creates drawings and PCBs… A great way to illustrate circuits and produce Gerber Files for PCB creation.
  • Arduino IDE – So many examples, so many articles… the friendliest place, by far, to start programming Microcontrollers.
  • Arduino IDE – So many examples, so many articles… the friendliest place, by far, to start programming Microcontrollers.

Fritzing - A breadboard GUI that creates drawings and PCBs… A great way to illustrate circuits.

My work in these packages will be heavily supported by the internet, for example, I’ll have to google "case statement C++" and "ESP32 pinouts". To the soup spoon hawkers who just scoffed, I could spend some time committing these to memory like you have, for sure… but may I refer you back to the title of this article? Thanks!

Online I’ll discover that people have hit the same snags as me and that other people have helped them solve their issues. I’ll discover repositories of code and helpful articles that describe, step-by-step, how to implement them. My MSc is about building connected devices… I can achieve this aim working from a desk in my flat, with a few hundred quid’s worths of hardware… not because I’m a magician who types spells into a blank screen, but because of connected devices… because of the internet.

Maybe someday, someone will google "soup spoon hawkers", and find this article helpful.

Development Methodology

Urgh! If answering this question is the one thing I learn from this course, then it’s been worth every penny. Scrum, Waterfall, Sprint, RAD, Spiral… I really don’t know! I trained and worked as a designer for the first half of my career.

Us creatives, we gather information from clients, and sit around for days thinking about things… we look for inspiration in the pub, down the beach, anywhere we can… then, in a moment of clarity, it comes to us… then we do all the work and prey the client trusts that we know best. So that’s how I have approached development, what methodology is that?

Joking aside, this is actually problematic for me, the people I work for, and with… I started programming in 1983, writing games for the ZX Spectrum whilst off school with two broken arms. My mother used to say I was "in a world of my own", but then, it’s hard to respond to a question when you’re running an entire game loop in your head whilst eating your liver and bacon.

Why I fill my entire conscious brain with design and coding problems, is a question for another area of science, but having worked in isolation for much of my career, I’ve gotten away with it. Recently I’ve been working with project managers and their approach to development has been a breath of fresh air. This is my Achilles Heel, “no project ever finished” my business partner used to joke… well, when there's no scope, that one’s a little too close to home… No project manager to get me out of trouble this time. If I can nail this, get the answers out of my head and into a Gant chart, I’ll be unstoppable!

My MSc supervisor asked if I knew of the Spiral Development methodology, I said “yes”, nodded knowingly, and then googled it. An iterative process with each iteration focusing on four main areas, planning, risk analysis, engineering, and evaluation… OK, that makes some sense to me, it’s kind of like Design Thinking, but creatives use nicer terms, empathise, define, ideate, prototype, and test.

I like the idea of Design Thinking, partly because it, retrospectively, goes some way to explaining how I’ve worked for decades… plus, who wouldn’t rather ideate than analyse risk! Both these methodologies are, to a degree, iterative, so as a starting point, I’m going to Spiral Design Thinking through several iterations.

I’ll lay those out in a moment, but first I want to mention two more methodologies, that are relevant to how I work, and more importantly, how I’d like to work.

Rapid Application Development

"That’s RAD man!" In my day job, I work for a Lloyds Insurance Broker, building distributed sales systems. In insurance data is everything, and compliance is a necessary evil. Rapid Application Development is the closest I come to having a methodology.

We have known outputs (enough data to price insurance and proof of a compliant sale), we model data in SQL Server, we use recursive questionnaires to model business processes, and we use stored procedures to automate the creation of C# Classes and HTML Tests

A rewarding but flawed approach to development, instant gratification as you produce working systems at break-neck speed, but unless you’re truly 100% RAD there are manual processes (we’re about 70% RAD). A change in requirements or scope results in having to repeat all the manual processes, you effectively create a new system every time you make a change.

Now being the guy who knows the manual processes might seem like a good thing, but you’d be wrong… It’s no better than being the other guy worrying about the guy going under a bus. Avoid becoming, or hiring, a knowledge silo, this will end badly for everyone!

Share the knowledge, annotate your code, pass the baton.

Extreme Programming

I read Kent Beck’s book, Extreme Programming Explained [2], last time I was trying to work out which Development Methodology I should tell people I use (this really has become like doing the ‘workings’ in the margin after answering the maths question for me). I read it cover to cover in a day and felt totally inspired.

However, Extreme Programming is based around pair programming (two developers working on a single machine), and daily stand-up meetings. I can’t implement it within the structure of this course but remain inspired by it and will borrow elements and principles, such as task and story cards, functional tests, bravery and simplicity.

Read Kent’s book… it’s verging on the utopian.