Arduino I2C with the MCP9808 Temperature Sensor

The Microchip MCP9808 is a high precision temperature sensor with an I2C interface – making it easy to interface with microcontroller or embedded Linux electronics. The chip has a very small form-factor: available as either an 8-pin DFN package – or an 8-pin MSOP package. For hobbiest purposes DFN is almost impossible to use due to the complexity of having to reflow solder under the contacts; and MSOP is quite challenging (though it can be done with care). If you want something easy to use with a breadboard however, the good folks at Adafruit can come to the rescue – as they sell the device pre-soldered to a SIP breakout board. (Also available from Makersify in the UK).

Adafruit MCP9808 Breakout board
Adafruit MCP9808 Breakout board

If all you want to do is get something up and running quickly – then you can’t do better than to use the Adafruit Aurduino library (or if you prefer a Python library for BeagleBone or RPi).

Adafruit have done a great job with these libraries and most users will be delighted that “it just works”; but I want to explore how it all works: how to actually communicate with chip directly – using I2C. This guide written from the point of view of an Arduino; but you should be able to follow along from any other device if you’re reasonably familiar with I2C and low-level coding.

Continue reading “Arduino I2C with the MCP9808 Temperature Sensor”

Arduino & XBee

XBee Module Xbee modules provide a very simple way to add a wireless capability to communications on Arduino. Essentially they let you work in exactly the same way as a direct serial connection between two boards – albeit wirelessly.

The easiest way to connect an Xbee to your Arduino, is to use the Arduino Wireless Shield.

XBee Sheild

It’s possible to connect Xbee’s without a shield – but given the fact that they don’t have the (standard) breadboard 0.1″ pin-pitch, this requires a special breakout board, or some custom hardware. If you’re using an Arduino, I think the shields are definitely the best way to go (and they’re pretty inexpensive).

There are a number of different types of XBee – the most notable distinction is between the original, “series 1” devices (directly using the 802.15.4 wireless protocol) and the “series 2”, ZNet 2.5 (or ZB) modules: which add an additional communications layer over the base-standard. Series 1 and series 2 devices are incompatible with each other (and cannot communicate with each other) – but they are pin compatible with each other: so for point-to-point applications, it’s possible to swap out S1 devices with S2 devices (providing you exchange both ends of the communication).

Continue reading “Arduino & XBee”

Arduino Function Generator (Part 2)

Last time, we looked at some Arduino code that we could use to generate some square waves.

The problem with the setup we’ve been looking at so far, is that we can only produce signals of one amplitude – equivalent to the HIGH logic level.

In order to be able to produce any other waveforms we’ll need to be able to produce a variety of different output voltages. Although the PWM method we looked at last time gives us a way to do this, it’s not suitable for producing variable waveforms – as it’s time-based. We can see this, if we try to use PWM to produce a triangular waveform: and view the output with an oscilloscope.

void setup() 
{ 
    pinMode(11, OUTPUT); 
} 

void loop() 
{ 
    for (int i=0; i<0; i--)
    {
        analogWrite(11, i); 
        delay(1); 
    }
}

Creative Commons License


PWM Triangle code is by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


If we hook that up to our oscilloscope – it looks like this:

Failed Triangular Waveform

It’s not too easy to see that as a still image – so here’s a video clip of the same thing…


That’s clearly not really what we wanted: so we need to do something differently.

The solution to this problem, is to use some kind of digital-to-analogue converter (or DAC). To begin with, let’s build our own…

R-2R DAC Breadboard

Or, if you prefer, in schematic…
R-2R DAC Schematic

This circuit is an 8-bit DAC known as an R-2R resistor ladder network. Each of our eight bits contributes to the resultant output voltage. If all 8-bits are HIGH – then the output is approximately equal to the reference voltage… If we switch the most-signifincant bit to LOW – then we get approximately half of that voltage.

More precisely, for an 8-bit DAC if all 8-bits are HIGH – then we get 255/256th of the reference voltage. Switching the most-significant bit to LOW gives us 127/256th of the reference voltages. More generally for any bit value x, between 0 & 255, our DAC will us x/256th of the reference voltage.

There’s a short article on wikipedia explaining R-2R DACs in a little more detail, if you want to know more…

Okay, now that we’ve built our circuit – let’s do something with it.

