Search:

SOC Display

Energy.SOCDisplay History

Hide minor edits - Show changes to markup

18 November 2019 at 10:53 AM by 115.189.134.223 -
Changed lines 58-67 from:
ArduinoDisplayArduino codeSTL file
Pro Mini0.96 inch OLED 128x64 SPI busYes 
Pro Mini0.96 inch OLED 64x128 SPI busYesYes
Pro Mini1.5 inch OLED 128x64 SPI busYes 
Pro Mini1.5 inch OLED 128x128 I2C busOn order 
Pro Mini1.54 inch OLED 128x64 SPI busOn order 
Pro Mini1.5 inch OLED 64x128 SPI busYes 
Pro Mini1.44 inch colour TFT 128x128 SPI busIn progress 
Pro Mini1.8 inch colour TFT 128x160 SPI busNext up 
Pro Mini1.3 inch OLED 128x160 I2C busOn order 
to:
ArduinoDisplayArduino codeSTL file
Pro Mini0.96 inch OLED 128x64 SPI busYesalmost
Pro Mini0.96 inch OLED 64x128 SPI busYesYes
Pro Mini1.5 inch OLED 128x64 SPI busYes 
Pro Mini1.54 inch OLED 128x64 SPI busYesalmost
Pro Mini1.3 inch OLED 128x160 I2C bus  
Pro Mini1.5 inch OLED 128x128 I2C bus  
ArduinoDisplayArduino codeSTL file
Pro Mini1.44 inch colour TFT 128x128 SPI busIn progress 
Pro Mini1.8 inch colour TFT 128x160 SPI busIn progress 
18 November 2019 at 10:41 AM by 115.189.134.223 -
Deleted line 3:

and here's another version with the screen rotated 90 degrees to fit a few more data items:

07 November 2019 at 05:22 PM by 115.189.132.169 -
Changed line 56 from:

Github also hosts the STI files for a 3D printed frame to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels). I'll add more frames as I go. I'm aiming to find the biggest OLED that will fit inside the dash.

to:

I've also got some STL files on Github for a 3D printed frame to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels). I'll add more frames as I go. I'm aiming to find the biggest OLED that will fit inside the dash. You can use black electrical tape but a black 3D printed frame looks a wee bit better.

07 November 2019 at 05:20 PM by 115.189.132.169 -
Changed lines 85-86 from:

http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-01.jpg

to:

http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-01.jpg The eye brow dash removed and separated into three parts (they just unclip apart)

Changed lines 89-90 from:
to:

Wide black electrical tape over the trees part of the display - try to avoid including any dust particles, or you'll get bumps like I did.

Changed lines 92-93 from:
to:

0.96 inch display mountain inside 3D printed frame. Held in place with double sided tape. I also cut out a small segment of the dash edging to let the wires pop out.

Changed lines 95-96 from:
to:

Clip the dash back to together and plug the display into a 60 cm long extension cable. Use whatever connectors you can find. Ideally they should clip together so they can't just wiggle loose.

Changed lines 98-99 from:
to:

Feed the extension cable down past the steering column and put the dash back in place.

Changed lines 101-102 from:
to:

In a right-hand drive Leaf partially remove the right knee panel beside/below the steering column to find your extension cable.

Changed lines 104-105 from:
to:

Plug the OBD2 plug in and carefully throw the Arduino and bits in there somewhere and slap the panel back in place. (Or you could spend more time and do a tidy job.)

Added line 107:

Turn the car on and enjoy the extra info.

07 November 2019 at 05:08 PM by 115.189.132.169 -
Changed lines 85-86 from:

http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-01.jpg

to:

http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-01.jpg

Added line 88:
Added line 90:
Added line 92:
Added line 94:
Added line 96:
Added line 98:
07 November 2019 at 05:06 PM by 115.189.132.169 -
Added lines 83-92:

Some pictures to help: http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-01.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-02.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-03.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-04.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-05.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-06.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-07.jpg http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-install-08.jpg

07 November 2019 at 04:56 PM by 115.189.132.169 -
Changed line 141 from:

This version also used black electrical tape to hold the display in place - which works surprisingly well. The 3D printed frame is even nicer.

to:

This version also used black electrical tape to hold the display in place - which works surprisingly well. The 3D printed frame looks more professional though.

07 November 2019 at 04:56 PM by 115.189.132.169 -
07 November 2019 at 04:55 PM by 115.189.132.169 -
Changed line 141 from:
to:

This version also used black electrical tape to hold the display in place - which works surprisingly well. The 3D printed frame is even nicer.

07 November 2019 at 04:49 PM by 115.189.132.169 -
Changed lines 3-4 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/CAN_OLED_display-sm.jpg

to:
Changed lines 139-141 from:

Here's a better look at the display taped in place: https://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-64x128-OLED-bright-763x309.jpg I used a strong torch to illuminate the dash in this photo - normally you can't see any of the black tape.

to:

