1. 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.
    Dismiss Notice

sensors etc.

Discussion in 'Mathematics and Physics' started by PG1995, May 30, 2014.

  1. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    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: Jun 7, 2014
  2. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,917
    Likes:
    1,098
    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.
     
  3. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    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:
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. flatfootskier

    flatfootskier Member

    Joined:
    Jan 11, 2007
    Messages:
    128
    Likes:
    5

    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?
     
  6. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,484
    Likes:
    503
    Location:
    Vermont (GMT-5:00)
    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.
     
  7. PG1995

    PG1995 Active Member

    Joined:
    Apr 18, 2011
    Messages:
    1,645
    Likes:
    13
    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?:(
     
  8. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,484
    Likes:
    503
    Location:
    Vermont (GMT-5:00)
    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.
     
    • Thanks Thanks x 1
  9. PG1995

    PG1995 Active Member

    Joined:
    Apr 18, 2011
    Messages:
    1,645
    Likes:
    13
    Thank you for the reply.

    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
     
  10. PG1995

    PG1995 Active Member

    Joined:
    Apr 18, 2011
    Messages:
    1,645
    Likes:
    13
    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
     
  11. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA
    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.
     
  12. flatfootskier

    flatfootskier Member

    Joined:
    Jan 11, 2007
    Messages:
    128
    Likes:
    5
    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
     
  13. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    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
     
  14. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA
    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.
     
    • Like Like x 1
  15. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    This meant for me?

    eT
     
  16. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA
    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.
     
    • Agree Agree x 1
  17. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    Hi..

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

    eT
     
  18. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA
    They are $3.00 @1 and $1.50 @ 3000 (US money)
    Its just money.
     
  19. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    Ok...but its like using an atom bomb to kill an ant...:D
     
  20. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,254
    Likes:
    961
    Location:
    Loveland, CO USA
    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.
     
  21. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    561
    Likes:
    43
    Nah...you guys are smarter than I am...this ones all yours...:D

    eT:)
     

Share This Page