Sometingh is instable on ATmega 328P from arduino??!! - Page 1
Forum section: electronics / general

author: Unnit
author_rank: Newbie
timestamp: February 01, 2020, 03:19:25 pm
content: Hi, is my first timpe posting on EEVBlog forum and I ended here with my problem because I think is my last place to receive some professional solution for my problem.I am working on a project with ATmega 328P for a vacuum cleaner to a self service and I made all the electronic needed for the project. The software was made by a close friend because I am not a pro in this teritory. All good and working as expected (I made some rigurous tests before) untill I put my electronic inside of the vacuum cleaner.The screen (LCD 2x16) stoped responding but in a random maner. I will put some pics down with the weird screen that I have problems with. I created more then 10 prototipes and some of them reacted a bit different (it works for more then 30 operation until it chrashes) (I think is all about the manufactoring process).My first impression was that I have an EMI problem because of the big mottor (3kw) that has to starts and stops by the commands of ATmega. For this reason I put some resistors (6 x 1k) on top off the display to the data lines (register select, enable, D0, D1, D2, D3) closer to the Ic of the screen in order to make the signal stable during the instructions, but this is not all the story. In concluzion the problem is: the glici was a persistent but with more operation as before. So I decided to disconected the mottor and restart the application. It didn't work.The second impression (without the 3kw motor) was that the power supply (all power supplies was brand new from manwell) was not well galvanic isolated and I have parasitic ac voltage because I was zziped durring the tests. Afterwards I found that between neutral (from the power supply) and the negativ terminalI have almost 387V(tested with my oscilloscope picture down below). After I changed the power supply I had my third impression because the problem was the same.The third impression: My door from the vacuum cleaner is stainless steel and is grounded to the power supply grid (PE), I put some aluminium foil to shield the entire electronics during the operation and the screen just stopped responding like before without touching any button and the relays from inside starts and stops without any meaning...Please someone who has any ideea what is happening?I'm prepared to put the electronic inside an aluminium case and connect to the the ground of the sistem withot touching the ground off the power supply grid in order to make a Faraday cage. Is this going to work?

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 01, 2020, 10:46:54 pm
content: Is the black metal bezel of the LCD touching the door? There may be a fluctuating voltage potential between the ground of the electronics and the ground of the door. If so, you could try putting some plastic tape on the bezel to insulate it from the noisy grid ground.

author: Unnit
author_rank: Newbie
timestamp: February 02, 2020, 10:49:13 am
content: No, I have a 5mm glass to isolate in case dirt particles come inside. I have electrically isolated all my electronic from the metalic doar. I have noticed that the ground of the power supply grid is identical to the neutral of the sistem that I have (in my country this is something common for most of the electrical grid that’s installed).

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 04, 2020, 09:54:15 am
content: It looks like you have isolated the motor via the relays so maybe that part can be ignored... Also if that is truly isolated then I think you can ignore EMI initially. My non professional suggestion would be it is power supply sag and to test this I would power your gadget from a separate isolated supply..Maybe even a battery and see if you can get stable operation.Divide and conquerWelcome to the forum.

author: SL4P
author_rank: Super Contributor
timestamp: February 04, 2020, 11:50:54 am
content: You mention multiple units behaving differently..How about bypass caps on all the active components, and snubbers etc on the relay drives.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 04, 2020, 12:00:23 pm
content: Quote from: SL4P on February 04, 2020, 11:50:54 amIn fact a schematic or photo of the other side of the board would be helpful. How are you driving those relays? Do you have snubber reverse diodes?

author: amyk
author_rank: Super Contributor
timestamp: February 04, 2020, 01:13:43 pm
content: I still think it's EMI from the motor, a brushed universal motor creates a LOT of RF interference. You may have already damaged some components initially.

author: Unnit
author_rank: Newbie
timestamp: February 04, 2020, 07:21:00 pm
content: I've made some tests since I opened the topic and I didn't solve the issue but I found some interesting stuff since then.In order to answer multiple questions I will make some different paragraphs:Yes I have changed the power supply with an AC one that provides 3 Amps and 5 Volts, and the problem is still thereI have by pass caps for each important component (by design) that is verry close to it in order to maintain the constant voltage, for example the Microcontroler has 100nF and 1nF off different capacitor material (one is ceramic MP0 and one is ceramic X7R) for greater stabilityYes I have diode (snubber) for each relay in order to stop the inverse voltage when the relay is switching offI have made some tests with the Faraday cage in order to reduce the EMI and in some point of the experiment I put an contactor (a trifazical relay) to open and close without powering the mottor and I found the same problem. That means is an power distribution problem. In the same time I was powered with the external power supply and that is a strange result.Down below I will put the schematic simplified.Thank you for your support!

author: janoc
author_rank: Super Contributor
timestamp: February 04, 2020, 07:32:08 pm
content: Quote from: amyk on February 04, 2020, 01:13:43 pmYep, very much this. A vacuum cleaner motor will generate enough noise due to the sparking brushes to cause tons of trouble to anything electronic in a close proximity. Put the ATMega into a shielded metal box, put chokes/ferrites on all the wires coming in and out of that box and hopefully that will stop the problem.

author: Unnit
author_rank: Newbie
timestamp: February 04, 2020, 07:37:36 pm
content: For the last 2 experiments I reproduced the issue on my bench and is not an EMI issue! This is the conclusion after I tested the electronic with small loads that was far away from the electronic.By the way I have an induction motor with short circuit rotor (it has no brushes).

author: IanJ
author_rank: Unknown
timestamp: February 04, 2020, 08:21:09 pm
content: Might be worth making a YT video demonstrating the problem.Ian.

author: Unnit
author_rank: Newbie
timestamp: February 04, 2020, 09:09:42 pm
content: Here is a video with the problem.The issue was in the first part of the video with the contactor connected. After that test I reset the microcontroller and disconnect the contactor and retry the test. I want to point out that the contactor is working on 230V.Another interesting thing is that the microcontroller and LCD synchronised after a couple of instructions made by the buttons that I pressed.I want to mention that all the glitches that appears on the screen is generated randomly.https://www.youtube.com/watch?v=ustTrc_RFtk&feature=youtu.be

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 04, 2020, 10:16:51 pm
content: Add 10k between PC6 and VCC

author: amyk
author_rank: Super Contributor
timestamp: February 05, 2020, 01:46:34 am
content: Quote from: Unnit on February 04, 2020, 07:37:36 pmVery important data point, you should've mentioned that in your first post. Whenever "vacuum cleaner" is brought up, loud high-RPM universal motors come to mind, not induction ones. In this case EMI from the motor is unlikely to be a concern unless it has a starting switch that arcs once on startup.

author: Unnit
author_rank: Newbie
timestamp: February 05, 2020, 04:25:09 am
content: I have allready 10k to that pin, thank you I forgot to mention

author: Miti
author_rank: Super Contributor
timestamp: February 05, 2020, 09:33:37 am
content: What’s the green wire connected to, is it a firm earth ground? If yes, try connecting the negative of your power supply, V-, to it and see what happens. I have a feeling that your low voltage ground is floating.Edit: I’ve had exactly the same issue with a stand alone functional test system with PIC where first I use a cheap, two prong wall adapter. Very low power, 5V no more than 500mA. I measured ~60V AC between V- and ground and every now and then, when pressing the button to start the test or inserting the DUT, the LCD went crazy. The solution, replacing the power supply with a three prong with V- connected to earth. I haven’t heard about it after that.