Here's the first version with the 0.96 inch OLED 128x96 display oriented in normal "landscape" mode: http://www.myonlinediary.com/nissan-leaf/SOC_OLED/CAN_OLED_display-sm.jpg

07 November 2019 at 04:46 PM by 115.189.132.169 -
Changed line 57 from:

I've also made a 3D printed frame to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels). I'll add more frames as I go. I'm aiming to find the biggest OLED that will fit inside the dash.

to:

Github also hosts the STI files for a 3D printed frame to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels). I'll add more frames as I go. I'm aiming to find the biggest OLED that will fit inside the dash.

07 November 2019 at 04:45 PM by 115.189.132.169 -
Changed line 57 from:

I've also made a 3D printed fram to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels)

to:

I've also made a 3D printed frame to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels). I'll add more frames as I go. I'm aiming to find the biggest OLED that will fit inside the dash.

07 November 2019 at 04:42 PM by 115.189.132.169 -
Added lines 64-65:
Pro Mini1.5 inch OLED 128x128 I2C busOn order 
Pro Mini1.54 inch OLED 128x64 SPI busOn order 
Changed lines 68-69 from:
Pro Mini1.8 inch colour TFT 128x160 SPI bus  
to:
Pro Mini1.8 inch colour TFT 128x160 SPI busNext up 
Pro Mini1.3 inch OLED 128x160 I2C busOn order 
07 November 2019 at 04:35 PM by 115.189.132.169 -
Changed line 59 from:
to:
07 November 2019 at 04:33 PM by 115.189.132.169 -
Changed line 59 from:
to:
07 November 2019 at 04:33 PM by 115.189.132.169 -
Changed line 59 from:
to:
07 November 2019 at 04:32 PM by 115.189.132.169 -
Changed line 59 from:
to:
07 November 2019 at 04:31 PM by 115.189.132.169 -
Changed line 59 from:
to:
07 November 2019 at 04:31 PM by 115.189.132.169 -
Changed line 57 from:

I've also made a 3D printed shroud/bracket to fit a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels)

to:

I've also made a 3D printed fram to hold a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels)

07 November 2019 at 04:30 PM by 115.189.132.169 -
Changed lines 53-54 from:

Arduino code

to:

Arduino code and STL files

Added lines 56-67:

I've also made a 3D printed shroud/bracket to fit a "standard" 0.96 inch OLED 128x64 display rotated 90 degrees (so that it becomes 64x128 pixels)

ArduinoDisplayArduino codeSTL file
Pro Mini0.96 inch OLED 128x64 SPI busYes 
Pro Mini0.96 inch OLED 64x128 SPI busYesYes
Pro Mini1.5 inch OLED 128x64 SPI busYes 
Pro Mini1.5 inch OLED 64x128 SPI busYes 
Pro Mini1.44 inch colour TFT 128x128 SPI busIn progress 
Pro Mini1.8 inch colour TFT 128x160 SPI bus  
07 November 2019 at 04:19 PM by 115.189.132.169 -
Changed line 6 from:

http://www.myonlinediary.com/uploads/LeafSOCdisplay-90degrees-763x277.jpg

to:

http://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-64x128-OLED-in-dash-763x336.jpg

07 November 2019 at 03:01 PM by 115.189.132.169 -
Changed lines 93-94 from:
  • Rename variables in code so that rawGids = Gids value from EV-Can and rawSOC = SOC value from EV-Can (currently the variable for Gids is called "Soc")
to:
  • DONE - Rename variables in code so that rawGids = Gids value from EV-Can and rawSOC = SOC value from EV-Can (currently the variable for Gids is called "Soc")
Changed line 99 from:
  ** DONE - indicate Gids turtle, and somehow indicate threshold of turtle mode [Turtle mode (at 8 Gids) which is now what my 0 %SOC equals
to:
  ** DONE - indicate Gids turtle, and somehow indicate threshold of turtle mode [Turtle mode (at 8 Gids) which is now what my "0 %SOC" equals
Changed lines 105-106 from:
  • Try larger and/or colour OLED display? I have a 128x128 1.5" OLED display on order (https://www.aliexpress.com/item/33058101072.html?spm=a2g0s.9042311.0.0.70b04c4drndgZH)
to:
  • Try larger OLED or color TFT display? I have a 128x128 1.5" OLED display on order (https://www.aliexpress.com/item/33058101072.html)
  • Try connecting to the Car-CAN to access more data fields. Maybe have a separate display for this?
Deleted lines 139-162:

Some Code

#define MAX_SOC 281.0F
#define KW_FACTOR 74.73F       // Some people prefer 80 


// Read from EV-Can
// GIDS and SOC and kWh remaining
      if(rxId == 0x5bc) {
        Soc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);      //Read "Gids" from EV-Can
        kWh = (((float)Soc) * KW_FACTOR) / 1000.0F;   //Calculate kWh from Gids
      }

/ Actual SOC
      if(rxId == 0x55b) {
        ActSoc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);   // Read SOC from EV-Can
        ActSocPct = ActSoc / 10.0F;                   
      }
    }
  }


