0
\$\begingroup\$

I have a simple circuit just with LCD and MCU that writes text to it, something similar to this:

enter image description here

This picture is extremely simplified, the PIC has no unconnected pins in reality. This is the display I use: https://www.winstar.com.tw/products/character-lcd-display-module/dot-matrix-lcd.html

This display has few pins for power and contrast, then 2 control pins (RS and enable) and 8 data pins, but only 4 are used. I pulled the remaining pins down through resistors just to ensure some noise is not getting on them.

The problem I have is simple - whenever I start a 5V DC motor nearby - it doesn't even have to be part of this circuit, just being nearby to it is enough, the display gets full of garbage text. When motor is off, I can send initialization sequence from MCU to it again and it will reset and start showing normal text again. It's clearly picking up some EMI noise from the motor which causes this.

This happens virtually every single time I start that motor, it's really easy to reproduce.

Here is example picture of what happens after starting the motor:

Before enter image description here

After enter image description here

I googled this problem and lots of people have it and usually the answer by some smart guru is "just add filtering capacitor" and that's it - but I am little too dumb for simple answer like this, frankly speaking, I am rather newbie to electronics - what is filtering capacitor exactly? what type and what capacity? I tried added 100nF ceramic (on pic it's probably marked as uF) between the Vdd and Vss of both PIC MCU and the display (because that's recommended in PIC datasheet), but it had 0 effect.

Can someone provide a simple circuit schematics with a filtering capacitor like this, or anything else that filters this noise and works? I was trying everything possible, even putting random capacitor of random values between all pins and ground and nothing helped at all.

This picture is extremely simplified, the PIC has no unconnected pins in reality

More pictures:

enter image description here

\$\endgroup\$
7
  • \$\begingroup\$ Show the actual picture, not a simplified one, as it may not have the required details needed to solve the problem. For instance it would help to know if the wiring between devices is 1cm or 1m and are they on a PCB with a ground plane or just huge airwire mess of random wires. \$\endgroup\$
    – Justme
    Jun 11, 2022 at 16:32
  • \$\begingroup\$ it's on a breadboard, few cm next to each other. \$\endgroup\$
    – Petr
    Jun 11, 2022 at 16:41
  • \$\begingroup\$ The breadboard may already be one of the reasons. Maybe take a photo or something. \$\endgroup\$
    – Justme
    Jun 11, 2022 at 16:44
  • \$\begingroup\$ Yes, it absolutely is a mess, it's just some home-project, not a professional product :) here it is pasteboard.co/9Z5E8ybou2JN.png but still that interference is only happening when I start the motors (there are some opto-isolated relays that on its own do no harm to display data, only when there is some load like the motors, load gets power from dedicated power supply) \$\endgroup\$
    – Petr
    Jun 11, 2022 at 16:54
  • \$\begingroup\$ I added some pictures of the actual display text to the answer from a newer version of this project which is inside a plastic box with LCD that has backlight. The pic of carton box with wires I sent is from earlier version that however was showing exactly same LCD issues. \$\endgroup\$
    – Petr
    Jun 11, 2022 at 17:01

2 Answers 2

2
\$\begingroup\$

Filter the motor.

I have one in my junk box, long since forgotten what it was pulled from, but it's got capacitors on the back -- a perfect illustration for this, actually.

DC motor with filtering

The leads on the caps should be even shorter, actually, and some noise is still perceptible around this thing (10-100mV peak). Notice the caps to case (GND?) as well. The value is highly noncritical; they went with 0.1µF ("104") probably out of habit, and it's in the right ballpark.

The problem is brush noise, arcing. Sparks can have risetimes of fractional nanoseconds, so it's quite a pervasive source, it doesn't like to stay in wires, it ignores ones' simple notions of current flow. The best solution is to filter it at the source. Ferrite beads (in series with the motor terminals, then capacitors on the wiring side) may help as well, providing dampening for the high frequency noise and helping the capacitors filter better.

The other aspect is the current consumption itself, which may cause your supply voltage to fluctuate. If you have a regulator (and it's not in dropout), it's probably fine; if you're running from raw battery power say, it might be noticeable. Probably not going to be so bad that your digital thresholds get screwed up and thus data corrupted, but it's another possibility. (Sources of ripple may be particularly important if you're using the ADC.)

This assumes of course your motor is a basic brushed DC type. BLDC types do not have brush noise, and the switching noise from the driver should be much milder. There will still be some pulsation in current draw.

Notice that the precautions regarding arcing also apply to your relay board! Consider adding snubbers to them as well. Something like 100R+10nF across the contact is a likely start, and larger C can be used for more inductive loads, or maybe a slightly different arrangement is needed for AC loads that require low leakage (note a capacitor across the contacts allows some current to flow at AC). An MOV is also an option (which has some capacitance, but clamps the turn-off voltage before the contact can spark). If DC, MOV or TVS is also an option.

\$\endgroup\$
1
\$\begingroup\$

Well, many antennas close together. The only display signal input, that can cause data to be written, is the E (Enable) input. It is the clock of the transfer.

So, it's likely, that this wire receives transients and fakes clock signals. A capacitor of 100-220 pF directly at the display connections between pin 1 (GND) and 6 (E) blocks this. 100 nF between pin 1 and 2 is mandatory anyway in this jungle.

Another typical EMI path is a not grounded display metal frame. Most displays of this kind offer a solder joint option to connect the frame with GND. Use this option.

If all this doesn't help, you can guide all display wires together two times through a big ferrite ring. This slows down the transients. Amplitude is reduced, width stretched. There is a chance, that the display will then ignore them.

Are you sure, that the MCU continues with proper operation during these artefacts?

The last option I see, is not using a breadboard.

It would be interesting, which of these hints solved the problem, if at all.

\$\endgroup\$
1
  • \$\begingroup\$ Hello, thanks for the answer, I will try the tricks with capacitors you mentioned, but I don't have any of this capacity, so I will need to order some first... The MCU measures its uptime that I can see on display. Right now it's over 6 days running, with more than 12 cycles where various motors were started by it, so I assume it's operating fine. \$\endgroup\$
    – Petr
    Jun 19, 2022 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.