Make Nissan Leaf Gen3 adapter board

Create a thread for each item that needs working on by the community
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Make Nissan Leaf Gen3 adapter board

Post by johu »

I would like to have an adapter board for Gen3 inverters based on mini mainboard: https://openinverter.org/wiki/Mini_Mainboard

Currently I can't find the time to work on it myself, so was wondering if someone likes to give it a shot? Ideally this would be done in KiCAD.

I have written to Kelju whether I can publish his prior work, if so, I will post it here.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

Attached is schematic from adapter board. There are some mistakes on it, will comment on the corrections later
Attachments
Leaf_Gen3_Adapter_A11.pdf
(25.27 KiB) Downloaded 220 times
20201112 NISSAN LEAF 2018 INVERTER CONTROL PINOUT.pdf
(86.49 KiB) Downloaded 228 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Mouse
Posts: 138
Joined: Wed Sep 25, 2019 8:17 am
Location: Wales
Been thanked: 7 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by Mouse »

Hi,
I use Kicad and an adapter board shouldn't be that taxing.
Also a good opportunity to give something back to the project.

I can send / post up photos of past work if needed.
SRFirefox
Posts: 28
Joined: Thu Jun 25, 2020 2:28 am

Re: Make Nissan Leaf Gen3 adapter board

Post by SRFirefox »

Do you have dimensions for connector and mounting placement? Or a Gen3 mainboard for reference. I'd be happy to do the layout for this board as well.
User avatar
GTeV
Posts: 16
Joined: Fri Dec 16, 2022 3:16 am
Has thanked: 7 times
Been thanked: 4 times

Re: Make Nissan Leaf Gen3 adapter board

Post by GTeV »

I have none of the requisite skills to help build or design this, but I do have a full set of Gen3 160kw components so I'd be happy to test when it gets to that stage.
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

**edit** It's recommended to see the Wiki for this gen 3 Leaf adapter board. It is here, https://openinverter.org/wiki/Nissan_Le ... 8_up_EM57) All info should be there.
johu wrote: Tue Mar 29, 2022 7:53 pm Attached is schematic from adapter board. There are some mistakes on it, will comment on the corrections later
Is this completed? If it's not, I'll take it on.

I don't see a list of the schematic errors. This too,
SRFirefox wrote: Thu Jun 02, 2022 9:29 pm Do you have dimensions for connector and mounting placement? Or a Gen3 mainboard for reference. I'd be happy to do the layout for this board as well.
A picture or preferably a scan of a gen3 main board could work for the connector.

Anyone happen to have a Kicad footprint of the openinverter connection they can share?
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

Cool :)

The i3 board uses the mini mainboard. It's just two 20-pin 0.1 in headers

Scanned the board in 300 dpi

Also attached two pictures.
The new design should be based on the mini mainboard as it is smaller, cheaper and lower profile. Also it should use the ESP32 directly soldered to the board.

Now the changes that were made:
- Correction of wifi module pins
- mprot pulled up to 12V
- removed the line driver, the STM32 can directly drive the PWM channels in open collector mode
- connected 5V to the inverter connector pin 7, 8, 9
Attachments
1694623068910.jpg
1694623068901.jpg
Gen3 Nissan.png
BMW-i3-adapter-kicad.zip
(794.9 KiB) Downloaded 36 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

@johu, would you be able to measure the mounting hole dimensions? (sorry, forgot..)

Any idea on the Nissan connectors specs / footprints on the adapter board?

For the fixes, are those specific to the leaf gen3 inverter?
Any issues with the i3 adapter you shared as is?

JP1 & JP2 were swapped on a different board (Nissan gen 2?) Is that an issue with the i3 design?

Thanks for doing the legwork on this stuff.
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

I started a Gen 3 leaf page in the wiki https://openinverter.org/wiki/Nissan_Le ... 8_up_EM57) but I'm having a hard time finding some info.

Questions I have so far working on this adapter board.

