A “Thomas” toy train joins the Internet-of-Things

I am intrigued by the notion put forward by David Rose (seen here presenting at TEDx) of “putting magic in the mundane – that is, having ordinary items that can do extraordinary things”.

I find compelling the notion that for everyday activities there will be a swing in popularity away from having to interact with complex abstract worlds behind glass screens toward a more “authentic” physical experience, for which we humans are so well adapted. But this shift will only be made possible by means of even more advanced technology – able to hide its own complexity.

This month the popular “Thomas the Tank Engine” toy celebrates its 70 anniversary. As a fun project, what could be more appropriate than to bring this traditional toy into the age of IoT, while preserving its physical appearance and simple charm?

For a short overview / teaser, watch the following video (be sure to select HD):

[youtube=https://youtu.be/-o6LYynn95E?hd=1&rel=0]

Inevitably there will be those who see this and ask “why?”

The short answer is that, as Hackaday believes,  “why” is the wrong question.

A longer answer is that the train is simply BETTER when you can control its speed (remotely over wi-fi), more consistent to operate, especially at low speeds because of an auto “throttle-boost” that kicks in when the accelerometer senses that the train is going uphill, and more user-friendly with remote monitoring of the battery state.

And if you need still more justification, the Train appeared this week at a trade exhibition as a source of IoT data to demonstrate business software (go to YouTube here if you are interested, where one of my colleagues explains).

The main challenge was to be able to fit the required electronics into an existing form factor. As it transpired, the toy train was a lot more compact than I had anticipated. I had to undertake some delicate “surgery” to free up space underneath the train and behind the front face, but this was done in a way that a casual observer would not notice.

Follow the link to a full write-up to discover more of the details:

Continue reading ->

When you need multiple analog inputs for your ESP8266 application

IMG_4488sFor a project that I have been working on (which is extremely space-constrained) I needed a second analog input – but the ESP8266 has only one. Whereas additional digital I/O lines can be accommodated quite easily using an external shift register to convert them into a serial stream, this is not as simple for analog signals.

In specific situations you can get away with having only one ADC by multiplexing your sensors. In my scenario, because I was measuring totally unrelated things, this was not possible.

The most obvious approach is to add an external ADC. The drawback is that this requires you to get to grips with how to control your particular ADC chip, and beyond that to get serial communications working correctly. A further negative is that these ADCs usually require additional components in the form of stabilisation capacitors.

FSA3157_sizeI therefore came up with a simpler alternative – using an analog switch ic. I was pleased to discover that they are now available in extremely small form factors. Actually, my choice turned out to be rather too small – at a size of 1 mm x 2 mm, soldering directly to each pin (without the benefit of pcb mounting) proved more of a challenge than I was looking for.

FSA3157I settled on the FSA3157, which can operate off 3.3V and which allows you to select between 2 analog inputs using a single digital control output from the ESP8266. You are then able to feed that selected analog input to the single ADC input on the ESP8266. Further good news is that they cost well under a dollar each. Continue reading

Simple (Browser Based) graphical display of MQTT data

Recently, I have been using MQTT to stream ESP8266 sensor data to a Mosquitto broker running on a Raspberry Pi. I wanted to develop something to show the stream graphically.

I have previously found Dygraphs to be a great piece of software. I like the way it consists purely of client-side javascript, which runs entirely within a web browser. In fact, you can even open an HTML file (containing javascript) from your local disk, without requiring a web server.

DygraphDemoI specifically wanted to build something along the lines of Dygraph’s dynamic update demo, except that I wanted a constant scrolling “window” of values – like a heart monitor for example. (Really, what is the use of having all your data scrunch up against the left of the window?).

Having solved that issue, I then had to connect the graph to my MQTT broker to be able to receive live data to display.

This post goes into details of how I did this, but before going further, here is the result:

[wpvideo uIHfHtPH]

Continue reading