Reversing AC motor causes Adafruit I9341 TFT to white out

I spent a lot of time programming an Adafruit 2.8" TFT with resistive touchscreen on a nano to run a laminator modified for toner transfer. The nano is connected to a 100K thermistor, and uses the Steinhart-Hart equation to monitor the roller temperature. In addition to the display (SPI connection), there are 3 transistors switching 12V to 2 mechanical relays, and a 12V beeper. One relay switches on the 2 heater elements (600 watts total), and the other reverses the drive motor.

Everything works perfectly until I connect the motor, the heaters work, the relays click,etc., etc. Once I plug in the motor, it's all good until either I press the button to reverse it, or the program reverses it; in either event, the display turns all white. The nano is still doing what it's supposed to do, and even the touchscreen works, although I can obviously no longer see the buttons.

Obviously, the motor reversing is doing something nasty to the display, but I have no idea exactly what, or how to fix it.

A bit more background; the nano is powered by a small 120VAC to 12VAC transformer feeding 4 diodes in a rectifier arrangement, with a 1000uF electrolytic cap and a smaller cap across the positive and negative rails. This, with the relays, is on a separate board, and the DC output is wired to a L7805 voltage regulator on the nano board.

With the laminator switched on and the motor running forward, the rectifier arrangement puts out 20 volts DC, and when I manually trigger the relay with a jumper, the motor reverses, and the voltage drops to ~17.5 volts.

I am not all that knowledgeable about AC motors in general, so I don't really know where to start. I've a feeling I'm in for another learning situation..... Thanks in advance, and I'm happy to provide any other needful information.

Edit...I just tried wiring in a 12volt wall wart I had kicking around, bypassing the transformer/diode source from the relay board...no change. Maybe it's not the power supply circuit that's being affected, but something else. I replaced the transistor and flyback diode for that relay, again, no difference. I tried doubling the capacitor that's connected across the motor's 2 hot leads, but that just made the motor growl. I'm running out of ideas. I wish it was something in the program, but it works fine as long as the motor is unhooked.

Hard to tell what you have going on without drawings or pictures. A few random ideas.

Any chance of adding a few caps to the nano board side of the LM7805 or even better across the power supply to the display? Wondering if you are getting a power failure to it and it is trying to reset, but does not know how.

It is not a fix but, any chance when the arduino changes direction of having it reset the monitor and draw something? If it can do that then it is highly likely a power failure of some sort.

How about putting the motor on the wall wart and leaving the rest of the circuit as is and see if you still have the problem?

Side note how are you changing direction of the motor with a single relay? Normally takes a double pole or two normal relays.
You mention 20v and 17.5v where is that coming from if your power supplies are 12v?

Most of these problems are intimately involved with your wiring layout.

To criticise this we need adequate photos. :astonished:

Please do not attempt to take photos indoors unless you have a full photographic studio. Just sit the equipment outside in full daylight but not direct sun and take some fully-focused pictures.

Thanks for the replies. I tried all manner of capacitor combos with no luck. I decided to just chuck the whole design and start from scratch. I am awaiting new parts & I'll update this thread when I get the new system put together,

Whilst awaiting the new parts, I've been playing around with it. I'm pretty sure at this point it's a power-related issue vs. any kind of signal issue.

I have a honking big 1000uF cap across the 5 volt rail, and now whole nano and display is resetting when the motor changes direction.

I'm past the point of frustration, and am now genuinely interested in the challenge. Nothing electronic is ever easy, it seems. It's almost like they oughta offer a college degree program or something for this stuff, LOL.

Here is a diagram of my latest circuit

I originally had the nano powered from the converter, but that caused the whole shebang to reboot everytime the motor changed direction. Then, I had the idea to disconnect the nano from the converter and power it by USB. Now, the thing will run for about 20~30 seconds before the screen goes white. The nano is not rebooting because the machine continues to alternately reverse and go forward, and the touchscreen still works, although I can obviously no longer see the buttons.

I admit I am completely flummoxed. I have the nano completely isolated from the AC side and relays, but it STILL messes up. If I unplug the motor, it will run forever, the relay clickety-clacking away merrily and the display working fine.

The only thing I can figure now is that the relay is internally arcing and throwing out a spike of RF radiation.....or it's sorcery most foul.... :o

BTW, if you are wondering why I use the NPN transistor, it's because the relay draws about 90 mA, which is more than the optoisolator can handle.

What is clearly missing from that arrangement is the second relay that stops the motor before it reverses! :astonished:

Paul__B:
What is clearly missing from that arrangement is the second relay that stops the motor before it reverses! :astonished:

The original board that came on the machine had only the one relay. Do you think that is the problem? Assuming that is true, I am still puzzled as to why/how that would affect the display, which is connected to the isolated nano.

I freely admit I am not very knowledgeable about AC motors, but what you say makes sense; and it would be simple enough to do that.

Also, what is the function of the MPF capacitor across the 2 motor leads?

JohnDeere630:
Also, what is the function of the MPF capacitor across the 2 motor leads?

This is a "capacitor run" motor as is common with reversible AC motors of less than a horsepower.

The capacitor advances the phase of whichever winding is is in series with, causing a rotating magnetic field which the "squirrel cage" armature follows. What is clever here is that you only have to switch one connection to cause the capacitor to be in series with the other winding and cause the magnetic field to rotate in the opposite direction.

But the motor will draw excess current if you reverse it while it is still rotating and you may be switching it when the voltage across the capacitor is the same as the supply voltage so when you switch it, the capacitor voltage adds and there is a very substantial impulse at the moment of switching which is interfering with your system.

This effect would be lessened if you can completely turn the motor off until it stops rotating before starting it in the other direction.

As I pointed out before, it is critical that you keep the mains wiring clearly separate from the logic wiring and that all wires from one part to another are grouped together in a bundle so there are no open loops in the wiring.

Paul__B:
....This effect would be lessened if you can completely turn the motor off until it stops rotating before starting it in the other direction.

As I pointed out before, it is critical that you keep the mains wiring clearly separate from the logic wiring and that all wires from one part to another are grouped together in a bundle so there are no open loops in the wiring.

Thank you, Paul. I will add a relay to do what you suggested.

Currently, the nano, a level shifter, and a beeper are on one board about 2" away from the board that has the relays, mains leads, and motor connection, and there is 4" cable of 3 wires (ground, one to the heater relay, which is not shown in the above drawing, and one to the motor relay.) they are twisted together and connected through a jst connector at each end.

I will post a diagram of the 2 boards when I get a minute later today.

I am still puzzled as to how the motor's shenanigans are affecting the nano and relay when the only connection is the above 3 wires which only go to a pair of opto-isolators. Is it an EM spike picked up on the wires, either the 4" cable from the nano-board to relay board, or more likely the 8" group of 14 wires between the nano and display?

Sorry for all the questions....

Here is the board layouts...

Wow!

I don't like the clearances between red and green on your heater relay or the poor layout of your 1 mF and ceramic cap at the top right corner - these connections should have been the other way up so there would be no loop of the black wire to come anywhere near the green.

This is bad in two respects, the risk of flash-over between mains and logic supplies, and the proximity of small loops on the board. While I was mostly referring to loops in the "flying" wires between assemblies and your connectors are clearly arranged so that those wires are neatly grouped and some distance apart, it is possible that small loops within the traces on the PCB are indeed capable of coupling EM spikes.

Paul__B:
Wow!

I don't like the clearances between red and green on your heater relay or the poor layout of your 1 mF and ceramic cap at the top right corner - these connections should have been the other way up so there would be no loop of the black wire to come anywhere near the green.

This is bad in two respects, the risk of flash-over between mains and logic supplies, and the proximity of small loops on the board. While I was mostly referring to loops in the "flying" wires between assemblies and your connectors are clearly arranged so that those wires are neatly grouped and some distance apart, it is possible that small loops within the traces on the PCB are indeed capable of coupling EM spikes.

Noted. and thank you. Back to the drawing board.....

New design with 3rd relay added.....

As long as I try to use the same 5v power source for th relays and nano, and thus have all the grounds tied together, I suppose the optoisolators are not accomplishing much, in fact, using $1.20 worth of isolators to protect a $4.00 nano probably doesn't make much sense anyway.

Anyhoo...I got the signal/logic traces as far as I could away from the AC traces, and rearranged the 5v capacitors, and added a 3rd SPST relay to kill motor power before direction changes....

Hmmm.

The clearances do seem to be somewhat improved.

I get the distinct impression that if you were to rotate the motor reversing relay, you might be able to get even more clearance. :grinning:

Paul__B:
Hmmm.

The clearances do seem to be somewhat improved.

I get the distinct impression that if you were to rotate the motor reversing relay, you might be able to get even more clearance. :grinning:

Done. It's pretty easy to move stuff around at this point.

Ok...not that easy. I have to go with SM transistors because they got moved under the converter. Now I wait for them....