Info needed:
- can someone measure 2 screw holes for me? I can scale Johu's scan image but need a length reference. Any will do but all screw holes and the 2 alignment pin locations would be appreciated.
- Is there a list of pin outs for the 2 Nissan connectors on this adapter board? The round connector pin out is for connecting to the inverter, that makes sense to be in the wiki but doesn't do much for making this board. I have the early attempt designspark schematic pdf, can I trust it?
- Anyone have the part #s / footprints for the Gen 3 Nissan connectors required?
Leaf Gen 3 Connectors.PNG

Design questions:

- Does it make sense to have the mini main board be separate? Worth pulling everything into 1 board?
- The 6 fet driver lines do not seem to have pull downs on them in the adapter board or the mini main board. Catphish had this note for the Tesla boards, https://github.com/damienmaguire/Tesla- ... t/issues/7 I think these pull downs should be added here as well unless they will be added to the mini main board...
- In the same logic / safety thinking I believe we should also add pull downs for the pre-charge and battery contactor fets.

Anyone have some design input / info for the above?
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

I'm pretty rubbish at measuring, all I can tell you is the board is scanned with 300 dpi.
Does it make sense to have the mini main board be separate? Worth pulling everything into 1 board?
Personally I prefer to do the complicated routing only once plus I can order a larger quantity of generic mini mainboards to get me through the next chip crisis (let's hope there isn't one any time soon)
The 6 fet driver lines do not seem to have pull downs on them in the adapter board or the mini main board
These operate opto couplers directly by pulling them to GND, so pull-down is not what you want ;) Plus it requires significant current to trigger them. That's why I prefer NOT to have a separate driver chip with super sensitive inputs that act like an amplifier.
In the same logic / safety thinking I believe we should also add pull downs for the pre-charge and battery contactor fets.
Agreed, plus gate resistor, plus TVS across drain-source and as catphish prefers even across gate source.
EDIT: I prefer not to have freewheeling diodes with cathode on 12V on board as in some setups they will reverse power the circuit
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Sat Sep 23, 2023 8:13 pm I'm pretty rubbish at measuring, all I can tell you is the board is scanned with 300 dpi.
I'll scale it from the connector lengths and work from there. I'll make a pdf of the board to print @ 100% and we will have someone try it before fab.

Personally I prefer to do the complicated routing only once plus I can order a larger quantity of generic mini mainboards to get me through the next chip crisis (let's hope there isn't one any time soon)
Understood. I made a Kicad footprint & symbol for the mini mainboard to help simplify future adapter board work.

These operate opto couplers directly by pulling them to GND, so pull-down is not what you want ;) Plus it requires significant current to trigger them. That's why I prefer NOT to have a separate driver chip with super sensitive inputs that act like an amplifier.
I'm glad I asked. Thanks for connecting the opto dots!

Agreed, plus gate resistor, plus TVS across drain-source and as catphish prefers even across gate source.
EDIT: I prefer not to have freewheeling diodes with cathode on 12V on board as in some setups they will reverse power the circuit

Thanks for mentioning the freewheeling diode note.
Mini mainboard looks to have 470 ohm gate resistors inline already,
gate resistors.PNG
The rest I will add.


Johu, do you have any raw pcb's / gerber files with the Nissan connector footprints? I can scale those too but I don't know what they look like under the plastic / pins.
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

If someone has a gen 3 leaf inverter and is willing to check fitment, please print whichever of these pdf's fits your paper size.

Things I'm asking for help to verify (I don't have one of these inverters):
verify.PNG
- The 5 holes and 1 slot all line up at the same time. If they don't line up, please line up the bottom left mounting hole, center the top left mounting hole on the line, and take pictures of the other holes.
- Board edges are close with holes aligned.
- if after those are verified cut your print along the red lines and across the terminals of the connectors. This should give a nice reference to use to check pin width and pin spacing for the 2 connectors.

The above will help verify the mounting & locating holes are in the correct places and will help me draw up footprints for the connectors.

If there is some pin numbering on the connectors that you could share it would help a bunch.
Attachments
Early Gen 3 Leaf Adapter Board A4.pdf
(26.54 KiB) Downloaded 43 times
Early Gen 3 Leaf Adapter Board 8.5X11.pdf
(26.48 KiB) Downloaded 52 times
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Wed Sep 13, 2023 4:25 pm
- connected 5V to the inverter connector pin 7, 8, 9
789 5v.PNG
I could only figure that you meant the blob of solder on the above.

