Shop OBEX P1 Docs P2 Docs Learn Events
Read Shunt 0 - 50 mV — Parallax Forums

Read Shunt 0 - 50 mV

joecjoec Posts: 7
edited 2011-07-27 07:42 in General Discussion
Hey everyone,

So I am trying to read a voltage from 0 - 50 millivolts and i am wondering if my voltage sensor will be able to detect a change that small. I have a voltage sensor,

http://www.trossenrobotics.com/p/phidgets-precision-voltage-sensor.aspx%20,

but dont know if is senstive enough. Is there a way to read in the voltage directly or up the voltage?

I think im supposed to use an op-amp? yes no?

Im using ardunio too by the way...sorry. :)

Thanks!

Comments

  • ercoerco Posts: 20,259
    edited 2011-07-26 15:40
    Op amp into ADC. Why don't you ask your learned pals in the Arduino forum? :)
  • joecjoec Posts: 7
    edited 2011-07-26 16:08
    erco wrote: »
    Op amp into ADC. Why don't you ask your learned pals in the Arduino forum? :)

    Cause my friend told me to come here! duh. Do you have any ideas?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 16:27
    The arduinas have analog inputs, don't they?
  • davejamesdavejames Posts: 4,047
    edited 2011-07-26 16:55
    joec - I took a look at the link provided, and the "product specification" does not state if it can do what you wish. The min/max error of 2% bothers me a bit and the max offset of +/-100mV is surprising given any kind of decent differential amp. I'm worried your 0 - 50mV signal would get swamped with the inherent offset without some sort of calibration.

    Yes, an op-amp would be handy to "get the signal outa the mud".
  • joecjoec Posts: 7
    edited 2011-07-26 16:55
    yup. i have a voltage sensor too. If i need to increase the voltage can I use an op amp? or like a transistor as a amplifier? or a transformer? hhah. seriously though.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 16:58
    But, seriously, what of the genius of arduina, the analog inputs?
    Not good enough?
  • joecjoec Posts: 7
    edited 2011-07-26 17:01
    im confused by what the sentence means PJ. How bout plugging the lead wires to my signal directly into the analog inputs? its only 50 mV and then I can make my reference like .01 volts and I wouldnt have any resolution problems. But can I plug the leads directly into a analog pin?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 17:03
    It's your platform, guy.
    The arduinas have specific pins that can accept/use analog ("non-digital") inputs.
    We're told how Parallax products are inferior for not having these wonderful analog inputs.
  • joecjoec Posts: 7
    edited 2011-07-26 17:04
    But im just unsure about what "analog" means. Im a little new to this. Would i just hook up the vin+ to my analog and vin- to ground? sorry if this is a stupid question.
  • ercoerco Posts: 20,259
    edited 2011-07-26 17:05
    I've heard that arduinas get more sensitive when they're powered by 115 volts AC. But... I haven't tried it myself.

    Caveat Voltor!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 17:07
    Yes, by Gum, as I understand it, you should be able to as you've suggested in #10.
  • joecjoec Posts: 7
    edited 2011-07-26 17:10
    fantastic. Thanks for all your help everyone. And I have used basic stamps too btw...:)
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 17:21
    10 bits (1024)
    AnalogRead
    You should know your platform better than this.
    Here some Parallax guy's setting you right.
  • joecjoec Posts: 7
    edited 2011-07-26 17:36
    hey hey hey i got it. haha. im gonna use analogreference to change the range so i get better resolution. :) boom
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 17:41
    Yeah, back at you. :zombie: Knock yourself out.
  • alex123alex123 Posts: 102
    edited 2011-07-26 17:53
    I don't know the basic stamps but if the ADC is 10 bits and its input range is 5V you're looking at approx 4.9mV per bit. This is the highest precision you can measure your 50mV signal when you connect it directly the ADC input. (also make sure that the ADC analog ground is connected to the your signal ground). So you're looking at only 10 bits - 10 distinct digital values.

    One way to mitigate this is to amplify the 50mV signal using an opamp (as someone metioned before). A gain of a 100 will give a full range 0-5V and all 1024 bits of resolution. That will also introduce more noise into your digital measurement. That also can be dealt with by reducing the bandwith on the opamp by adding a cap but that depends on the application.
  • alex123alex123 Posts: 102
    edited 2011-07-26 17:59
    Yup. If you can change the reference voltage on the ADC it's a good idea too. Maybe ever better - less parts...

    Also if your signal dones't change too fast add a simple low pass filer (a resistor and a cap) in front of your ADC this way you'll reduce some noise.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-26 18:09
    OK, well, this is the Parallax Forum. Let's leave/direct further discussion where it belongs.
  • kwinnkwinn Posts: 8,697
    edited 2011-07-26 18:11
    joec, your shunt provides an analog voltage that ranges from 0 to 50 mV. The analog input on the arduino is from 0 to 5V so the signal from the shunt needs to be amplified by 100 to have the same range. That is typically done with an op amp.
  • BeanBean Posts: 8,129
    edited 2011-07-27 04:41
    I have had good luck reading small voltages with the MCP3425.
    It is a differential 16-bit ADC with an internal 2.048V reference. But the kicker is that you can program it to amplify the incoming voltage by 2, 4 or 8.
    So a 50mV * 8 = 400mV / 2.048V * 32768 = 6400. That should be plenty of resolution.
    The downside of the MCP3425 is that it is slow (15 samples per second at 16-bit; 240 samples per second at 12-bits).

    I have used it in a design and got very stable results.

    Here is the propeller code I used:
    ' This is NOT a complete program
    
    OBJ
      ADC: "Basic_I2C_Driver"
    
    CON
      SCL = 3 ' MCP3425 SCL = P3
      SDA = 4 ' MCP3425 SDA = P4
    
    PUB main
      ' Setup MCP3425 ADC
      ADC.Initialize(SCL)
      ADC.Start(SCL)
      ADC.Write(SCL, $D0)
      ADC.Write(SCL, %1_00_1_10_11) ' Config for 16 bit conversions with gain of 8
    '                 1_.._._.._..    Ready bit 1=conversion finished
    '                 ._00_._.._..    Channel select (not used in MCP3425)
    '                 ._.._1_.._..    1=Continuous conversion; 0=One shot conversion
    '                 ._.._._10_..    00=12-bit 240sps; 01=14-bit 60sps; 10=16-bit 15sps
    '                 ._.._._.._11    00=Gain 1; 01=Gain 2; 10=Gain 4; 11=Gain 8
      ADC.Stop(SCL)
    
    
    PUB ReadADC: Value
      ADC.Start(SCL)
      ADC.Write(SCL, $D1)
      value := (ADC.Read(SCL, 0) * 256)
      value += ADC.Read(SCL, 1)
      ADC.Stop(SCL)
    
    

    Bean
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-07-27 07:42
    Bean wrote: »
    I have had good luck reading small voltages with the MCP3425....

    Hey, Bean, thanks for posting that. It looks very handy.

    BTW, I love that quote by Abraham Lincoln!
Sign In or Register to comment.