07 November 2019 at 02:42 PM by 115.189.132.169 -
Changed line 25 from:
  1. OLED display 128x64 pixel 1/3 inch monochrome OLED display
to:
  1. OLED display 128x64 pixel monochrome OLED display (0.96 inch or 1.3 inch)
26 October 2019 at 06:19 PM by 203.97.97.117 -
Changed line 6 from:

http://www.myonlinediary.com/uploads/LeafSOCdisplay-90degrees-763x279.jpg

to:

http://www.myonlinediary.com/uploads/LeafSOCdisplay-90degrees-763x277.jpg

26 October 2019 at 12:23 PM by 203.97.97.117 -
Changed line 6 from:

https://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-64x128-OLED-763x302.jpg

to:

http://www.myonlinediary.com/uploads/LeafSOCdisplay-90degrees-763x279.jpg

25 October 2019 at 06:28 PM by 115.189.85.105 -
Changed line 5 from:

and here another version with the screen rotated 90 degrees:

to:

and here's another version with the screen rotated 90 degrees to fit a few more data items:

25 October 2019 at 06:27 PM by 115.189.85.105 -
Changed lines 6-7 from:

https://www.kennett.co.nz/people/paul/images/LeadSOCdisplay-64x128-OLED-763x302.jpg

to:

https://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-64x128-OLED-763x302.jpg

Changed line 124 from:

https://www.kennett.co.nz/people/paul/images/LeadSOCdisplay-64x128-OLED-bright-763x309.jpg

to:

https://www.kennett.co.nz/people/paul/images/LeafSOCdisplay-64x128-OLED-bright-763x309.jpg

25 October 2019 at 06:22 PM by 115.189.85.105 -
Added line 125:

I used a strong torch to illuminate the dash in this photo - normally you can't see any of the black tape.

25 October 2019 at 06:21 PM by 115.189.85.105 -
Added lines 122-125:

Here's a better look at the display taped in place: https://www.kennett.co.nz/people/paul/images/LeadSOCdisplay-64x128-OLED-bright-763x309.jpg

25 October 2019 at 06:19 PM by 115.189.85.105 -
Changed lines 5-6 from:

and here another version with the screen rotated 90 degrees

to:

and here another version with the screen rotated 90 degrees:

25 October 2019 at 06:19 PM by 115.189.85.105 -
Added lines 4-7:

and here another version with the screen rotated 90 degrees

https://www.kennett.co.nz/people/paul/images/LeadSOCdisplay-64x128-OLED-763x302.jpg

25 October 2019 at 04:48 PM by 115.189.85.105 -
Changed lines 95-100 from:
  ** show Lowest cell voltage
  ** indicate Gids turtle, and somehow indicate threshhold of turtle mode 
  ** show SOC to 2 decimal places
  • Try larger and/or colour OLED display?
