Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

sensors etc.

Status
Not open for further replies.
Hello,:)

Regarding the current sensor,
I played with the ACS712 a few months ago, and if I remember correctly, it outputs mv RMS and has a DC component of VCC/2. So you have to remove the DC component from the sensor output, then rectify for DC. I believe this sensor is really intended as a replacement for a current transformer. Also, there are vendors that sell pre-made ACS712 circuits with increased sensitivity like the one your trying to make. Check SPARKFun. Last time I looked, they cost about $10 USD. So...the short story....The ACS712 is not an RMS-to-DC converter.:stop:

Regarding the Voltage Sensor,
You haven't said if the ADC is reading DC or AC voltage.:confused:
But if the voltage is AC, you'll need to design an AC coupled Op Amp buffer/level shifter frontend for the PIC. The Level shifter would shift the AC voltage above 0vdc so you'll get the full resolution of the PIC. And you will need and Rail to Rail OP Amp to do that.

Hope that helps....

eT:)
 
Last edited:
Current
Well, it was stated that it is a solar panel and there would, i think, be a desire to know the direction of the current.

Voltage
Again, a solar panel with the desire to minimize quiescent current.
 
Hi again,:)

Regarding the voltage sensor.
After looking at the schematic in the OPs first post, the ADC will be reading DC, so a voltage divider is all that's needed, but, instead, I would add a single OP amp buffer with a divider in front and divide down to 3.3 vdc to provide some headroom. Also add some input overvoltage protection (a couple of diodes).:happy:

eT:cool:
 
I'm intrigued as to why you need an op amp circuit rather than a simple voltage divider, maybe with a zener for protection, and why you'd be worrying too much about response times? What's your application?
 
I'm intrigued as to why you need an op amp circuit rather than a simple voltage divider, maybe with a zener for protection, and why you'd be worrying too much about response times? What's your application?

A voltage divider would not work well due to its tendency to fluctuate with the input voltage. The "mapping" (ranges for the input/output voltages) would be inconsistent.
 
A voltage divider would not work well due to its tendency to fluctuate with the input voltage. The "mapping" (ranges for the input/output voltages) would be inconsistent.

Now I think I'm just going to pull my hairs! Everything seems to be messed up now. First eTech above was saying that current sensor ACS712 is not a current sensor though the datasheet (5A current sensor) says it's a current sensor and can be used to measure both AC and DC current. To me, it had looked that for measuring solar panel current and battery current it was a good choice. I'm trying to make solar maximum power point tracker.