We’ll start by producing a triangular waveform…

void setup() 
{ 
    pinMode(0, OUTPUT); 
    pinMode(1, OUTPUT);
    pinMode(2, OUTPUT);
    pinMode(3, OUTPUT); 
    pinMode(4, OUTPUT); 
    pinMode(5, OUTPUT); 
    pinMode(6, OUTPUT); 
    pinMode(7, OUTPUT); 
}

void loop() 
{
    for (int i=0;i<255;i++) 
    {
        PORTD=i;
    }
    
    for (int i=255;i>0;i--) 
    {
        PORTD=i 
    }
}

Creative Commons License


R-2R ADC triangle code by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


Triangular Waveform

Note that here we’re using PORTD instead of setting the state of the individual output pins one at a time. This is much faster, and it (critically) ensures that all of the pins change at the same time – and that’s important given we want to switch smoothly though digital values to create a smoothly changing analogue voltage.

PORTD is port register D. Our use of it here works because it maps to the 0-7 digital pins (giving us 8-bits); and writing either a binary or decimal value to the register – we control all 8 pins in one operation. For example, if we assigned it the decimal value 123 (which equates to B01111011) would set pins 6, 5, 4, 3, 1, & 0 to HIGH… Now the problem is that pin 0 is used for communicating serial data – so using PORTD means that we can’t use any serial communications whilst code it running. It is, however, the only way to manipulate 8 output pins simultaneously (and we didn’t need serial communications for this application anyway).

We can modify our code very easily, to produce a saw-tooth waveform – by simply commenting out (or otherwise removing) the second of the two for loops.

Note that if we want to drive anything significant (even something as lowly as an LED) we need add a transistor into the circuit, like this:

DAC with transistor & LED

Finally, on to a sine wave. We’ll need to pre-compute some values for the output voltages over time (the arduino just isn’t quite fast enough to be able to this in real-time, in a situation quite as time-sensitive as producing a waveform).

A sine wave has a cycle of 2π radians – so to produce a sine wave with 256 time-steps per cycle, we just need to calculate y=sin((x/255)*2π) for each point value of x. Since the sine function gives us values between 1 and -1; and we want values between 0 and 255, the simplest way to do this is to multiply the float value by 128 – giving us a value between -128 & +128; and then add 128 – to give us the correct range.

We could do this off-line; but that’s a bit tedious – so we’ll get the arduino to do this for us, in the setup() phase, storing the results in a global array. Then all we need to do in our main loop, is cycle through the array.

int sine[255]; 
void setup() 
{ 
    pinMode(0, OUTPUT);
    pinMode(1, OUTPUT); 
    pinMode(2, OUTPUT);  
    pinMode(3, OUTPUT); 
    pinMode(4, OUTPUT); 
    pinMode(5, OUTPUT); 
    pinMode(6, OUTPUT); 
    pinMode(7, OUTPUT); 
    float x; 
    float y; 
    for(int i=0;i<255;i++) 
    { 
        x=(float)i;
        y=sin((x/255)*2*PI); 
        sine[i]=int(y*128)+128; 
    }
 } 

void loop()
{
    for (int i=0;i<255;i++) 
    { 
        PORTD=sine[i]; 
        delayMicroseconds(10); 
    }
 }

Creative Commons License


R-2R ADC sine code by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


If we run that code, with our DAC, and have a look at that on our oscilloscope we see that we do indeed have something that looks quite a lot like a sine wave.

Sine Wave

That’s all for this part, next time we’ll have a look at varying the frequency of our waveforms; and look at a more compact and accurate way to do the digital-to-analogue conversion, using a dedicated IC…

Arduino Function Generator (Part 1)

I was looking around for an interesting Arduino project, and I came up with the idea of making a function generator (also called a signal generator). The reason I picked a function generator is that it gives us the chance of playing with some interesting circuits – and some interesting code…

Before we start with that – what is a function generator?

A function generator is a circuit that generates some kind of waveform. There are four main types of waveform – the square wave, triangular & saw-tooth waves, and the sine wave.

There’s a good article on function generators on wikipedia.

A dedicated function generator will cost a hundred pounds or more – but it would be very much more capable than anything we’ll build here; but this will give us a chance to look at a few interesting things.