to:
  ** show Lowest cell voltage 
  ** DONE - indicate Gids turtle, and somehow indicate threshold of turtle mode [Turtle mode (at 8 Gids) which is now what my 0 %SOC equals
  ** DISREGARD - show SOC to 2 decimal places [even though the SOC can be presented to two decimal places it's not accurate enough to justify that level of precision. Sometimes vagueness is more truthful.]
  • what about a high temp mode - for when the temp goes above 50 degrees C?
    • show highest temp from battery pack
  • Try larger and/or colour OLED display? I have a 128x128 1.5" OLED display on order (https://www.aliexpress.com/item/33058101072.html?spm=a2g0s.9042311.0.0.70b04c4drndgZH)
Added line 113:
  ** this would be much easier to implement if I connected to the Car-CAN instead (or switched to the car can
24 October 2019 at 08:44 PM by 203.97.97.117 -
Added line 72:
  • http://www.wwwsite.com/puzzles/socmeter/
24 October 2019 at 08:44 PM by 203.97.97.117 -
Changed lines 69-71 from:
  • LEAF CANbus decoding
  • https://github.com/lincomatic/LeafCAN
  • http://www.weigu.lu/microcontroller/leafcanlog/index.html
to:
  • https://www.mynissanleaf.com/viewtopic.php?t=4131|LEAF CANbus decoding
  • https://github.com/lincomatic/LeafCAN
  • http://www.weigu.lu/microcontroller/leafcanlog/
24 October 2019 at 08:44 PM by 203.97.97.117 -
Added line 71:
  • http://www.weigu.lu/microcontroller/leafcanlog/index.html
24 October 2019 at 08:43 PM by 203.97.97.117 -
Added lines 70-71:
  • https://github.com/lincomatic/LeafCAN
23 October 2019 at 03:29 PM by 203.97.97.117 -
Changed line 52 from:

The Arduino code is: SOC_OLED_v12 Version 12, 13 October 2019

to:

The Arduino code is on Github: https://github.com/PaulKennett/LeafSOCdisplay

20 October 2019 at 10:47 PM by 203.97.97.117 -
Changed lines 84-85 from:
  • Remove start up screens. The CAN connection error page should stay on forever though.
to:
  • DONE - Remove start up screens. The CAN connection error page should stay on forever though.
Changed lines 88-89 from:
  • Only start displaying numbers once they have been loaded from the CAN module , Michelle looked at the display when she started the car and saw it was zero, so assumed it was broken and therefore did not look at it again. To avoid this user confusion itís best not to show zeros during the loading period. [So only display digits when they are do not equal zero (if !=0 then display)]
to:
  • DONE - Only start displaying numbers once they have been loaded from the CAN module , Michelle looked at the display when she started the car and saw it was zero, so assumed it was broken and therefore did not look at it again. To avoid this user confusion itís best not to show zeros during the loading period. [So only display digits when they are do not equal zero (if !=0 then display)]
Changed lines 107-109 from:
  • Accurate speedo? - I think this is (only?) available on the Car-CAN bus
to:
  • Accurate speedo? - is this only available on the Car-CAN bus?
Changed lines 129-130 from:

////////////// ///// GIDS and SOC and kWh remaining /////////////////////////////////////////////////

to:

// Read from EV-Can // GIDS and SOC and kWh remaining

Deleted line 132:
        SocPct = (Soc / MAX_SOC) * 100.0F;
Changed lines 136-146 from:

////////////////// Voltage and current /////////////////////////////////////////////////////////////

      if(rxId == 0x1db) {
        BattVolts = (rxBuf[2] << 2) | (rxBuf[3] >> 6); // Read Volts from EV-Can
        BattVolts = BattVolts/2.0F;
        Amp = (rxBuf[0] << 3) | (rxBuf[1] >> 5);       // Read Amps from EV-Can
        if(Amp & 0x0400) Amp |= 0xf800;
        Amps = -(Amp / (2.0F));
        kW = (Amps * BattVolts)/1000.0F;               // Calc instantaious kW from V*A
      }

/////////////////// Actual SOC /////////////////////////////////////////////////////////////////////

to:

/ Actual SOC

17 October 2019 at 05:42 PM by 115.189.133.40 -
Changed line 46 from:

The CAN bus signals come from OBD2 pins 12 and 13. The OBD2 standard CAN bus signals are on pins 6 and 14. On a Leaf those provide the Car-CAN bus, whereas pins 12 and 13 provide the EV-CAN bus.

to:

The Leaf EV-CAN signals come via OBD2 pins 12 and 13. The OBD2 standard CAN bus signals are on pins 6 and 14 - which, in the case of the Leaf gives the Car-CAN bus.

17 October 2019 at 05:39 PM by 115.189.133.40 -
Changed line 13 from:

Note: the SOC figure shown on this display is the same as is shown on LeafSpy, which is slightly different from that shown on the dash of the 2013 Leaf! This project displays the SOC as a percentage of a theoretical brand new battery (defined as 281 Gids). In my case my real max is more like 235 Gids. (I may change my code to reflect this, so that a full charge is shown as 100%. (Currently when I do a full charge it displays 94.8%.) Whereas a 2013 and newer Leafs will adjust the SOC so that it shows 100% after a full charge. This means you can't see the slow battery degradation via the SOC% figure.

to:

[Note: the SOC figure shown on this display is the same as is shown on LeafSpy, which is slightly different from that shown on the dash of the 2013 Leaf! This project displays raw SOC as reported by the EV-Can bus. In my case when I do a full charge it displays 94.8%. Whereas a 2013 Leaf (and newer) will adjust the SOC displayed so that it shows 100% after a full charge - even if you've lost battery capacity. This means you can't see the slow battery degradation reflected in the stock SOC% figure, but you can on the display from this project.]

17 October 2019 at 05:34 PM by 115.189.133.40 -
Changed line 86 from:
  • Rename variables in code so that rawGids = Gids value from EV-Can and rawSOC = SOC value from EV-Can
to:
  • Rename variables in code so that rawGids = Gids value from EV-Can and rawSOC = SOC value from EV-Can (currently the variable for Gids is called "Soc")
17 October 2019 at 05:32 PM by 115.189.133.40 -
Added lines 86-87:
  • Rename variables in code so that rawGids = Gids value from EV-Can and rawSOC = SOC value from EV-Can
Deleted line 93:
17 October 2019 at 05:28 PM by 115.189.133.40 -
Changed line 131 from:
        Soc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);
to:
        Soc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);      //Read "Gids" from EV-Can
Changed line 133 from:
        kWh = (((float)Soc) * KW_FACTOR) / 1000.0F;
to:
        kWh = (((float)Soc) * KW_FACTOR) / 1000.0F;   //Calculate kWh from Gids
Changed line 138 from:
        BattVolts = (rxBuf[2] << 2) | (rxBuf[3] >> 6);
to:
        BattVolts = (rxBuf[2] << 2) | (rxBuf[3] >> 6); // Read Volts from EV-Can
Changed line 140 from:
        Amp = (rxBuf[0] << 3) | (rxBuf[1] >> 5);
to:
        Amp = (rxBuf[0] << 3) | (rxBuf[1] >> 5);       // Read Amps from EV-Can
Changed line 143 from:
        kW = (Amps * BattVolts)/1000.0F;
to:
        kW = (Amps * BattVolts)/1000.0F;               // Calc instantaious kW from V*A
Changed lines 148-149 from:
        ActSoc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);
        ActSocPct = ActSoc / 10.0F;
to:
        ActSoc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);   // Read SOC from EV-Can
        ActSocPct = ActSoc / 10.0F;                   
