How to: Raspberry Pi HLT/Boiler Controller

The Homebrew Forum

Help Support The Homebrew Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Robbo

Got it set up again this evening for another test after ensuring the address pads on the I2C were correctly soldered.

If I run i2cdetect -y 0 immediately after switch on and logging in I get the same screen as you show two posts up. i.e. only 20 shown. If I then run the Boiler_Controller it enters the fault state and I have to stop it using control Z. If I then run i2cdetect -y 0 again I get every number from 03 to 77 populated on the screen with only 0, 1 and 2 blank. :wha:
Once I power it down and up again it goes back to 20 only. :hmm:
Does this give you any clues?
Graham
 
This sounds like you might have a faulty slice of Pi.

It is possible to trigger the slice of Pi outputs using the command line on your Pi. I suggest you kill the boiler script and attempt to switch am LED on/off using this method.

I am in an airport at the moment, so you might have to do a bit of google work to find out how to do this.
 
Another thought (off the top of my head), there is a jumper setting on the relays. Is there a chance that you have the jumper set wrong (check my wiring diagram). This might be upsetting the chip on the slice of Pi/o when the script is run.
 
Just starting to put mine together (what parts I have so far anyway)
I get this though:
Code:
pi@raspberrypi ~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
pi@raspberrypi ~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
pi@raspberrypi ~ $

You suggest it should be on -y 0? What is the difference?

EDIT:
reading the reviews on the ciseco site showed me this:
Potential gotcha for Pi Revision 2 users, they have swapped the I2C channels so the I2CDetect command as shown won't show the board, you need to change the zero to a one in the command I.e. i2cdetect -y 1

So It looks like I have a R2 version.
Does this affect your code (I assume so?)
 
OK it will not the code checks for the different revisions:
Code:
  def getPiI2CBusNumber():
    # Gets the I2C bus number /dev/i2c#
    return 1 if Adafruit_I2C.getPiRevision() > 1 else 0

So the bus # will be 0 for an older model and 1 for a newer one.
 
Fine.
I am leaning to wards a Frankenstein unit combining the Pi Radio with this mod, maybe add the relays etc to a separate box that can be plugged in to a Pi Radio and a test to see if the relay unit (or the switch unit) is there and start the boiler/hlt control if not start the radio on power up. They both use the same LCD display.

Esp since 99% of the time I will be using it to listen to Internet Radio :thumb:
(Pi Radio project here)
 
Robbo
Replacement Slice of Pi/o obtained today so hopefully will be able to test with a new board & chip either tonight or tomorrow night. :thumb: Will let you know how I get on. :electric: :electric:
Graham
 
Not a happy bunny today.

The new Slice of Pi/o gives the same as the old one did and the I2Cdetect commands even give the same results if the board is not connected to the bus - i.e.

pi@raspberrypi ~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi ~ $ i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
pi@raspberrypi ~ $

Therefore I suspect it's my Pi what am broke :(

been searching every where on't web to see if I'm doing something wrong but nothing there to help. I can see others have had similar issues.

It's annoying as the program writes to screen as well as reads the thermometers so I just do not know what's wrong apart from not being able to access I2C port 20.

Graham
 
Right, don’t worry, we can get to the bottom of the problem (or die trying). There is a possibility that it might be the Pi, but the other GPIOs seem to be working (e.g. Temperature Sensor), so I don’t think your Pi is broken.

First question: What voltage setting do you have on the Slice of Pi/o board? There is a red jumper that can be set to either 3V3 or 5V. It must be set to 5V, otherwise it is insufficient potential to switch the relays and this may cause the chip to become unstable. If you had this set wrong, then change it and try again.

Second question: Have you tried something simple in the command line environment to see if the Slice of Pi/o is working? Make sure that the Boiler script is not set to automatically run at boot (simply undo the changes you made before). then re-boot the pi.

Put an LED (if you have one), or your buzzer, between the A0 output and ground connections and then we can use the command line to turn this output on.

To do this, first of all type:

Code:
i2cdetect -y 0

to confirm that they Slice of Pi/o is showing on address 20 again as before.

Then type:

Code:
i2cset -y 0 0x20 0x00 0x00
this will set the A bank of i/o’s to outputs
then type:
Code:
i2cset -y 0 0x20 0x12 0xff
this should set all the outputs to ON and should turn your buzzer (or LED) on.

Does this work?

you can then type:
Code:
i2cset -y 0 0x20 0x12 0x00
to turn them all off again.
 
Thanks for persisting Robbo

I have an LED that lights when I stick it between +5 and 0V (a 5V flashing one that doesn't require a separate resistor) plugged it into A0 and then followed your instructions. No light. Tried every pair - A0 to A7 then B0 to B7 - no light. rechecked on +5 and it lit as expected. Therefore commands are not switching the ports.

I tried the 2nd board on 5V, 3.3V and even a separate 5V PSU from the Pi by removing the jumper becuase the supply was down to 4.84V. The display etc. all works but no ports.

I'm going to try restarting from another blank SD card to check the Rasbian is all OK.

Graham
 
OK Robbo

I've started from scratch and built a new card following all of the steps up to running the software. I then did the i2cdetect commands and 1 was completely empty and 0 has all addresses from 03 to 77 listed. Exactly the same as before. It is exactly the same with the other SliceofPi/o board which has no relays, lcd or thermometers connected. Running the software has the LCD working OK but it cannot see address 20. Therefore I thing the Pi board is broke. This is the first time I've tried using it for anything other than web access.

I do not believe it is anything to do with your code or design but my board. :wha:

Thanks for all your help, I'll let you know when I have a replacement. :thumb:

Graham
 
Have you followed any other i2c setup guides to make sure it isn't a mistake in my instructions. I don't think it is wrong, but worth a try before you get a new Pi.
 
Robbo
I ran through the instructions on the Adafruit website just to make sure there were no other configuration issues but the problems remained exactly the same so I have full confidence in your instructions unlike my Pi board.
Graham
 
Replacement model B ordered. :thumb:
Hopefully I should still be able to use the broken one for a serial data logging project I have in mind to try after I get the boiler controller working. TTL to RS232 module on order as well. Thanks for your help.
Graham
 
Robbo

I've found the problem (or two ;^)

Firstly I installed 10k resistors onto the two I2C bus pins to hold them up to 3.3V. This gave the correct bus address display for I2Cdetect. However my board is a Revision 3 but the Bus is 0. The Adafruit_I2C routine keeps returning 1 for revision 3. :(

Changed line 27 in Adafruit_I2C.py to read "return 0 if ............." and the program then displays the temperature correctly. :party:

It does go straight into full boil mode so got to sort out the problem with the switches now. :wha:

Watch this space.

Graham
 

Latest posts

Back
Top