The simplest waveform to get an Arduino to produce is a square wave. The square wave (as the name suggests) simply cycles between the HIGH and LOW logical levels.

An idealized square wave

(Actually it’s not really that simple at all – a square wave produced by an analogue oscillator is actually made up of a complex mixture of multiple harmonics – wikipedia has a description of this; but we won’t concern ourselves with this…)

The circuit we need to produce a square wave, is pretty much the most trivial circuit imaginable.

In fact all we need to do is connect whatever it is we’re driving, to one of the digital output pins of the arduino (I’m using pin 8 here); and the arduino’s ground.

Square Wave Circuit

The code is very simple, too…

void setup()
{ 
    pinMode(8, OUTPUT);
}

void loop() 
{
    // A total delay of 4 ms = 1/0.004 = 250 Hz… 
    digitalWrite(8, HIGH);
    delay(2); 
    digitalWrite(8, LOW); 
    delay(2); 
}

Creative Commons License


Square wave code by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


If we want to drive something like a piezoelectric speaker we can connect it to the pin, and the arduino’s ground; and we’ll be able to hear a tone. Alternatively if we pick a low enough frequency we could hook up an LED to see it blink. In fact, if you do that, you’ll note that this setup and code is actually just the blink demo.

Note that we can also use delayMicroseconds() to enter smaller delay values – giving use the ability to produce higher frequencies than the 500Hz that we’d otherwise be limited to…

In fact it’s even easier than this – as Arduino has a function to generate a square wave. For example, to produce the same 250Hz square wave as we had before, we can use: tone(8, 250); in place of the digital writes…

Let’s see exactly what this square wave looks like – buy hooking it up to an oscilloscope…

Apart from the frequency of the wave, there are a couple of other main characteristic that we might want to modify: the amplitude (a measure of how much higher the HIGH level is, compared to the LOW), and the symetry of the wave – the so-called duty cycle. We’ll leave the amplitude aside until next time – as that’ll require us to do a little more work; but let’s look at the duty cycle of the wave.

The duty cycle is simply a measure of how much of the time our wave is at the HIGH level – compared with the total time of the cycle. So far all of our square waves have been symmetrical: with an equal amount of time spent in both states. This is known as a 50% duty cycle.

If we want to change that, we can’t use the tone() function – as that’s designed to produce a symmetrical wave. Instead we need to use the digitalWrite() and delay() functions. So to create a 25% duty cycle square wave at 250Hz – we’d use delays of 1 ms after the LOW, and 3ms after the LOW.

If we use an oscilloscope we can see the shape of the resulting wave…

250Hz 25% Square Wave

With the timebase set to 2ms per division, we can clearly see the 1ms width of the pulse, and the 3ms gap between the pulses.

What’s interesting is what happens if we try measuring the voltage with an instrument that’s less time-sensitive – such as a multimeter. A 250Hz signal with a 50% duty cycle, yields an average of 2.4V (which is exactly half of the 4.8V my meter shows the +5V output of the arduino to be). With a 25% duty cycle – we get 1.2V (one quarter of the HIGH voltage); and so on…

In fact, this concept may already be familiar to you – if you’ve used the analogWrite() function – we have just reimplemented the pulse width modulation (PWM) technique that Arduino uses to provide analog (or analog-like) voltages. We can show this in a couple of ways. Firstly we’ll measure the voltage across an LED during an analogue write with our oscilloscope; and then we’ll show that by adjusting the duty cycle of our code, we can dim an LED.

First lets look at a PWM voltage, giving us a 50% duty cycle (or an average output of around 2.4V).

Arduino PWM 50% Duct Cycle

