Greenhouse i2c control board

This board was built originally for control from a Win98 box using i2cee and Visual Basic.
Now to be controlled by the router.
Most of my old notes are hard to understand hence this more determined attempt to document efforts.

Objective
Control and monitor greenhouse and hydroponic systems using Blassic basic on the router

So what's on the i2c bus?

midge# i2cdetect -l
i2c-0 i2c ADM5120 I2C Bit-shift algorithm

midge# i2cdetect -a 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c/0.
I will probe address range 0x00-0x7f.
Continue? [Y/n]
.....0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .a .b .c .d .e .f
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
20: 20 21 22 XX XX XX XX 27 XX XX XX XX XX XX XX XX
30: XX XX XX XX XX XX XX XX XX 39 3a 3b 3c 3d XX XX
40: XX XX XX XX XX XX XX XX 48 XX XX XX 4c 4d XX XX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
midge#

All i2c chip addresses that might be on the bus at some time - red items not on greenhouse board

Chip HEX DEC Task                
PCF8574P 20 32 Read Maplin thermometers - port A (top middle) - Greenhouse board                
PCF8574P 21 33 Read Maplin thermometers - port A (top left) - Greenhouse board                
PCF8574P 21 34 Read column C - door states etc - Greenhouse board                
                       
PCF8574P     field probe SMD Eurocard chicken detector                
PCF8574P  27 39 small test board                
                       
PCF8574AP 38 56 Screen Relays driver on 52 0 0 1 1 1 0 0 0
PCF8574AP 39 57 A/D multitiplex driver - Greenhouse board 0 0 1 1 1 0 0 1
PCF8574AP 3A 58 Maplin thermometer multiplex - Greenhouse board 0 0 1 1 1 0 1 0
PCF8574AP 3B 59 Water control - 8 yellow LEDs - Greenhouse board 0 0 1 1 1 0 1 1
PCF8574AP 3C 60 Water control - 8 red LEDs - Greenhouse board 0 0 1 1 1 1 0 0
PCF8574AP 3D 61 Water control - 8 green LEDs - Greenhouse board 0 0 1 1 1 1 0 1
                       
PCF 8591P 4C 76 8bit A to D on small test board 0 1 0 0 1 1 0 0
PCF8591 4D 77 8 bit A to D on Greenhouse board 0 1 0 0 1 1 0 1
                       
LM75 48 72 Thermometer on small test board 0 1 0 0 1 0 0 0
LM75 49 73 Thermometer on long free cable 0 1 0 0 0 0 0 1
LM75 4A 74 Thermometer - not yet wired 0 1 0 0 0 0 1 0
LM75 4B 75 Thermometer on short free cable 0 1 0 0 0 0 1 1
                       
      Solar Water heater monitor
- not on greenhouse line
               
LM75 48 72 T1 roof - tube manifold 0 1 0 0 1 0 0 0
LM75 4A 75 T4 feeder tank bottom 0 1 0 0 1 0 1 0
LM75 4B 76 T2 prime tank bottom 0 1 0 0 1 0 1 1
LM75 4C 77 T5 feeder tank top 0 1 0 0 1 1 0 0
LM75 4D 78 T3 prime tank top 0 1 0 0 1 1 0 1
PCF 8591P 49 73 Sunlight monitor 0 1 0 0 1 0 0 1
PCF8574P 20 32 pump & heater monitor / tank switch over 0 0 1 0 0 0 0 0
                       
ADSL7823     12bit A to D on field probe SMD Eurocard                
LM75     Thermometer on field probe SMD Eurocard                
                  A2 A1 A0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NB! LM75 and PCF8591 share the address space starting with hex 4
both have 3 address lines

The PCF8574 tests have this format (address and bytes out are decimal)
Send 123 to the 8 yellow LEDS
midge# PCF8574_addr_byteout 59 123

A/D multiplex test
Read volts on grey wire of terminal strip - line 7 of the 8 multiplex inputs (0-7) connected to the first A/D input 0
Send 7 to the multiplex switch - 3 wires from PCF8574P address decimal 57 all to go high (3 LEDs on)
read the volts on the PCF8591 address decimal 77 first line (0) - pink wire
see this -
midge04# PCF8574_addr_byteout 57 3
midge04#
PCF8591_addr_line_V 77 0 200 (the output V, 200, can be any from 0 to 255 as it is not used)
BYTE = 60 (volts on test pot)
midge04
The second multiplex port feeds the second line (1) - grey wire - of the PCF8591 A/D

again use -
PCF8574_addr_byteout 57 3 to read line 7 as before -
but read as -
PCF8591_addr_line_V 77 1 200

 

 

 

 

Please email me if you work on a similar system.