X-Git-Url: https://git.frykholm.com/heatpump.git/blobdiff_plain/ec56fabb9bb935ab2cfcaae5614d9a56928b9d8e..aad4ecbcbefc719c4f285548139ae396fe2ea895:/heatpump.py diff --git a/heatpump.py b/heatpump.py index d715d07..0075752 100644 --- a/heatpump.py +++ b/heatpump.py @@ -1,7 +1,7 @@ import piplates.DAQCplate as DAQC import time from decimal import Decimal -DAQC.setDOUTbit(0,0) +#DAQC.setDOUTbit(0,0) #thermistor reading function def compressor(state=None): if state==None: @@ -12,7 +12,7 @@ def compressor(state=None): DAQC.clrDOUTbit(0,0) def temp_get(volts,supply_voltage=5): - divider_resistor=10000 + divider_resistor=1500 ohms = Decimal(divider_resistor*supply_voltage/volts-divider_resistor) #calculate the ohms of the thermisttor #IVT oem NTC a = Decimal(1.298022762e-3) @@ -26,16 +26,18 @@ def temp_get(volts,supply_voltage=5): while(True): vv_retur=temp_get(DAQC.getADC(0,0),DAQC.getADC(0,8)) + vv_top=temp_get(DAQC.getADC(0,2),DAQC.getADC(0,8)) hetgas=temp_get(DAQC.getADC(0,1),DAQC.getADC(0,8)) print("VV retur:",vv_retur) + print("VV top:",vv_top) print("Hetgas:",hetgas) print("Kompressor:",compressor()) - if vv_retur < 35: + if vv_top < 35: compressor(True) - print("Returtemp under 35. Startar kompressor") - if vv_retur > 45: + print("Toptemp under 35. Startar kompressor") + if vv_top > 45: compressor(False) - print("Returtemp över 45. Stänger av kompressor") + print("Toptemp över 45. Stänger av kompressor") # import pdb;pdb.set_trace() time.sleep(1)