As you can see the shape is identical to what we saw before in our own version – although the frequency here is different (the Arduino reference document states that the PWM frequency should be approximately 490Hz…

Now let’s try implementing our own version of PWM…

First here’s a schematic of the new circuit…

As you can see we’re simply driving an LED via pin 8 (not forgetting the current limiting resistor, of course); and we’re getting a voltage (between approximately 0V and the reference voltage) from the potentiometer, and feeding it into analog pin 2.

Now for the code.

int value=0; 
void setup() 
{ 
    pinMode(8, OUTPUT); 
    pinMode(2, INPUT); 
} 

void loop() 
{
    value=analogRead (2); 
    value=map(value, 0, 1023, 1, 19); 
    digitalWrite(8, HIGH); 
    delay(1); 
    digitalWrite(8, LOW); 
    delay(value); 
}

Creative Commons License


PWM demo code by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


As you can see this is also very simple code. We call analogRead() to get the voltage – and then (for simplicity) we map it onto a range between 1 & 20 – and then use that as our millisecond delay value on the LOW part of the cycle – giving us a (theoretical) duty cycle of between 50% and 5%. I say a theoretical duty cycle – because in reality the time it takes the arduino to do the read and the map will actually throw off our timings. My multimeter shows a voltage of 2.16V rather than the expected 2.4V – dividing the reference voltage (4.8V) by the measured voltage (2.16V) gives us a a duty cycle of around 45%…

PWM Demo

As we can see from a more accurate measurement of the duty cycle, we see it’s around 46% – which implies that the time spent in the LOW state is actually around 1.08ms: hence approximately 80µS of additional time in the cycle spent at LOW whilst arduino executes the analog read and map functions). So if we were going to use this in reality – we’d probably need to find a more efficient way of determining the value for the second delay.