17 October 2019 at 05:20 PM by 115.189.133.40 -
Deleted line 125:
17 October 2019 at 04:51 PM by 115.189.133.40 -
Changed lines 119-120 from:

Theoretically 1 Gid = 80 Wh but my car seems to be more like 74.8 Wh

to:

Theoretically 1 Gid = 80 Wh but others say 74.73 Wh

Changed lines 124-125 from:

/////////////////// GIDS and SOC and kWh remaining /////////////////////////////////////////////////

to:
  1. define MAX_SOC 281.0F
  2. define KW_FACTOR 74.73F // Some people prefer 80

////////////// ///// GIDS and SOC and kWh remaining /////////////////////////////////////////////////

17 October 2019 at 04:40 PM by 115.189.133.40 -
Deleted line 125:
Added line 131:
Deleted line 132:
Added line 141:
Deleted line 142:
17 October 2019 at 04:39 PM by 115.189.133.40 -
Changed lines 13-14 from:

Note: the SOC figure shown on this display is the same as is shown on LeafSpy, which is slightly different from that shown on the dash of the 2013 Leaf! This project displays the SOC as a percentage of a theoretical brand new battery (defined as 281 Gids)

to:

Note: the SOC figure shown on this display is the same as is shown on LeafSpy, which is slightly different from that shown on the dash of the 2013 Leaf! This project displays the SOC as a percentage of a theoretical brand new battery (defined as 281 Gids). In my case my real max is more like 235 Gids. (I may change my code to reflect this, so that a full charge is shown as 100%. (Currently when I do a full charge it displays 94.8%.) Whereas a 2013 and newer Leafs will adjust the SOC so that it shows 100% after a full charge. This means you can't see the slow battery degradation via the SOC% figure.

Changed lines 119-120 from:
to:

Theoretically 1 Gid = 80 Wh but my car seems to be more like 74.8 Wh

Some Code


/////////////////// GIDS and SOC and kWh remaining /////////////////////////////////////////////////

      if(rxId == 0x5bc) {
        Soc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);
        SocPct = (Soc / MAX_SOC) * 100.0F;
        kWh = (((float)Soc) * KW_FACTOR) / 1000.0F;
      }
////////////////// Voltage and current /////////////////////////////////////////////////////////////

      if(rxId == 0x1db) {
        BattVolts = (rxBuf[2] << 2) | (rxBuf[3] >> 6);
        BattVolts = BattVolts/2.0F;
        Amp = (rxBuf[0] << 3) | (rxBuf[1] >> 5);
        if(Amp & 0x0400) Amp |= 0xf800;
        Amps = -(Amp / (2.0F));
        kW = (Amps * BattVolts)/1000.0F;
      }
/////////////////// Actual SOC /////////////////////////////////////////////////////////////////////

      if(rxId == 0x55b) {
        ActSoc = (rxBuf[0] << 2) | (rxBuf[1] >> 6);
        ActSocPct = ActSoc / 10.0F;
      }
    }
  }


17 October 2019 at 03:56 PM by 115.189.133.40 -
Changed lines 13-14 from:
to:

Note: the SOC figure shown on this display is the same as is shown on LeafSpy, which is slightly different from that shown on the dash of the 2013 Leaf! This project displays the SOC as a percentage of a theoretical brand new battery (defined as 281 Gids)

Changed lines 112-113 from:
  • Max Gids: 281 Gids (In a 24 kWH 2011/2012 model Leaf)
to:
  • Theoretical Max Gids: 281 Gids (In a "24" kWH 2011/2012 model Leaf)
  • My Max Gids: 235 Gids (In my 17 kWH 2011 model Leaf)
17 October 2019 at 03:42 PM by 115.189.133.40 -
Changed lines 77-78 from:

//

to:


Added lines 110-115:

Gids

  • Max Gids: 281 Gids (In a 24 kWH 2011/2012 model Leaf)
  • Low Bat Warning: 49 Gids (Range starts flashing)
  • Very Low Bat Warning: 24 Gids {Range shows three dashes)
  • Turtle: 4 to 8 Gids
  • Car stops: when lowest cell voltage drops below some 3.? Volts
17 October 2019 at 03:28 PM by 115.189.133.40 -
Changed lines 77-78 from:

Todo:

to:

//

Todo

Changed lines 83-84 from:
  • Only start displaying numbers once they have been acquired (ie not zero, !=0 or > 0), Michelle looked at the display once at the start of driving and saw it was zero, so assumed it was broken and therefore did not look at it again. To avoid this user confusion itís best not to show zeros during the start up period.