So 28, 13, 29 get 5v?

Can you confirm that's what you meant in the picture above?
and left row is connector pins bottom, right is connector pins top and lined up in order?
and the 40 position connector is setup the same?

Edit, found a picture of the Nissan controller (credit boekel @ electric car forum) that was clear enough to see pin labeling.
2018 Nissan Leaf Inverter Controller.jpg
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

Just tested on mine and it fits perfectly.
Trying to remember why I connected 5V to 3 pins not just the one that Kelju marked out. Reading here: viewtopic.php?t=980

Here's something on the 5V viewtopic.php?p=23161#p23161
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Mon Sep 25, 2023 7:22 am Just tested on mine and it fits perfectly.
Thanks for checking the board.

Were you able to check the connector pin spacing?

Trying to remember why I connected 5V to 3 pins not just the one that Kelju marked out. Reading here: viewtopic.php?t=980

Here's something on the 5V viewtopic.php?p=23161#p23161
I went through all of that but did not find anything definitive.
32pin 5v.png
From this image of the 32 pin connector I can see terminals 5, 12, 15, 21 are empty. It looks like positions 31 and 29 are empty as well. From what I'm seeing pin 13 is missing something and also not labeled in Kelju's schematic. Its a grey wire like pin 28, so I think that's 1 missing 5v.

I'll make sure 5v is where it should be on the adapter board, kind of sounds like this may have been an issue from your link / previous digging. Maybe one of the tiny fuses blew during testing?

Thinking of fuses, you want all the fuses on the adapter board removed, (from Kelju's design) correct?
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Wed Sep 13, 2023 4:25 pm Now the changes that were made:
- Correction of wifi module pins
Swapped this to the ESP32 Wroom, copied the V6 / V8 Tesla boards. Or did this mean something else?

- mprot pulled up to 12V
This is confusing me. In the mini mainboard there's this,
PA3 MPROT pulled up to +12V.PNG
PA3 is MPROT but it does not go to either of the 20 pin connectors to get out of the mini mainboard, looks like it was dropped going to the mini.

v3.4 has it,
MPROT ADC3 PA3.PNG
Does this just need a 12v pullup for the rest of the inverter to run and the mini mainboard ignores MPROT?

Sorry for all the questions. Referencing Kelju's work, mini mainboard, v3.4 mainboard, bmw adapter, and tesla stuff for the ESP32.

Has anyone considered using something like a R-2R resistor ladder network on the adapter board to set an address (specific voltage) for the adapter board / mainboard settings?
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

jrbe wrote: Tue Sep 26, 2023 7:44 pm Swapped this to the ESP32 Wroom, copied the V6 / V8 Tesla boards. Or did this mean something else?
Yes perfect.
jrbe wrote: Tue Sep 26, 2023 7:44 pm This is confusing me. In the mini mainboard there's this,
PA3 MPROT pulled up to +12V.PNG
PA3 is MPROT but it does not go to either of the 20 pin connectors to get out of the mini mainboard, looks like it was dropped going to the mini.
Indeed mprot is no longer brought out on the mini mainboard, it is just used locally to measure uaux.
Only emcystop is left as a hardware shutdown pin. You can either pull it high or bring it out on the header with a cuttable solder-jumper that can be opened in case someone wishes to use emcystop.
jrbe wrote: Tue Sep 26, 2023 7:44 pm Has anyone considered using something like a R-2R resistor ladder network on the adapter board to set an address (specific voltage) for the adapter board / mainboard settings?
Yes, thought about, never done ;) So software will just detect it as Rev3 mainboard. That's actually ok for the Nissan board as there is no special handling. But on the upcoming Prius board some special Prius code won't be run because of lack of detection. Would need to devote one pin to that so one functional pin would have to go.
Alternatively a "variant" parameter must be introduced.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Wed Sep 27, 2023 8:07 am Indeed mprot is no longer brought out on the mini mainboard, it is just used locally to measure uaux.
Only emcystop is left as a hardware shutdown pin. You can either pull it high or bring it out on the header with a cuttable solder-jumper that can be opened in case someone wishes to use emcystop.
Thanks for the background on that. I'll pull it out as a test point and add a shorted solder jumper.

