Author Topic: Voltage spikes on PIC ADC PIN.  (Read 14128 times)

0 Members and 1 Guest are viewing this topic.

Offline SajjadBro

  • Contributor
  • Posts: 18
Re: Voltage spikes on PIC ADC PIN.
« Reply #25 on: February 09, 2012, 09:28:11 pm »
Its a good excuse to say " i dont mean any disrespect" and disrespect the other.
I don't mean any disrespect (and i mean it)but if you can't contribute then don't bother to comment. thanks.

I meant no disrespect about you being fresh and having much to learn. We have all been in that place. It is no shame to admit your inexperience.

But if you don't realize that if a device has a ground pin on the plug, then that pin is meant to be used, then surely I think you are very foolish. There is no other way to put it.

The power cable came along with it has only two pins, but i had the one with three pins. So i think i did a wise thing, we purchased this house so i am assuming that there is no ground. As many people (electricians)here don;t bother while doing wiring(Its not my mistake) that's why i made a sure short assumption and considered the worst scenario. 

One more thing don't say something which demoralize other to excel. I have no shame to say that i am inexperienced for what i don't know but what i understand, i go to its depth.

I think i have found one person in this community who likes to criticize instead of giving suggestions and bucking up. It is a request not to post for me ever, thanks and God bless you.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 10537
  • Country: us
Re: Voltage spikes on PIC ADC PIN.
« Reply #26 on: February 09, 2012, 10:18:19 pm »
OK, I apologize for my tone.

But you must understand there is a danger to life here. There is a possibility, if something goes wrong, that you could die.

An oscilloscope, if properly designed and manufactured, should have a three pin grounded mains connection. It is essential to connect the ground pin. Without it the oscilloscope may not work as well as it should, and may be dangerous to operate in some circumstances.

There are often other electrical devices that have a three pin grounded mains connection. If they have one, they also must be connected to a grounded mains socket with a good earth.

In many houses and homes, the electrical outlets may only have two pins. This was for a long time true in America, where electrical safety standards have historically been weak.

However, houses and homes should at least have some outlets with a three pin grounded connection. If there are none, it would be necessary not to use any appliances or devices with three pin plugs, or to have an electrician install some grounded outlets.
"The smart thermostat made for music: Listen to your favorite playlists and podcasts on your thermostat" -- ecobee

I'm a chemical engineer -- I know all about the flow of fluids.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: Voltage spikes on PIC ADC PIN.
« Reply #27 on: February 10, 2012, 01:50:20 am »
Wow just sitting there you almost analysed my problem correctly.
Well one thing is sure that Spikes occur when PWM is on and when probe is connected to it. When i remove the blue channel then there are no spikes.
There is noting connected to PWM channel, later i will only connect it with LCD LED via transistor.
To some extent you are right that PWM has nothing to do with ADC, so i removed The scope probes and displayed directly the reading i am getting from ADC i.e. 0-1023. Now when i set PWM to 20kHz then i get error of 4-6 bits max. setting it  to 10KHz gives 2bit error and setting it to 1KHZ gives only 1 bit error. What do you think?

Well right now oscilloscope has 3 pins in its power jack, hot wire, neutral, and earth but my line connection has no earth.

Unfortunately i just passed out of my University and this is my first scope and its only 25MHZ as i thought it will fulfill my requirements.

Yes when i unplugged the supply (both +/-) from the bread board, even then there is noise upto 3mV. when scope probe is attached to its ground plug and nothing else then -800 microvolts. while they are still attached and i connect to any metal or wire then there is error up to 3mV.

SajjadBro,

First, a 25MHz scope is a very useful scope. I have no problem with that.

I hope you will not get upset by comments on safety from some people. There are many people in this forum who would be absolutely devastated if they heard that one of our members was badly hurt due to a lack of an appropriate safety warning. The motivation for warnings is a genuine concern for people, even if the concern comes across in the wrong way.

The reason that the lack of an earthing system is a problem for oscilloscopes is that they are not "double insulated" so they are not designed to be safe without proper earth wiring. A single fault could make the ground on the oscilloscope live. In an normal earthed power system, this would blow a fuse, or trip an earth leakage breaker. Without a proper earth, an oscilloscope is just not designed to be safe. In this respect, test instruments like oscilloscope's are very different from double insulated appliances like TV's.

Now lets get to how this can affect your measurements.

What you are seeing on the scope is a lot of phantom noise that it seems can be triggered by low energy transitions. Without a proper scope earth, then the scope's circuitry is linked back to the mains via paths like the switching transformer's winding-to winding capacitance in series with its leakage inductance. The power supply for the test circuit also is similarly coupled to the mains. The behaviour of these types of couplings are unpredictable, but they definitely could ring in the way you are seeing in the spikes. It is possible that it will be hard to trust what you are seeing on the scope without some common earth connection.

So what if your work bench had all the all the earth connections of the powerpoints shorted together, but not going to switchboard earth?