to:
  • Remove start up screens. The CAN connection error page should stay on forever though.
  • Only start displaying numbers once they have been loaded from the CAN module , Michelle looked at the display when she started the car and saw it was zero, so assumed it was broken and therefore did not look at it again. To avoid this user confusion itís best not to show zeros during the loading period. [So only display digits when they are do not equal zero (if !=0 then display)]
Changed line 89 from:
  ** indicate Gids turtle, and dead points
to:
  ** indicate Gids turtle, and somehow indicate threshhold of turtle mode 
Changed lines 92-93 from:
  • Remove start up screens. The CAN connection error page should stay on forever
to:
  • Try larger and/or colour OLED display?
Changed lines 107-111 from:
  • Try larger and/or colour OLED display?
to:

Notes

17 October 2019 at 03:18 PM by 115.189.133.40 -
Changed lines 31-38 from:

Note: these links are to Aliexpress - if you want the items to arrive faster search for similar items on Amazon, EBay, TradeMe, etc.

to:

Note: these links are to Aliexpress - if you want the items to arrive faster search for similar items on Amazon, EBay, TradeMe, Banggood, etc.

Added lines 73-103:

Todo:

  • Swap for 1.3 inch OLED display (still 128 x 64 pixels but larger pixels so easier to see from the drivers seat distance
  • Only start displaying numbers once they have been acquired (ie not zero, !=0 or > 0), Michelle looked at the display once at the start of driving and saw it was zero, so assumed it was broken and therefore did not look at it again. To avoid this user confusion itís best not to show zeros during the start up period.
  • Low SOC mode - when SOC goes below 10%
    • show Lowest cell voltage
    • indicate Gids turtle, and dead points
    • show SOC to 2 decimal places
  • Remove start up screens. The CAN connection error page should stay on forever
  • Flip the Fleet mode: show data needed for Flip the Fleet from LeafSpy. Element are:
    • SOH (%, 2 decimal places)
    • Ahr (Ahrs, 2 decimal places)
    • Hx (%, 2 decimal places)
    • QCs (whole number)
    • L1/L2 charges (whole number)
    • mV spread (mV)
    • SOC (%, 2 decimal places)
    • Temp (degrees C, 2 decimal places)
  • Accurate speedo? - I think this is (only?) available on the Car-CAN bus
  • Try larger and/or colour OLED display?
17 October 2019 at 10:34 AM by 115.189.133.40 -
Changed line 11 from:

This project is based on CANa Display for Nissan LEAF which is beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

to:

This project is based on the CANa Display for Nissan LEAF project which is beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

17 October 2019 at 10:31 AM by 115.189.133.40 -
Changed line 7 from:

Most people just use the LeafSpy app on a phone to address this shortcoming. In my case the phone I was using stopped connecting to the Bluetooth dongle I had. I also did like that I needed to faff about with a phone to get his kind of basic information. The phone needs a special mount on the dash. It need to be kept charged, and the user interface on LeafSpy isn't great.

to:

Most people just use the LeafSpy app on a phone to address this shortcoming. In my case the phone I was using stopped connecting to the Bluetooth dongle I had. I also didn't like faffing about with a phone to get this basic information. The phone needs to be mounted on the dash, it needs to be kept charged, and the user interface on LeafSpy isn't great.

14 October 2019 at 11:15 PM by 203.97.97.117 -
Changed lines 53-55 from:

The Arduino is connected to the OLED display via another 5-pin SPI connection.

And that's about it.

to:

And that's about it. I'm assuming you already know how to get code onto the Arduino.

14 October 2019 at 11:14 PM by 203.97.97.117 -
Added lines 48-49:

Arduino code

14 October 2019 at 11:14 PM by 203.97.97.117 -
Changed line 14 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1024x349.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1024x349.jpg

14 October 2019 at 11:06 PM by 203.97.97.117 -
Changed line 31 from:

Note: these links are to Aliexpress - if you want the items to arrive faster search for similar items on your favourite "buy general stuff" site (ie Amazon, EBay, TradeMe, etc)

to:

Note: these links are to Aliexpress - if you want the items to arrive faster search for similar items on Amazon, EBay, TradeMe, etc.

14 October 2019 at 11:05 PM by 203.97.97.117 -
Changed line 14 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1920x653.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1024x349.jpg

14 October 2019 at 11:03 PM by 203.97.97.117 -
Changed line 14 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1920x653.jpg

14 October 2019 at 11:02 PM by 203.97.97.117 -
Changed line 14 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1920x653.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03.jpg

14 October 2019 at 11:00 PM by 203.97.97.117 -
Changed line 14 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-large-landscape.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-v03-1920x653.jpg

14 October 2019 at 10:56 PM by 203.97.97.117 -
Changed lines 14-15 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/LEAF-SOC-connection-diagram.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/Leaf-SOC-connection-diagram-large-landscape.jpg

Changed line 33 from:

[TODO - add circuit diagram]

to:
14 October 2019 at 10:49 PM by 203.97.97.117 -
Changed lines 13-14 from:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/LEAF-SOC-connection-diagram.jpg

to:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/LEAF-SOC-connection-diagram.jpg

14 October 2019 at 10:48 PM by 203.97.97.117 -
Added lines 12-13:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/LEAF-SOC-connection-diagram.jpg

14 October 2019 at 12:19 AM by 203.97.97.117 -
Changed line 11 from:

This project is based on CANa Display for Nissan LEAF which is a beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

to:

This project is based on CANa Display for Nissan LEAF which is beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

14 October 2019 at 12:19 AM by 203.97.97.117 -
Changed line 11 from:

It's based on CANa Display for Nissan LEAF which is beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

to:

This project is based on CANa Display for Nissan LEAF which is a beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

14 October 2019 at 12:16 AM by 203.97.97.117 -
Added lines 62-65:

Further reading

  • LEAF CANbus decoding
13 October 2019 at 11:58 PM by 203.97.97.117 -
Changed line 20 from:
  1. 7-way ribbon cable
to:
  1. 7-way ribbon cable
Added lines 27-28:

Note: these links are to Aliexpress - if you want the items to arrive faster search for similar items on your favourite "buy general stuff" site (ie Amazon, EBay, TradeMe, etc)

13 October 2019 at 11:54 PM by 203.97.97.117 -
Changed lines 15-16 from:
  1. DC/DC 10-16V to 5V step down power converter
  2. NiRen MCP2515_CAN bus board 8MHz
to:
  1. 10-16V to 5V DC-DC step down Buck converter
  2. NiRen MCP2515_CAN bus board 8MHz
Changed lines 18-19 from:
  1. OLED display 128x64 pixel 1/3 inch monochrome OLED display
  2. OBD2 plug
to:
  1. OLED display 128x64 pixel 1/3 inch monochrome OLED display
  2. OBD2 plug (male)
Added lines 21-22:
  1. 40 Pin 2.54 mm Right Angle Single Row Pin Header Male
  2. Dupont-style jumper wires
Added lines 25-27:

Optional:

  • OBD2 Splitter Extension Cable
Added lines 29-32:
13 October 2019 at 11:33 PM by 203.97.97.117 -
Changed line 17 from:
  1. Arduino Pro Mini 328, 5V/16MHz version [I used a CH340 UART Serial Converter Cable to program the Arduino. Alternatively you could use a Arduino Pro Micro which has built in USB communications)
to:
  1. Arduino Pro Mini 328, 5V/16MHz version [I used a CH340 UART Serial Converter Cable to program the Arduino. Alternatively you could use a Arduino Pro Micro which has built in USB communications)
13 October 2019 at 03:49 PM by 203.97.97.117 -
Changed line 7 from:

Most people just use the LeafSpy app on a phone to address this shortcoming. In my case the phone I was using stopped connecting to the Bluetooth dongle I had. I also did like that I needed to faff about with a phone to get his kind of basic information. The phone needs a special mount on the dash. It need to be kept charged, and the user interface on LeafSpry isn't great.

to:

Most people just use the LeafSpy app on a phone to address this shortcoming. In my case the phone I was using stopped connecting to the Bluetooth dongle I had. I also did like that I needed to faff about with a phone to get his kind of basic information. The phone needs a special mount on the dash. It need to be kept charged, and the user interface on LeafSpy isn't great.

13 October 2019 at 03:48 PM by 203.97.97.117 -
Changed line 5 from:

The first generation Leafs did not show the battery State of Charge accurately on the dash. There's the 12 blue bars on the right by the ragne estimate but that's all. After 2012 they added a SOC% feature to the main dash. This project replicates that feature.

to:

The first generation Leafs did not show the battery State of Charge accurately on the dash. There's the 12 blue bars on the right by the range estimate but that's all. After 2012 they added a SOC% feature to the main dash. This project replicates that feature.

13 October 2019 at 03:47 PM by 203.97.97.117 -
Changed line 42 from:

! Installation

to:

Installation

13 October 2019 at 03:47 PM by 203.97.97.117 -
Changed line 42 from:

Installation !

to:

! Installation

13 October 2019 at 03:46 PM by 203.97.97.117 -
Changed line 42 from:

Installation

to:

Installation !

13 October 2019 at 03:46 PM by 203.97.97.117 -
Changed line 21 from:
  1. a plastic box to house the Pro Mini and
to:
  1. a plastic box to house the electronic bits
13 October 2019 at 03:44 PM by 203.97.97.117 -
Added lines 2-3:

http://www.myonlinediary.com/nissan-leaf/SOC_OLED/CAN_OLED_display-sm.jpg

13 October 2019 at 03:32 PM by 203.97.97.117 -
Changed lines 46-52 from:
to:

I also used a craft knife to trim 1mm off edge of the dash to allow the 7-wire ribbon cable to exit cleanly. Clip the dash front back on thread the ribbon cable down past the lower dash.

Next you'll want to remove the lower dash panel, see Nissan Leaf 020 - ETC replacement options. Once that's open you can attach the OLED ribbon to the Arduino and zip-tie the electronic modules (in a plastic box maybe) somewhere where they won't rattle and then connect the OBD2 plug to the socket.

I hope you found this helpful.

Cheers, Paul

13 October 2019 at 03:12 PM by 203.97.97.117 -
Changed line 44 from:

To install the display inside the dash you'll need to remove the dash and unclip the clear plastic front. See https://www.youtube.com/watch?v=APLyLvfSme4 for an explanation of how to remove the dash.

to:

To install the display inside the dash you'll need to remove the dash and unclip the clear plastic front. See Nissan Leaf Instrument Cluster Removal for an explanation of how to remove the dash.

13 October 2019 at 03:11 PM by 203.97.97.117 -
Changed lines 42-44 from:
to:

I chose to install the OLED display over the top of the efficiency trees on the Leaf's "eyebrow" dash. The trees don't serve a critical function so it's no great loss. I stuck a piece of wide black electrical tape over the trees, then used double sided tape to stick the OLED display onto the black tape. (Note: electrical tape is usually easy to remove so you could remove all this if you needed to.)

To install the display inside the dash you'll need to remove the dash and unclip the clear plastic front. See https://www.youtube.com/watch?v=APLyLvfSme4 for an explanation of how to remove the dash.

13 October 2019 at 03:01 PM by 203.97.97.117 -
Changed lines 35-42 from:

The Arduino is connected to teh OLED diiplay via another 5-pin SPI connection.

to:

The Arduino is connected to the OLED display via another 5-pin SPI connection.

And that's about it.

Installation

13 October 2019 at 03:00 PM by 203.97.97.117 -
Changed line 15 from:
  1. Arduino Pro Mini 328, 5V/16MHz version [I used a CH340 UART Serial Converter Cable to program the Arduino. Alternatively you could use am Arduino Pro Micro which has built in USB communications)
to:
  1. Arduino Pro Mini 328, 5V/16MHz version [I used a CH340 UART Serial Converter Cable to program the Arduino. Alternatively you could use a Arduino Pro Micro which has built in USB communications)
13 October 2019 at 02:59 PM by 203.97.97.117 -
Changed lines 5-42 from:

It's based on CANa Display for Nissan LEAF.

to:

Most people just use the LeafSpy app on a phone to address this shortcoming. In my case the phone I was using stopped connecting to the Bluetooth dongle I had. I also did like that I needed to faff about with a phone to get his kind of basic information. The phone needs a special mount on the dash. It need to be kept charged, and the user interface on LeafSpry isn't great.

So my goal is to have a SOC display integrated into the dash with no extra fiddling about. It should just turn on when the car does and require zero effort on my part.

It's based on CANa Display for Nissan LEAF which is beautifully simple and straightforward. All I've done is change the code to make it work with a nice OLED display that will fit inside the eyebrow dash. It is powered by the OBD2 port in such a way that it only works when the car is turned on. [Note: the dongles that are used with LeafSpy run 24/7 unless you manually turn them off - which is a security risk.]

Parts list

  1. DC/DC 10-16V to 5V step down power converter
  2. NiRen MCP2515_CAN bus board 8MHz
  3. Arduino Pro Mini 328, 5V/16MHz version [I used a CH340 UART Serial Converter Cable to program the Arduino. Alternatively you could use am Arduino Pro Micro which has built in USB communications)
  4. OLED display 128x64 pixel 1/3 inch monochrome OLED display
  5. OBD2 plug
  6. 7-way ribbon cable
  7. a plastic box to house the Pro Mini and

[TODO - add circuit diagram]

Circuit description

Power for the system is provided from the OBD2 port - pin 4 (ground) and pin 8 (switched +12 from battery). Note pin 8 is a switched +12 on the Leaf. The OBD2 standard power is on pin 16 - but it's always on 24/7.

The power goes straight into a step down module that provides 5V for everything; the MCP2515_CAN, the Arduino Pro Mini and the OLED display.

The CAN bus signals come from OBD2 pins 12 and 13. The OBD2 standard CAN bus signals are on pins 6 and 14. On a Leaf those provide the Car-CAN bus, whereas pins 12 and 13 provide the EV-CAN bus.

The EV-CAN signals go into the MCP2515_CAN module - which is connected to the Arduino via 5-wire SPI.

The Arduino code is: SOC_OLED_v12 Version 12, 13 October 2019

The Arduino is connected to teh OLED diiplay via another 5-pin SPI connection.

13 October 2019 at 02:10 PM by 203.97.97.117 -
Added lines 1-5:

SOC display for 2011 Nissan Leaf

The first generation Leafs did not show the battery State of Charge accurately on the dash. There's the 12 blue bars on the right by the ragne estimate but that's all. After 2012 they added a SOC% feature to the main dash. This project replicates that feature.

It's based on CANa Display for Nissan LEAF.


Page last modified on 18 November 2019 at 10:53 AM