Author Topic: Sometingh is instable on ATmega 328P from arduino??!!  (Read 1455 times)

0 Members and 1 Guest are viewing this topic.

Offline UnnitTopic starter

  • Newbie
  • Posts: 9
  • Country: ro
Sometingh is instable on ATmega 328P from arduino??!!
« on: February 01, 2020, 03:19:25 pm »
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 :bullshit: (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...  |O

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?
 

Offline I wanted a rude username

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: au
  • ... but this username is also acceptable.
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #1 on: February 01, 2020, 10:46:54 pm »
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.
 

Offline UnnitTopic starter

  • Newbie
  • Posts: 9
  • Country: ro
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #2 on: February 02, 2020, 10:49:13 am »
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).
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #3 on: February 04, 2020, 09:54:15 am »
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 conquer

Welcome to the forum.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #4 on: February 04, 2020, 11:50:54 am »
You mention multiple units behaving differently..

How about bypass caps on all the active components, and snubbers etc on the relay drives.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #5 on: February 04, 2020, 12:00:23 pm »
How about bypass caps on all the active components, and snubbers etc on the relay drives.
In 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?
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8276
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #6 on: February 04, 2020, 01:13:43 pm »
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.
 
The following users thanked this post: janoc

Offline UnnitTopic starter

  • Newbie
  • Posts: 9
  • Country: ro
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #7 on: February 04, 2020, 07:21:00 pm »
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 there

I 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 stability

Yes I have diode (snubber) for each relay in order to stop the inverse voltage when the relay is switching off

I 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!
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #8 on: February 04, 2020, 07:32:08 pm »
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.

Yep, 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.
 

Offline UnnitTopic starter

  • Newbie
  • Posts: 9
  • Country: ro
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #9 on: February 04, 2020, 07:37:36 pm »
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).
 

Offline IanJ

  • Supporter
  • ****
  • Posts: 1609
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #10 on: February 04, 2020, 08:21:09 pm »
Might be worth making a YT video demonstrating the problem.

Ian.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline UnnitTopic starter

  • Newbie
  • Posts: 9
  • Country: ro
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #11 on: February 04, 2020, 09:09:42 pm »
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
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #12 on: February 04, 2020, 10:16:51 pm »
Add 10k between PC6 and VCC
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8276
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #13 on: February 05, 2020, 01:46:34 am »
By the way I have an induction motor with short circuit rotor (it has no brushes).
Very 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.
 

Offline UnnitTopic starter

  • Newbie
  • Posts: 9
  • Country: ro
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #14 on: February 05, 2020, 04:25:09 am »
I have allready 10k to that pin, thank you I forgot to mention
 

Offline Miti

  • Super Contributor
  • ***
  • Posts: 1324
  • Country: ca
Re: Sometingh is instable on ATmega 328P from arduino??!!
« Reply #15 on: February 05, 2020, 09:33:37 am »
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.
« Last Edit: February 05, 2020, 09:47:37 am by Miti »
Fear does not stop death, it stops life.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf