Heater control project (hardware prototyping)

So I have got the DS18B20 hooked up to the BeagleBone’s 1-wire interface, it’s time to look at the over all design of this little project.  I’m not sure there is a simpler circuit!? Started up KiCad and took a while to track down the libraries for the BeagleBone headers and the DS18B20. [Look here for the BeagleBone and here the DS18B20]

It took a little hacking with a text editor to extract the parts from the two projects and get them into a KiCad library.. Got to love open source design tools, you can use a text editor to work on a library… Very cool!  In practice this took way longer than drawing up the circuit.  But a learning curve worth going on.

The simple schematic of the heater control.

Really nice of KiCad to allow you to insert a graphic into your schematic.. very handy when moving to the prototype stage, everything can be noted on the drawing.  On my schematic I have the BC547 and the DS18B20 pin-outs as a reference.

My Beaglebone heater control breadboarded..

So there it is.. a first draft on the breadboard.  Time to move to the software domain and see if we can get the BeagleBone to drive the relay. The wonderful world of the BeagleBone and GPIO pin mux’ing.

BeagleBone vs Arduino (heating control)

I’m just toying around with a little project I want to get off the ground.  Quite simple: I have an office at the end of the garden and now the weather is getting a little colder, I’d like to be able to remotely start a little heater I have there over our home network.  I would also like the controller to monitor the room temperature and turn the heater on and off as required.

The famous Arduino Uno!

I’ve tried giving this a go using an Arduino and an Arduino ethernet shield, but have had a load of trouble keeping the TCP/IP stack stable.. My code would work for an hour or two and then the system would crash. This is a really tricky problem to debug, once reset the system is stable and works fine, then all of a sudden it all crashes and requires a reset to start back up.  I’ve tried tracing the stack to see if it overflows, etc.. but finally given up on the Adruino solution.

BeagleBone… Wooof Woooof

Enter the BeagleBone.. From a cost point of view its on the money, an Arduino and Ethernet shield come in at around €64, the BeagleBone can be got from RS for €75.. I know the Raspberry Pi is the ticket here, but I can’t get a hold of one any time soon..

I’ve got my BeagleBone hooked up to a Dallas DS18B20 1-wire temperature sensor… So easy to do it’s not funny! The version of Ubuntu I’m using has 1-wire bus ready to go on the P8_6 header pin. Think I’m ready finally start this project!

BeagleBone and i2c, let’s see how it’s done..

So BeagleBone sitting there, a small batch of MCP23017 fresh from RS.. time to hook them up and see what can be done.

First we’ll need to install the i2s tools on the Bone.. SSH’ed in as root this is what needs doing:

apt-get install i2c-tools

Once done we stand a chance of probing and debugging the i2c bus.

Start up KiCAD and get busy with schematic capture…

BeagleBone MCP23017 Test circuit diagram

 

Breadboard out and built it up…

MCP23017 test circuit on the breadboard

OK… that was easy, but does the BeagleBone see the i2c device on the bus?

root@bbone1:~# i2cdetect -y -r 3
 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Where it is at address 0×20! Cool…

Lets take a look at the registers in the MCP23017..

root@bbone1:~# i2cdump -y 3 0x20
No size specified (using byte-data access)
 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
10: 00 00 05 01 05 00 00 00 00 00 00 00 00 00 00 00 ..???...........
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

The registers in the datasheet stop at 0x1a, so I guess the rest is bit stuffed..?

This is nice and easy… what will happen next.. stay tuned!