#REM Honda Insight Coolant Thermos Project by Peter Perkins. Picaxe 18X - PIC16F88 - 230108 - www.150mpg.co.uk - V.01 Beta. **************************** General Information ****************************** This Thermos module carries no warranty or guarantee of any kind! It is used at your own risk, and I make no claims as to it's suitability for a particular function. Prospective users must evaluate the system before using it, and no liability will be entertained by myself in any shape or form whatsoever. The modules and software have been produced at low cost for the benefit of the Insight community. The software is available free via the internet. Users may modify or adapt the system as they see fit. Be aware that vehicle modifications can lead to invalidated insurance and warranty issues. You the end user remain fully liable for any modifications made to your vehicle. ***************************** Picaxe 18X Pinouts ****************************** Top _____ (Diverter valve 5k pot) Input 2 -1| ^ |18- Input 1 (ADC Button Matrix) (Program Out) Txd -2| |17- Input 0 (Ignition 12v+ Switched) (Program In) Rxd -3| |16- Input 7 (DS18B20 Thermos Temp) (Reset) Reset -4| 1 |15- Input 6 (DS18B20 Engine Temp) (- Supply) -Ve -5| 8 |14- +Ve (+ Supply) (Diverter Valve Open) Output 0 -6| X |13- Output 7 () (Diverter Valve Close) Output 1 -7| |12- Output 6 () (12V Coolant Pump) Output 2 -8| |11- Output 5 (Piezo Audible Warning) (12V Heater Element) Output 3 -9| |10- Output 4 (16x2 Lcd Dash Display) () ----- ************************ Thermos Module Specification *************************** Logic Supply Voltage 5.00V DC Average Supply Current at 5.00v <100ua ********************************************************************************* *********************** Program Size XX out of 256 Bytes ************************ ********************************************************************************* #ENDREM `Variables Constants and I/O definitions `Variables 8bit symbol PotPosition = b0 ;b0 = Diverter Valve Pot Position ADC 0-5V (0-255) symbol ButtonValue = b1 ;b1 = Button Pressed ADC 0-5V (0-255) symbol EngineTemp = b2 ;b2 = Engine Temp -55C to +125C symbol ThermosTemp = b3 ;b3 = Thermos Temp -55C to +125C symbol IgnOnOff = b4 ;b4 = Ignition Switch On/Off (0 or 1) `Constants symbol MaxTemp = 95 ;Maximum Permitted Thermos Temp (95C) symbol MinTemp = 20 ;Minimum Permitted Thermos Temp (20C) symbol Opened = 250 ;Diverter Valve Pot value when fully Open symbol Closed = 5 ;Diverter Valve Pot value when fully Closed symbol Delay = 20000 ;Delay for Pause command (20,000 = 20 seconds) `BaudRate constants for 4mhz symbol Baud2400 = N2400 ;Lcd Serial Data Baud rate 2400 at 4mhz `Pins used for I/O and designations `*** Digital high/low Outputs *** symbol ValveOpen = 0 ;12V Diverter Valve Open drives H bridge Forward on Output 0 symbol ValveClosed = 1 ;12V Diverter Valve closed drives H bridge Reverse on Output 1 symbol CoolantPump = 2 ;12V Coolant Pump on Output 2 symbol Heater = 3 ;12v Thermos Internal Heater Element on Output 3 symbol LcdDisplay = 4 ;Serial 16X2 Lcd Dashboard Display on Output 4 symbol Piezo = 5 ;Audible Alarm on Output 5 `*** Digital high/low Inputs *** symbol Ignition = 0 ;12v Switched input via potential divider to 5V on Input 0 symbol Engine = 6 ;DS18B20 Engine Temp Sensor on Input 6 symbol Thermos = 7 ;DS18B20 Thermos Temp Sensor on Input 7 `*** Analogue ADC Inputs *** symbol Buttons = 1 ;Button Matrix on ADC Input 1 symbol ValvePot = 2 ;Diverter Valve 0-5k Position Pot on Input 2 `******************************************************************************* `******************************************************************************* Main: ;Main program start readtemp Engine, EngineTemp ;Read Engine Temperature into byte variable EngineTemp if EngineTemp > 127 then ;Test for Temperature <0C EngineTemp = 0 ;Set EngineTemp to 0C if <0C endif serout LcdDisplay,Baud2400,(254,128,"Engine ",#EngineTemp,"C ") ;Transmit to serial LCD readtemp Thermos, ThermosTemp ;Read Thermos Temperature into byte variable ThermosTemp if ThermosTemp > 127 then ;Test for Temperature <0C ThermosTemp = 0 ;Set ThermosTemp to 0C if <0C endif serout LcdDisplay,Baud2400,(254,192,"Thermos ",#ThermosTemp,"C ") ;Transmit to serial LCD readadc Buttons, ButtonValue ;Read Button value into byte variable ButtonValue (0-255) ButtonValue = ButtonValue + 3 / 85 - 1 ;Convert ADC data to button number. (0,1,2) 0 = no button on ButtonValue gosub PumpToThermos, PumpToEngine ;Gosub depending on button pressed goto main ;Goto Main `******************************************************************************* PumpToThermos: ;Pump Coolant from Engine to Thermos (Store) Routine if ThermosTemp >= EngineTemp then return ;If thermos hotter than engine return without pumping endif do readadc ValvePot, PotPosition ;Read Diverter valve Position into byte variable PotPosition (0-255) high ValveOpen ;Activates Diverter Valve Motor and moves to thermos position loop while PotPosition < Opened ;Repeats loop until Valve opened low ValveOpen ;Deactivate Diverter Valve Motor gosub Pumping ;Gosub Pumping Subroutine return ;Return to main loop `******************************************************************************* PumpToEngine: ;Pump Coolant from Thermos to Engine (Preheat) Routine if EngineTemp >= ThermosTemp then return ;If engine hotter than thermos return without pumping endif do readadc ValvePot, PotPosition ;Read Diverter valve Position into byte variable PotPosition (0-255) high ValveClosed ;Activates Diverter Valve Motor and moves to engine position loop while PotPosition > Closed ;Repeats loop until Valve closed low ValveClosed ;Deactivate Diverter Valve Motor gosub Pumping ;Gosub Pumping Subroutine return ;Return to main loop `******************************************************************************* Pumping: ;Pump Coolant Subroutine high CoolantPump ;Activate Coolant pump to start Coolant transfer serout LcdDisplay,Baud2400,(254,128,"Pumping Coolant!") ;Transmit to serial LCD serout LcdDisplay,Baud2400,(254,192," Please Wait! ") ;Transmit to serial LCD pause Delay ;Pause for 20 seconds low CoolantPump ;Deactivate Coolant pump as transfer complete high Piezo ;Activate Piezo Tone pause 1000 ;Pause for 1 second low Piezo ;Deactivate Piezo Tone return ;Return to main loop