R-2R network address..
Yes, thought about, never done ;) So software will just detect it as Rev3 mainboard. That's actually ok for the Nissan board as there is no special handling. But on the upcoming Prius board some special Prius code won't be run because of lack of detection. Would need to devote one pin to that so one functional pin would have to go.
Alternatively a "variant" parameter must be introduced.
So 2 analog pins with a 4 resistor R-2R network for each should cover it? I'll look for a spot on the mini main board where a connector for this might fit and add an unpopulated footprint for it on this adapter board.

I found this looking up what others are doing for pre and main contactors. Seems some are struggling with an early, unintended pulse. Is this still an issue?
A few snips from viewtopic.php?p=41435&hilit=Economizer#p41435
Hm... i think you could put one pullup resistor on each relay channel that would keep it off untill high enough signal would appear. Try experimenting with resistor values. I bet 1k pullup will do the job.
E46Driver wrote: Wed Jun 22, 2022 4:10 pm I tried 10K and 5K. Never went as low as 1K.
johu wrote: Sat Jun 18, 2022 9:36 am Do you have the newer Leaf board with Mini mainboard? Then you could add some significant capacity between gate and source of the corresponding mosfet. On the V3 mainboard version you could do the same modification as DC switch is also on a mosfet. Not sure about the value, maybe 10uF
I currently have a 10k pull down on the contactor mosfet gates. Mosfets are 1-2V vgs(th) range. Mosfet I currently have is a LCSC C3017, Infineon IRLR3410TRPBF. I couldn't see / find the mosfet # on the i3 board.
I added clearanced handsolder footprints for gate pull down & capacitor for each. I'll plan for around a .5 to 1 second delay range. I'll do the math and populate them and correct the 10k pull downs if necessary.
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

I added early pin initialization to the boot loader, so not sure if the glitches are still a thing.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

jrbe wrote: Wed Sep 27, 2023 1:19 pm So 2 analog pins with a 4 resistor R-2R network for each should cover it? I'll look for a spot on the mini main board where a connector for this might fit and add an unpopulated footprint for it on this adapter board.
Just thought about a backward compatible solution. Pin "out_brake" is connected to PC5 which is also an analog input. So at startup I could briefly activate its internal 30k pull-up to 3V3 and measure the voltage. So when you install a pull-down resistor on out_brake the read-back value won't be 4095 but something lower. With 1k steps the adapter board variant could be encoded plus the original function of the pin can still be retained if needed. What do you think?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Thu Sep 28, 2023 8:42 am Just thought about a backward compatible solution. Pin "out_brake" is connected to PC5 which is also an analog input. So at startup I could briefly activate its internal 30k pull-up to 3V3 and measure the voltage. So when you install a pull-down resistor on out_brake the read-back value won't be 4095 but something lower. With 1k steps the adapter board variant could be encoded plus the original function of the pin can still be retained if needed. What do you think?
It's hard to juggle new features with existing hardware. Sometimes the trade offs you make to try to keep old hardware relevant can cripple future progress. I'm not very familiar with openinverter's feature set / history so I'll add some downsides that might be relevant, questions to hopefully think through this, & ideas:

Downsides I see:
- How consistent is the 30k pull up? From past experience with other chips they might have a large tolerance that would make this reading too inconsistent. Looking quick it looks to be a 30k - 50k "equivalent resistor." That might take this out by itself.

-if brake out is used it will likely have some extra resistance to skew the reading. Hard to know what it would be / what people do.

-if the connection is really bad it could be read as the wrong board.
Could it be disastrous if set wrong?

--Would you feel better with smd dip switches on the universal main boards / resistor dividers on the dedicated boards?

Resistance I've hit so far looking into it:
- JLC doesn't carry R-R2 resistor networks. Can use a few resistor networks / arrays in its place. Could purchase parts too but that's a pita. JLC is also out of some of the arrays used in the mini mainboard. Their ever revolving in stock / out of stock is challenging.

