Sunday 20 March 2016

Late Adopter of Things

After the dusty relics of recent posts (tubes, slide rules, etc) it is time for something more 'on trend'...


I was pleased to meet Richard, g0vxg, at the recent "Radio Active" rally and it was he who told me I should be checking out Expressif''s ESP8622. Accordingly, the notorious late adopter put in an order via the internet.

The devices have been making their way toward me ever since and the proverbial 'slow boat' just docked...


As you can see, I chose to buy some ESP8266s with a mounting PCB, which allows for the unit to be mounted via 0.1 inch headers on my beloved solderless breadboards for simple prototyping. This extra expense was no expense at all, as the whole enterprise cost less than a pint of best.

The ESP8266 (for those who cannot be bothered to follow hyperlinks) is a WiFi chip with an integrated micro, which can be programmed via the Arduino IDE. It has its own (limited) I/O capabilities. It has been described by some commentators as the Arduino killer. Obviously - I had to try it - but in order to try it, you need to program it...

Of course, given my purchase, I could plug it into a solderless breadboard. But I decided i) that I didn't want to commit a breadboard and ii) that I needed something a little more permanent.

So...


A scrap of perfboard (which had been rejected at work because it had been ordered in error, by somebody who thought it was stripboard - I rescued it from the trash can and gave it a loving home) gives, in turn, the ESP8266 module a home. Also, there is provided the two push-buttons, required to pull the ESP8266's Reset and GPIO0 pins to ground and manually cause it to enter the FLASH mode, in which it can be programmed using a USB to TTL module, which plugs in at bottom left, according to the recipe that can be found all over the 'net. The ESP8266 can be powered either from the programming module's computer or by the pair of AA batteries in the holder at the right of the photo (the ESP8266 is a 3v3 device).

However, pressing buttons is very yesteryear - so I was pleased to find a description of a simple circuit on www.arduinesp.com which also is implemented on the board above. The entire 'programming' side of my board is as described below...


You change between 'manual' and 'automatic' programming by inserting links on the jumper. I found the little twin transistor circuit worked perfectly as described on www.arduinesp.com - apart from one additional step...

It was necessary to set the Reset Method to 'nodemcu' in the 'Tools' drop down menu of the Arduino IDE:


Once this is understood, you can go ahead and plug in your FTDI board and get coding within the familiar Arduino development environment.


Here you see the little red USB to TTL board, with an extra flying lead to connect to the 'Ready to Send' and 'Data Terminal Ready' lines (the latter is also available on the edge-facing pins - but I did it this way for convenience). The little solderless breadboard hosts an LED for the inevitable 'blink' programs which form the subject of microcontroller programming 101...

There is a blink example described on www.arduinoesp.com - which is a modified version of the blink example in the built-in Arduino resources. But what's the point of this? You might as well just use an Arduino! To get added value from the ESP8266, you need to start to exercise the WiFi functionality. Fortunately, doing that is super-easy...

I found a great tutorial on www.openhomeautomation.net and - within minutes - I was able to hack it to control the LED in the photo above over the internet from a browser on my phone...


The browser page is served by the little ESP8266...


This application is only for local control (i.e. over your own WiFi network) but www.openhomeautomation.net goes on to explain how to extend control over the entire internet.

This is incredible - here we have a device, which costs less than a beer, which can be used to do all sorts of neat stuff, of which controlling an LED is really just the beginning. Applications limited not by cost or size (Richard's server, including its power supply, was hiding in a matchbox). Not limited by technology at all - just by imagination.

Genuinely exciting.

...-.- de m0xpd


No comments:

Post a Comment