Advice needed to eliminate EMI noise with teensy 4.1

DavidG.

New member
I have 6 inputs and 8 outputs that are isolated using ild213 optocouplers and the emi is affecting all of the inputs and 1 output. I'm using 2s LiPo battery that powers the external circuits. All of the pin modes are input_pullup. No extra pull up resisters were used and i haven't added capacitors any where. The environment is a VW beetle drag car with a multispark MSD ignition that is causing the EMI. The teensy is enclosed in metal container . I'm using separate battery for car and teensy. I thought by using insulated cables to all the switches and relays through the optocoupler circuits would eliminate the noise but it's no better than without them..maybe even worse.

I connect via WiFi to a esp32s3 chip that is wired to Serial2 on the Teensy.
The optocouplers are on a separate pcb.
The esp32 handle some data collection besides operating as bridge.
I'm using Arduino IDE 2.3.5, Teensy 4.1

Someone please help me!
 

Attachments

  • Enclosure.jpg
    Enclosure.jpg
    189.1 KB · Views: 58
  • SideView.jpg
    SideView.jpg
    173.3 KB · Views: 59
  • TopView.jpg
    TopView.jpg
    252.5 KB · Views: 54
  • LabRat-library.zip
    10.4 KB · Views: 39
  • Sketch.zip
    11.6 KB · Views: 25
Last edited:
In a very noisy environment try something like 2k2 pullup resistors for the inputs - the INPUT_PULLUP internal pullups are super-weak. You probably need good ferrites on all the cables to that box if its to be effective. Also a painted box is unlikely to have good (or any) electrical connection between lid and the box, leaving it electrically open-topped (despite what you might naively think). Good bare-metal contact _all round_ the lid would be needed for effective shielding, preferrably with RF gasket material to really ensure solid contact.

But yes, curing the interference at source with shielded plug leads is a good place to start, but cars have plenty of other sources of EMI and usually __very__ unclean power rails.
 
Thanks to all who responded!

EMI is still messing with the inputs after installing 8.5mm plug wires with high EMI suppression (MSD-31189) and changing pin mode to INPUT_PULLDOWN and added 1k pulldown resisters to all inputs on the teensy. I'm using 7.4v LiPo to power the ild213 Emitters and the buttons/switches ground the ild213 collectors. I'm currently using USB power for teensy from a PC for testing.

I wrote a sketch that attaches interrupts to the input pins for change and prints out the pin number in the ISR routines. The MSD ignition is multi-spark below 3k rpm and that is when the EMI is noticed. I don't see EMI after revs pass 3k. I haven't removed the paint yet from the bottom metal container, so gonna do that and add EMI tape to seal the container. I also thought about stepping voltage up to 12v to power the external input circuits. It's not easy for me to believe that the EMI is grounding the ild213 collector. Maybe adding pull up resisters to the ild213 collectors? I have ferrites I can add but I believe I will simply unhook the input cables and see if EMI is coming in in the external cables. I have shielded cables but not twisted, changing to twisted pairs could help. I talked to my engine guy and he said NO to resister plugs on my little air cooled turbo.

Using AI hasn't performed the magic I was hoping for. I've been reworking this project for months using ideas form AI. I'm done with that.
 

Attachments

  • WatchPins.zip
    3.4 KB · Views: 28
Last edited:
EMI can be tricky. You are using a metal enclosure, which is good. Not sure about the connection to that press fit lid though.

But every wire that penetrates that enclosure is a path for EMI. Sure you apply filters/protection before it gets to the sensitive circuit but they can still couple to everything inside that enclosure. The traditional way to mitigate this is the feedthrough capacitor.

Henry Ott's book on noise reduction is a good reference.

AI: idiot pattern matcher.
 
Back
Top