Pros I've found:
-looks like you have a few extra pins on the STM32 in the mini mainboard (if they don't have a complicated history / other uses elsewhere..) I did not check other boards yet. I really like this route because if you haven't used these pins in the past / other boards you could enable a pull up / pull down / no pull routine to check if the pins are connected to anything. From that you'd get old hardware that needs configuring or new, addressed hardware.
-Do you have a STM32 pin assignment history to check that we're not crippling old hardware / unnecessarily complicating code to work around a new feature?

-Seems to be room on the mini mainboard for some components for this addressing and to drop to the adapter boards with a header if desired. I haven't checked other adapter boards yet.

Sometimes I know enough to be dangerous but I'm not aware of mistakes I'm making. I'm not sure how many errors are coming over from the first prototype. My plan was to post the schematic here and crowdsource people checking it. I have 16 traces left to route but expect some rework. Basically thinking this will likely be a prototype.
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

2nd post for where I am with this.

Adapter board so far:
I chose to go 4 layer because of how tight this is and the original design reference images. Bottom layer is connected to the 4 mounting holes along with the plane ring around the outside on top like the Nissan board. Inductor footprints around the outside, will set them to dnp. Should make for a nice shield.

I did mostly 0805 sized components so they can be swapped if necessary. Also this still has some 0R resistors where they were in the original. Can drop these once we know things are working / connected correctly. Some unknowns still there.

Added solder jumper CAN resistors on the adapter board. 60ohm - 4.7uF to gnd - 60ohm with a solder jumper for each resistor to can lines. If this is the can end point it should help people use CAN correctly, easily, & filter some noise which will hopefully reduce struggles across the disciplines & forum support. Footprint for a can TVS right next to Nissan connector too.

I drew up the Nissan connectors but the dxf / footprint looks off from the first attempt board. I copied the same sketch / dxf, not sure how it happened or if it's an issue yet.
I also extended the pads to help with hand soldering.

I have the 2x05 old WiFi / comm header in currently. Not sure of use cases people might have for it. Planned to just leave this unpopulated.

I set the ESP32 boot delay R & C to the commonly recommended 10k resistor & 1uF. Not sure how / why 4k7 / .1uF was chosen but can easily switch back.
Also added the 499R inline to esp32 TX line from the datasheet "to filter 80mhz harmonics".

Broke out unused pins on a 2x05 footprint with labels.

I added notes in the schematic on what pin names were to help cross reference the mini main board and Kelju's schematic.

Added short traces with vias off the unterminated Nissan connector pins if we need to connect something along with a 4 pin header top right.

I have some cleanup to do before asking for others to check it. I'll hopefully post it in the next few days.
20230928_091139.jpg
If anything jumps out to anyone please feel free to pick it apart with some ideas how to fix it.

I think I'm moving the contactor fets to the top right and moving stuff up top to the left to make room.
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

I would love for someone or a few people to look this over, done in KiCad 6. I think I'm done besides cleaning up part numbers, checking the dip switch footprint, rotations, gerbers, etc. I feel like I can't see straight at this point.

I added an 8 pos. dip switch. Could potentially have all 8 on one analog pin but it starts to get tight. Need to discuss implementing this, if its on the mini mainboard or adapter boards, and implementing it elsewhere if it makes sense to keep it. Thinking is the dip switch can go away once addressing is defined, or half could go away to leave 4 option settings if it helps, or switch to solder jumpers.
To make the R-2R thing work with JLC inventory its 3 components instead of the 1 R-2R for 4 positions, so 6 components + dip switch, 2 analog pins. There's an unused position on one of the resistor arrays, I shorted across the resistor to make routing cleaner and easier, I know this will likely throw anyone looking for a loop. Blue circle and blue T shape. Schematic is ugly because its all squished on one page.
R-2R.PNG
R-2R easy footprint.PNG
There's a separate 20k resistor (R11) like R1 below. Doing this,
R-2R what.PNG
The connector pokes through in a decent spot on the i3,
i3.PNG
mini mainboard,
mini mainboard.PNG
and this Gen 3 leaf board.
leaf gen 3 adapter board.PNG
Definitely need to verify the 32 & 40 pos. Nissan connector footprints too.

Please critique, ask why did you... poke fun, whatever. A bunch of other info in the few previous posts too.
johu wrote: Wed Sep 27, 2023 6:09 pm ...
Just tagging you johu. Where / how do you want this posted?
User avatar
johu
Site Admin
Posts: 5588
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 148 times
Been thanked: 927 times
Contact:

Re: Make Nissan Leaf Gen3 adapter board

Post by johu »

The adapter board is looking good.
I'm not a large fan of electro-mechanical elements in "challenging" environments (so dip switches or trimmers).

One last attempt to make this backwards-compatible and omit the extra pins. Maybe first we should clarify the goal - we want the software to be able to detect which adapter board it is running on, right?

So you could just connect a high-impedance voltage divider to brake_out that SW could read at startup and then switches the pin to output. The brake light will be too slow to actually light up, should the coded voltage be above FET threshold.

So you could have 47k pull-up to 3V3 or 5V if more convenient and variable pull-down for each adapter board variant forming a voltage divider. The lowest one would be 2k7 to not interfere with the 220R series resistor.
So there could be these steps (assuming 5V pull-up)
2k7 - 0.27V - 337 ADC digits
3k3 - 407 digits
4k7 - 564 digits
6k8 - 783 digits
8k2 - 912 digits
10k - 1088 digits

and so on up to 82k. I think this should allow for enough variants and have sufficient distance between the codes to not mis-detect.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jrbe
Posts: 243
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 80 times
Been thanked: 58 times

Re: Make Nissan Leaf Gen3 adapter board

Post by jrbe »

johu wrote: Sun Oct 01, 2023 6:42 am The adapter board is looking good.
I'm not a large fan of electro-mechanical elements in "challenging" environments (so dip switches or trimmers).
I was thinking this first batch would be a prototype and the dip switches would make testing code convenient. My replies are very wordy though. I understand your hesitation here for production.

Older posts,
jrbe wrote: --Would you feel better with smd dip switches on the universal main boards / resistor dividers on the dedicated boards?
jrbe wrote: Thinking is the dip switch can go away once addressing is defined, or half could go away to leave 4 option settings if it helps, or switch to solder jumpers.
We're mostly on the same page with this.

johu wrote: we want the software to be able to detect which adapter board it is running on, right?
Agreed.

So you could just connect a high-impedance voltage divider to brake_out that SW could read at startup and then switches the pin to output. The brake light will be too slow to actually light up, should the coded voltage be above FET threshold.
I think I wrapped my head around this now. At the worst you might get a brake light flicker if they're leds.
But if the divider voltage ends up above the fet threshold the brake lights never turn off, right? Or is this output held low until brakes turn on? Strong enough to pull the divider below fet turn on?

So you could have 47k pull-up to 3V3 or 5V if more convenient and variable pull-down for each adapter board variant forming a voltage divider. The lowest one would be 2k7 to not interfere with the 220R series resistor.
So there could be these steps (assuming 5V pull-up)
2k7 - 0.27V - 337 ADC digits
3k3 - 407 digits
4k7 - 564 digits
6k8 - 783 digits
8k2 - 912 digits
10k - 1088 digits

and so on up to 82k.
I'm completely open to whichever way you'd like this to go. I'm not sure if you want to do testing or if you know this will work with the rest of the brake circuit connected. I'm not familiar enough to know how this will work with everything connected. I think there will be some unexpected results at the low, high, and fet turn on ranges.
**edit** and whatever circuitry the end user adds to potentially skew the reading.

If you think this needs testing I can add unpopulated voltage divider circuit footprints to the adapter board.
And separately I can make a simple R-2R circuit & separate weighted/stepped resistor circuit pcb for testing if it helps. Can do dip switches and solder jumpers to make testing easy. I can skip all this if you'd rather just breadboard it.

I have all unused pins on this adapter board broken out to vias or headers to make testing, measuring, modifying, etc. easy.
Post Reply