Now DerStrom8 says that a voltage divider cannot be used as a sensor because fluctuations in the input voltage. Where am I going?:(
 
Now I think I'm just going to pull my hairs! Everything seems to be messed up now. First eTech above was saying that current sensor ACS712 is not a current sensor though the datasheet (5A current sensor) says it's a current sensor and can be used to measure both AC and DC current. To me, it had looked that for measuring solar panel current and battery current it was a good choice. I'm trying to make solar maximum power point tracker.

Now DerStrom8 says that a voltage divider cannot be used as a sensor because fluctuations in the input voltage. Where am I going?:(

Don't get me wrong--Voltage dividers can be used to measure higher voltages more easily and all that, and if you have a sensor that changes its resistance based on the environment then a voltage divider would work to provide a voltage on the output that can be measured by, say, the ADC of a microcontroller. However, suppose you have a sensor that outputs 0-10mV and you want it to output 0-5v, then a voltage divider really wouldn't work for you for various reasons. A divider would drop the voltage, whereas an op-amp would amplify it (which is what you'd want).

Perhaps I am not quite sure what your project is, and how accurate it needs to be. I just wanted to point out that voltage dividers really are not very accurate due to the tolerance and temperature coefficients of the individual resistors.
 
Thank you for the reply.

Don't get me wrong--Voltage dividers can be used to measure higher voltages more easily and all that, and if you have a sensor that changes its resistance based on the environment then a voltage divider would work to provide a voltage on the output that can be measured by, say, the ADC of a microcontroller. However, suppose you have a sensor that outputs 0-10mV and you want it to output 0-5v, then a voltage divider really wouldn't work for you for various reasons. A divider would drop the voltage, whereas an op-amp would amplify it (which is what you'd want).

Perhaps I am not quite sure what your project is, and how accurate it needs to be. I just wanted to point out that voltage dividers really are not very accurate due to the tolerance and temperature coefficients of the individual resistors.

I'm using ADC of PIC microcontroller and the voltages I will be measuring are in the range 0-22V (solar panel voltage) and 0-9V (battery voltage) so I think I can use voltage dividers as voltage sensors. Right? The project is about solar panel maximum power tracker. Thanks.

Regards
PG
 
Hello,:)

Regarding the current sensor,
I played with the ACS712 a few months ago, and if I remember correctly, it outputs mv RMS and has a DC component of VCC/2. So you have to remove the DC component from the sensor output, then rectify for DC. I believe this sensor is really intended as a replacement for a current transformer. Also, there are vendors that sell pre-made ACS712 circuits with increased sensitivity like the one your trying to make. Check SPARKFun. Last time I looked, they cost about $10 USD. So...the short story....The ACS712 is not an RMS-to-DC converter.:stop:

I'm sorry but your posting has really confused me. The datasheet says that it can sense bidirectional current. I'm using the sensor which can sense +/-5A. We can also see from the datasheet that when there is no current flowing, i.e. 0A, then the sensor outputs Vcc/2 volts, i.e. 2.5V. Perhaps, you could clarify. Thanks.

Regards
PG
 
PG,
Use resistors to measure 22V and 9V. That is simple.
The Allegro current sensors are good. If you run them form the computer power supply (where ADC ref. voltages are 0 and vcc) then zero current is at 80h (1/2 supply). If you don't add gain you will only use one volt of your 3.3V or 5V range. Using a 10 bit ADC (only using 1/4 of the range) this will give you 8 bits. If 8 bits are enough, don't add the extra parts.
 
A voltage divider would not work well due to its tendency to fluctuate with the input voltage. The "mapping" (ranges for the input/output voltages) would be inconsistent.
But his application is, I believe, about detecting peak solar levels, so I'd expect any non linearity to not really matter, but I'm no expert.

Just a thought though ~ both the voltage and the current might be significantly affected by the load connected to your pv system ... Possibly very significantly
 
Now I think I'm just going to pull my hairs! Everything seems to be messed up now. First eTech above was saying that current sensor ACS712 is not a current sensor though the datasheet (5A current sensor) says it's a current sensor and can be used to measure both AC and DC current. To me, it had looked that for measuring solar panel current and battery current it was a good choice. I'm trying to make solar maximum power point tracker.

Now DerStrom8 says that a voltage divider cannot be used as a sensor because fluctuations in the input voltage. Where am I going?:(

Hi PG1995...:)

OK...what I wrote was that the ACS712 is not an RMS to DC converter. IT IS a current sensor, but it is intended as a replacement for a Current Transformer (implies AC current).
That said...why would you want to use this to measure DC battery current anyway? Just use a series resistor and measure the DC voltage drop across it with the PIC and calculate.

Sorry if I confused you...:sorry:

DerStrom8 makes some good points.;)
A input buffer to the PIC would also allow you to condition the signal (amplify, attenuate, impedance match, etc.) before it reaches the PIC. It would also provide an additional stage
that could help prevent, or, be sacrificed, in the event of an excessive input overvoltage, before damaging the PIC. I mean, we don't know how far the solar panel output is from the PIC input, or
if input wires will be run next to sources that can induce transients or surges...:nailbiting:

eT
 
Hi PG1995...:)
IT IS a current sensor, but it is intended as a replacement for a Current Transformer (implies AC current).
That said...why would you want to use this to measure DC battery current anyway? Just use a series resistor and measure the DC voltage drop across it with the PIC and calculate.
It measures DC! That is the point of this type of sensor! DC.
CTs only work on AC.
I mean, we don't know how far the solar panel output is from the PIC input, or
if input wires will be run next to sources that can induce transients or surges
That is why the divide is done at the PIC not at the voltage source. You run the 22V all over the place and then within one inch of the PIC you knock it down to 5V. Don't run the PIC pin all over the place.
 
It measures DC! That is the point of this type of sensor! DC.
CTs only work on AC.

That is why the divide is done at the PIC not at the voltage source. You run the 22V all over the place and then within one inch of the PIC you knock it down to 5V. Don't run the PIC pin all over the place.

This meant for me?

eT
 
Sorry I didn't mean to point at anyone.

The Hall sensors are really nice to use. Your micro does not have to be well connected to a 0.01 ohm resistor. No ground loops because the Hall is isolated. You can measure the hot wire or the ground. There is thousands of volts of isolation. Great for power line monitoring. Works great.
 
Hi..

Sorry I didn't mean to point at anyone.

No problem...:)
The Hall sensors are really nice to use. Your micro does not have to be well connected to a 0.01 ohm resistor. No ground loops because the Hall is isolated. You can measure the hot wire or the ground. There is thousands of volts of isolation. Great for power line monitoring. Works great.

I agree...just can't understand why the OP would use one for this application.:confused:

eT
 
Slight exaggeration.
It does fix the ant problem.

Just for learning purposes; Please show us how you would get from a resistor to 1V or 5V for the ADC, with out wasting much power.
Remember the Hall has 1.2mOhms of resistance. So the power loss number is small. But the Hall uses 50mW in silicon.
 
Slight exaggeration.
It does fix the ant problem.

Just for learning purposes; Please show us how you would get from a resistor to 1V or 5V for the ADC, with out wasting much power.
Remember the Hall has 1.2mOhms of resistance. So the power loss number is small. But the Hall uses 50mW in silicon.

Nah...you guys are smarter than I am...this ones all yours...:D

eT:)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top