Or, more realistically, we could just use the analogWrite() function (which uses it’s own timer – independent of the main processing loop…

If we adjust the ‘scope to show the average voltage – we see that we get approximately the same voltage as the volt meter gave us…

Okay; that’s all for now. But be sure to come back soon for part two – when we’ll start to look at some ways to implement one of the more interesting waveforms: the sine wave.

Shift Register

Whilst you have quite a few outputs to play with on an Arduino board; sometimes there won’t be enough.  One way to get around this is with the use of a shift register.  This is a brilliant way to output eight pin’s worth of outputs – using just three pins.  What’s more – it’s a fascinating insight into some elementary computer science…

I’m using the 74HC595 – purchased from the good folks at Oomlout. Here’s the data-sheet for the chip (also courtesy of Oomlout).  There’s also a really nice article on the Arduino website.

First of all we need to build a circuit.  Although this one is a bit fiddly – there’s nothing too complex here.

We connect pin 15 to +5V, pin 8 to ground.  Pin 15 & pins 1-7 are our output pins – so we connect them to whatever we want to switch on and off (I’m using an LED + a resistor – but you could easily also wire a transistor into each output to drive anything you’d like).  Pin 14 is our data input pin – I’ll connect that to arduino’s output pin 2.  Pins 11 & 12 are the “clock” & “latch” pins – and we’ll connect these to pins 4 & 3 of arduino.  We won’t be using pins 10 or 13 – but we do need to set them to the correct logic state: so connect 10 to +5V & 13 to ground.

Here’s a schematic:

And here’s a drawing of the circuit in breadboard form (both produced using Fritzing):

Note the resistors on the cathode side of each LED.  I’m using 560Ω – as I had a whole box of them around – but anything between 220Ω and 1KΩ ought to be fine (I seem to recall 470Ω being the “correct” value for a 5V circuit and normal LEDs – but as I say, as long as the resistors are there, don’t worry too much).

Okay.  So now onto the fun part.

If you want to try something quickly to check it’s all working, then as this circuit is pin-compatible with Oomlout’s ARDX circuit 5, you can try their code.

If all is well you’ll see the LEDs counting up in binary.

That’s all well & good – but how does it work?  Well the shift register library in Arduino is taking an 8-bit number (a byte – 0-255) – and then setting the output pins of the chip according to the bit values of the eight bits.

Whilst using a byte like this, is an example of a very elegant piece of computer science – bitwise operations can be quite hard to understand.  So let’s simplify things – by using a more familiar “container” for our eight bits: an array of booleans.

Now, this isn’t such an efficient way to work (most, if not all, microprocessors do their most efficient work when using bitwise operations) – but it is a bit easier to understand.

// Shift Register with array of booleans. 
// Code by AJP (cc 2010) – released under 
// Creative Commons Attribution-Share Alike… 
// Pin Definitions 

int data = 2; 
int clock = 3; 
int latch = 4; 

#define bit_count 8  

void setup() 
{ 
    // Set the three pins to output… 
    pinMode(data, OUTPUT); 
    pinMode(clock, OUTPUT); 
    pinMode(latch, OUTPUT); 
}

void loop() 
{ 
    boolean bits[bit_count]; 
    // Set each of the "bits" to 0… 
    for(int i=0;i<bit_count;i++) 
        bits[i]=false; 

    // Now we'll pick one, at random, and set it to a 1 
    int c=random(8); 
    bits[c]=true; 

    // Now we're ready to send the data to the shift 
    // register. We take the "latch" pin 
    // low – to get it ready to recieve… 
    digitalWrite(latch, LOW); 

    // Now we'll simply itterate through the "bits" 
    // and set the data pin either high or low 
    for(int i=0;i<8;i++) 
    { 
        if (bits[i]) 
        { 
            digitalWrite(data, HIGH); 
        }
        else
        {
            digitalWrite(data, LOW); 
        }
        
        // We've sent our bit; now to tell the chip we're 
        // ready to go to the next bit – by pulsing the 
        // clock pin for 1 ms… 
        digitalWrite(clock, HIGH); 
        delay(1); 
        digitalWrite(clock, LOW); 
    }
    
    // Finally we've updated all 8 bits – so we tell 
    // the chip we've done by setting the latch back 
    // to high 
    digitalWrite(latch, HIGH); 
    
    // To finish-up we'll delay for 125ms 
    // before going around again… 
    delay(125); 
}

Creative Commons License


Shift Register with array of booleans code by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


This code makes it much easier to see what’s going on.  Once we’re ready to update the status, we set the latch: and then alternately setting the data pin (with the value of the bit) – and then pulse the clock HIGH for 1ms.

Now that we’ve seen how it works – let’s go back to the library code function:

shiftOut(dataPin, clockPin, MSBFIRST, dataValue);

Note that MSBFIRST is a constant denoting that we’re sending the most-significant bit first (aka big-endian) – we could also use LSBFIRST to send the least-significant bit first (little-endian). For more on the shiftOut function, see here [arduino.cc]; and for more information on big-endian vs. little-endian byte orders, have a look at this article on wikipedia.

Now that we have a feel for manipulating bits (by way of the analogous process of manipulating the array): how do we do it for real?

How do we, for example, tell the shiftOut function to turn on pins 4 & 6?

The best way is to return to those bitwise operators I mentioned earlier.

If we want to turn all eight pins on – then we need to send a bit pattern consisting of eight 1’s … 111111111 – which in decimal is 255 (i.e. 1+2+4+8+16+32+64+128).

For each pin we don’t want to turn on – we simply reduce this value by the corresponding binary value.  So if we only wanted to turn on all of the pins, except pins 0 & 7 – then we’d send 255-128-1 = 126.

Subtraction isn’t very efficient, or very elegant though: so instead – let’s use a bitwise OR…

The OR operator (which in C, uses this symbol: | ) works by comparing two bit patterns – and for each bit sets the output to 1 – if either one of the bit’s it’s looking at is 1 – or 0 if they’re both 0.

Using this, we can mask the bits we don’t want to change: if we OR  any pattern against 00001000 (for example), then the outcome will be to leave seven of the bits unchanged – and to set the 3rd bit as 1 (if it wasn’t already).

The last thing we need to do is work out which bit pattern corresponds to the bit we want to turn on.  The easy way is to remember some elementary mathematics.

To set bit 0 – we want 00000001 = 1, bit 1 is 00000010 = 2, 2 is 00000100 = 4, 3 is 00001000 = 8, and so on…  Using this we can see that 2^n will give us the value we want (2^0=1, 2^1=2, 2^2=4 … etc).

Given that we’re dealing with powers of two – there’s on last trick we can use, to avoid having to multiply: bit shifting…

Bit shifting does exactly what it sounds like – if moves (shifts) the bits either up or down…  So if we shift 00000001 two places to the left – we get 00000100.  So if we shift 1 by 0 places we 1, if we shift 1 by 1 we get 2, and so on: exactly what we want: and (critically) bit shifting is another very efficient operation.  In C the operator to shift to the left is <<.

Putting all of that together we get the following code:

state |= 1 << bitNum; shiftOut (data, clock, MSBFIRST, state);

That works for turning bits on – what about turning them off?

We can use a very similar trick: except that this time we need to use an AND operator (& in C), and the complement of the value we used last time.

AND works by setting the output to a 1 – if (and only if) both bits of the two bit patterns it’s comparing are a 1 – and 0 otherwise.

If all eight bits are turned on (11111111) and we want to turn 0th and 1st bits off – then we AND 11111111 with 11111100.  Again this works by masking: the bits that are set to 1 in the mask will be unaffected (if the corresponding bits in the original bit pattern were 1’s then the result will be a 1 – and it will be a 0, if they were a 0…).

So to turn off bit 4 – we need 11110111: the complement of 00001000 (8 in decimal).  To get the complement we use the complement operator (~ in C).

state &= ~ (1 << bitNum); shiftOut (data, clock, MSBFIRST, state);

Pulling all of this together, we get the following code:

// Shift Register with bitwise operators 
// Code by AJP (cc 2010) – released under 
// Creative Commons Attribution-Share Alike… 

//Pin Definitions 
int data = 2; 
int clock = 3; 
int latch = 4; 

void setup() 
{ 
    pinMode(data, OUTPUT); 
    pinMode(clock, OUTPUT); 
    pinMode(latch, OUTPUT); 
} 

void loop()
{
    int state=0; 
    for (int i=0;i<8;i++) 
    {
        state=setBit (state, i, true); 
        delay(125); 
    }
}

int setBit(int state, int bitNum, bool value) 
{ 
    digitalWrite(latch, LOW); 
    if (value) 
        state |= 1 << bitNum; 
    else 
        state &= ~ (1 << bitNum); 
    shiftOut (data, clock, MSBFIRST, state); 
    digitalWrite(latch, HIGH); 
    return state; 
}

Creative Commons License


Shift Register with bitwise operators by AJP is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.


And that’s all there is to it!

One last thing.  You can extend the circuit shown here – by adding one (or more) additional shift register chips – giving you an additional eight outputs for each one – and still only using three pins on arduino!  But that’s a subject for another post…

Introduction to Arduino…

Something that I really want to write about here, is Arduino.  Arduino, if you’re not familiar with it, is a really splendid, simple, low-cost, open-source micro-controller based board, originally created to be an easy to use platform: specifically to permit “designers & artists” to create projects with embedded micro-controller devices.  There’s a really good introduction on the Arduino website.

Although it was created with designers & artists in mind, there’s absolutely no reason why it can’t be used by more traditional users: such as computer scientists & engineers.

The free, Java-based IDE is very simple, and easy to use – but if you want to, you can use other tools – or the command-line.  The programming language itself is a subset of C++ – so it’s perfectly possible to write quite sophisticated code; or you could program it in native C++ using the avr-g++ compiler.

As I say: you can write good code for Arduino, but the biggest problem with the vast majority of the programming examples that you’ll find on the internet is that they are often quite poorly written (at least, from the point of view of a professional computer scientist and software engineer like myself)…  But it doesn’t have to be that way.  There’s no reason why “good” coding practices cannot be adopted; and writing good code doesn’t have to be any harder than writing bad code.

Arduino is also the perfect toy (or do I mean “tool”?) for someone with a software background, to learn something about hardware & electronics; and have some fun building some things.  That’s why I wanted one.  The problem is, that as with the software side, a great many (though not all) of the websites I’ve found about Arduino are written from that same (distinctly non-technical) standpoint – and as such, aren’t great reading for someone who is technical…  For example: whilst lots of the material I’ve seen will tell you what to do (that is how to build a particular circuit) – it doesn’t cover the why…  And I don’t mean they miss out detailed stuff, like “Why is that resistor 220Ω?”; but rather the fundamentals like why is it there, in the first-place!

Having said that, not every website is bad – and in particular I can recommend Oomlout; who not only have some good training materials – but who also have an excellent online store in the UK: where you can buy an Arduino “Starter Kit”

Whilst I can legitimately claim expertise with software, I don’t claim to be an electronics expert, (by any means) – but what I’d like to do in this blog, is to share with you what I have learnt: and to try to produce some learning materials, specifically written from the point of view of engineers & software people, to try to help pass that on…   (I don’t want to seem elitist here – I’m delighted that traditionally non-technical people want to learn about computers & software: and indeed I would encourage them to do so – it’s a fascinating subject: and a device like Arduino makes it possible to create all kinds of cool thing…  It’s just that “engineers” and “normal people” do rather need things explaining in rather different ways!)