Your scope may behave much better, but your whole bench is now far more dangerous. A failure in any one instrument can make the earth of everything on the bench live. If you then somehow touch something that is in electrical contact with the actual ground under the house you while you are using an instrument and you can get a shock.

For now, as a next step in tracking down this noise problem, I think it is worth trying to power the test circuit from a battery rather then a power supply, and see if the waveforms become cleaner.

When you were talking about the ADC, I didn't quite understand what kind of errors you meant. Is this the ADC variation with a constant applied voltage?

Richard.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 10447
  • Country: my
  • reassessing directives...
Re: Voltage spikes on PIC ADC PIN.
« Reply #28 on: February 10, 2012, 06:02:16 am »
Quote
I think i have found one person in this community who likes to criticize instead of giving suggestions and bucking up. It is a request not to post for me ever, thanks and God bless you.
you havent seen worse yet! not only one person, but many! :D
It's extremely difficult to start life.. one features of nature.. physical laws are mathematical theory of great beauty... You may wonder Why? our knowledge shows that nature is so constructed. We simply have to accept it. One could describe the situation by saying that... (Paul Dirac)
 

Offline SajjadBro

  • Contributor
  • Posts: 18
Re: Voltage spikes on PIC ADC PIN.
« Reply #29 on: February 10, 2012, 12:08:33 pm »
Quote

SajjadBro,

First, a 25MHz scope is a very useful scope. I have no problem with that.

I hope you will not get upset by comments on safety from some people. There are many people in this forum who would be absolutely devastated if they heard that one of our members was badly hurt due to a lack of an appropriate safety warning. The motivation for warnings is a genuine concern for people, even if the concern comes across in the wrong way.

The reason that the lack of an earthing system is a problem for oscilloscopes is that they are not "double insulated" so they are not designed to be safe without proper earth wiring. A single fault could make the ground on the oscilloscope live. In an normal earthed power system, this would blow a fuse, or trip an earth leakage breaker. Without a proper earth, an oscilloscope is just not designed to be safe. In this respect, test instruments like oscilloscope's are very different from double insulated appliances like TV's.

Now lets get to how this can affect your measurements.

What you are seeing on the scope is a lot of phantom noise that it seems can be triggered by low energy transitions. Without a proper scope earth, then the scope's circuitry is linked back to the mains via paths like the switching transformer's winding-to winding capacitance in series with its leakage inductance. The power supply for the test circuit also is similarly coupled to the mains. The behaviour of these types of couplings are unpredictable, but they definitely could ring in the way you are seeing in the spikes. It is possible that it will be hard to trust what you are seeing on the scope without some common earth connection.

So what if your work bench had all the all the earth connections of the powerpoints shorted together, but not going to switchboard earth?

Your scope may behave much better, but your whole bench is now far more dangerous. A failure in any one instrument can make the earth of everything on the bench live. If you then somehow touch something that is in electrical contact with the actual ground under the house you while you are using an instrument and you can get a shock.

For now, as a next step in tracking down this noise problem, I think it is worth trying to power the test circuit from a battery rather then a power supply, and see if the waveforms become cleaner.

When you were talking about the ADC, I didn't quite understand what kind of errors you meant. Is this the ADC variation with a constant applied voltage?

Richard.
Thanks for make me more clear for the noise related to earth. So i opened  an electrical socket and yes there was a green earth wire. My assumption was wrong and i will install another wire in my sockets which are on workbench. As you can see in the image the original power cable has an option for the earth pin but its not installed actually. but i will do as u said.

I have tested my circuit on batteries even but same noise. Its just as i increase the PWM frequency the error goes up to 6 bits. under 2K frequency i only get hardly 1 bit error.
 

alm

  • Guest
Re: Voltage spikes on PIC ADC PIN.
« Reply #30 on: February 10, 2012, 11:06:57 pm »
As you can see in the image the original power cable has an option for the earth pin but its not installed actually. but i will do as u said.
This looks like a CEE 7/7 plug. The hole would match the ground pin of a French socket. The metal on the sides would connect to ground in German sockets. It may not fit grounded sockets in your country, but it's clearly designed to work with grounded sockets.
 

Offline SajjadBro

  • Contributor
  • Posts: 18
Re: Voltage spikes on PIC ADC PIN.
« Reply #31 on: February 12, 2012, 08:53:04 pm »
Ok , i have made many experiments on PIC16f87x series. I have separated the Analog and Digital ground.All extra pins are set to digital input and are grounded. Earth connection was there, Ran my circuit even on battery.


When PWM is on then there is error even up to 4 -6 bits.
When PWM is off then the error is none.

I didn't believe myself and always thought that i am doing something wrong but accidentally when i visited the microchip site for this controller, its was written "Not Recommended". Well this chip have some problem and i will try another chip of another model in future for that. for now i have turned off the PWM.

If you guys faced the similar problem then do share. thanks.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf