CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ACS712-30A current sensor output problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kumareshan



Joined: 02 Nov 2016
Posts: 1

View user's profile Send private message

ACS712-30A current sensor output problem
PostPosted: Wed Nov 02, 2016 11:41 pm     Reply with quote

Hi all

I am using FIVE ACS712-30A IC in a single PCB to measure current reading for AC loads.

1. VCC to the IC's are 5.0v.

2. Bypass capacitance = 1uF and 0.1uF

3. Filter capacitance = 0.47uF

4. Output of each IC's are 2.5v check in multimeter.

5. When i convert using ADC (MCP3204-12bit ADC IC), each value is oscillating and unstable at no load. What could possibly be the problem? How to make all outputs stable to zero without load?

THANKS

KUMARESHAN
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 2:24 am     Reply with quote

What are you using as the Vref for the ADC?.

A DVM, is not fast enough to see noise from a chip like this. Most take something like 0.2 seconds to actually take a reading.

The chip produces a ratio-metric output from it's supply. It's vital that the sensor supply and the ADC's Vref come from exactly the same point.

As has been said on many threads in the past. When dealing with things involving current (particularly if this is being 'switched', you need careful analog design round the PIC. I'd guess you actually have significant HF noise on the Vdd rail. The DVM is not quick enough to see it, but the ADC you are using is....
You probably need to isolate the Vdd fed to the current sensor from the main supply, and then feed this rail to the MCP3204's Vref, so both chips are measuring from the same rail. Even then the count will change by a small amount. The output will be 151.5 counts/A, with your high accuracy ADC.
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 4:42 am     Reply with quote

I'll back up Mr. T and add that Vref should come from a precision V reference chip ! Anything over 8 bit ADC needs an ULTRA stable Vref !!
I also agree you need a lot of properly sized bypass' caps NEXT to every device as well as thick PCB traces. The unit should be in an aluminum or metal enclosure to reduce possible EMI affecting it. Also every I/O point from the PCB needs some form of 'bypass' be it inductors,caps,chokes,ferrite beads,small Rs, etc.
Sucessful analog design is half high tech reading and half black magic. I'm wondering if any level of school actually teaches anything analog aside from very basic opamp stuff ?

Jay
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Nov 03, 2016 5:29 am     Reply with quote

basic trouble shooting: do you have an oscilloscope - ideally a DSO - to analyze what is going on in analog terms?
or are you flying blind ?
Question
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 6:09 am     Reply with quote

temtronic wrote:
I'm wondering if any level of school actually teaches anything analog aside from very basic opamp stuff ?


No. No they don't.

Edit: some random further thoughts.
- Fresh out of school, I wasn't aware that op-amps could be powered from a single supply. Analog circuit design employing a single supply? Never heard of it.
- Capacitor differences weren't covered - ever. Electrolytic vs ceramic vs polyester vs tantalum - they were all the same, save for the obvious difference between polarized and non-polarized versions. Decoupling caps were never discussed.
- PCB layout was never covered, ever.
- ESD was the thing that stung your finger when you touched the light switch.
- Power supplies were very simple: series R, reverse biased zener diode. That's all I ever saw in class. Not even linear rectifiers were discussed, let alone a switching supply.
- Related to power supplies: heat dissipation.
- Ground or power planes? What are those?
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 9:14 am     Reply with quote

Quote:

I'll back up Mr. T and add that Vref should come from a precision V reference chip ! Anything over 8 bit ADC needs an ULTRA stable Vref !!


There is a slight problem to this.

These current sensors use their supply as their Vref.

What you have to do is have a 'low noise' supply isolated from all the digital stuff, and use this to feed the sensors, and the Vref on the ADC.
The output is not an absolute voltage, but is all relative to the supply.

I've used a some of these. Mine sit on a separate part of the PCB, fed with it's own supply, and then this goes to the Vref of the ADC as well.
drolleman



Joined: 03 Feb 2011
Posts: 116

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 9:21 am     Reply with quote

When did you go to school? When I was in school, in the early 80's they taught all of that. I know even that in grade school, now they don't teach how to do hand writing.
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 10:35 am     Reply with quote

hmm..re vref... I was referring to the ADC parts (MCP3204-12bit ADC) requiring a real stable Vref not the actual sensors.

Jay
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 10:36 am     Reply with quote

1988 - 92.
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 11:57 am     Reply with quote

temtronic wrote:
hmm..re vref... I was referring to the ADC parts (MCP3204-12bit ADC) requiring a real stable Vref not the actual sensors.

Jay


I understand, but this is a case where this is not what is needed!...

The current sensors produce an output that is ratiometric from their supply. At no current, they produce 1/2 their supply as the output. If you have a lovely stable ADC Vref, if there is a change in the sensor supply, you get garbage...
This is why you need to use the sensor Vdd as the Vref. It's possibly the one case where this is more important than the quality of the actual reference.

Very Happy
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Nov 03, 2016 2:09 pm     Reply with quote

I've used the STmicro LF50CV with a tantalum cap on the output pin
for your sort of problem. It's a very clean LDO regulator
but you need at least 5.6V of inlet voltage to be sure its won't
dropout and defeat the purpose.
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Thu Nov 03, 2016 2:41 pm     Reply with quote

Yes, I've used a similar IC.
It's worth adding, that the key here is getting the supply smooth. The units introduce a time delay on the signal output, relative to changes in their incoming supply voltage. If there is any significant noise on the supply the ADC's reference changes as well, but the 'now' output from the sensor, is based on the supply voltage a few moments ago. So you see the change in the value. In fact the filter capacitor on the chip will make this lag worse. So if the supply is not smooth you actually get better results by reducing this....
Keeping this supply 'separate' from anything likely to introduce noise, really is vital.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group