#REM Li-Ion Battery Management System Remote Display & PC Data Logging Module By Peter Perkins. Picaxe 08M - PIC12F683 - 100809 - www.150mpg.co.uk - V0.01 **************************** General Information ****************************** The BMS modules carry no warranty or guarantee of any kind! They are used at your own risk, and I make no claims as to their 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 EV & electronic community. The software is available free via the internet. Users may modify or adapt the system as they see fit. If you are not fully competent to work on potentially lethal battery systems and high voltages, then do not experiment with or use this system. 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. ******************** Remote Display Picaxe 08M Pinouts ************************ Top _____ (+ Supply) +Ve -1| ^ |8- -Ve (- Supply) (Program In) Rxd -2| 0 |7- Txd (Program Out & Txd to Pc) (16x2 Lcd Display Out) Output 4 -3| 8 |6- Output 1 (Audible Alarm Out) (Rxd Serial Data In) Input 3 -4| M |5- Output 2 (Data OK Led Out) ----- ********************** Watchdog Module Specification ************************** Supply Voltage 5.00V DC same as Master Average Supply Current at 5.00v <100ua CPU Speed 4mhz with internal resonator ******************************************************************************* ******************************** Clock Speeds ********************************* ********** Reducing Speed Should Save Power (Untested at present) ************ %00000000 = 31 kHz 19bps %00010000 = 125 kHz 75bps %00100000 = 250 kHz 150bps %00110000 = 500 kHz 300bps %01000000 = 1 MHz 600bps %01010000 = 2 MHz 1200bps %01100000 = 4 MHz 2400bps %01110000 = 8 MHz 4800bps Example = poke $8F,%01100000 'Set clock to 4 MHz ******************************************************************************* *********************** Program Size XX out of 256 Bytes ********************** ******************************************************************************* #ENDREM #picaxe 08M ;Set editor to Picaxe 08M Mode `Variables Constants and I/O definitions `Variables symbol Alarms = w0 ;w0 Global (b0,b1) = Alarms Word (b0,b1 bytes) (16 bits = 2 x 8bits) symbol CellVoltage = w1 ;w1 Local (b2,b3) = Cell Voltage 0-1023 10bit (0-5v) symbol PackVoltage = w2 ;w2 Local (b4,b5) = Calculated pack voltage (Voltage of all Cells added together) symbol Soc = w3 ;w3 Global (b6,b7) = Calculated pack capacity (Soc State of Charge) resolution 10ma symbol BatCurrent = w4 ;w4 Local (b8,b9) = Current Sensor ADC value 0-1023 10bit Approx 200ma resolution `Constants symbol Delay = 250 ;Pause for 250ms at 4mhz `Pins used for I/O and designations `*** Digital high/low Outputs *** symbol Txd = 0 ;Serial out to Pc via prog cable on Output 0 symbol Alarm = 1 ;Audible Alarm Warning on Output 1 symbol Led = 2 ;Data OK Led on Output 2 symbol Lcd = 4 ;Serial 16x2 Lcd 2400baud on Output 4 `*** Digital high/low Inputs *** symbol Rxd = 3 ;Serial Data from Master via 433mhz link on Input 3 `******************************************************************************* `******************************************************************************* Start: ;Program Start serout Lcd,N2400,(254,1) ;Initialise 16x2 Lcd pause Delay ;Pause to allow display to initialise Main: low led serin Rxd,N1200,("data"),b4,b5 ;Receive PackVoltage data via radio link from Master high led ;Turn on data `OK` Led sertxd("Data ",#PackVoltage,13,10) ;Transmit data to PC via programming lead serout Lcd,N2400,(254,128,"Pack Volts ",#PackVoltage," V") ;Transmit data to Lcd goto Main #REM In Picaxe language, sender side: serout 0, T2400_4, (0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,) pause 5 serout 0, T2400_4, ("data", b0) In Picaxe language, receiver side: serin 0, T2400_4, ("data"), b0 #ENDREM