Shop OBEX P1 Docs P2 Docs Learn Events
Help with a sensor — Parallax Forums

Help with a sensor

c.asmithc.asmith Posts: 15
edited 2013-11-06 06:40 in Accessories
Hi, Guys,

I'm new to electronics, and I have two questions, if someone would be kind enougth to help someone new :)

1. How do most sensors interact with the outside world? Is it like a transistor? Where the emiter allows voltage through depending on the base. In this case the sensor controls the base?

2. I really want to integrate these type of sensors:

http://www.nve.com/Downloads/analog_catalog.pdf (The AA Series)

I was hoping someone could give me some information how they would wrire them up, and how they think they would work.

Thank you for your help,

Please try and explain in simple terms.

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-11-04 10:30
    They output a small voltage dependent on the magnetic field. You would probably need to amplify the voltage and then measure it with an analog to digital converter.

    John Abshier
  • c.asmithc.asmith Posts: 15
    edited 2013-11-04 11:10
    Hi, John,

    Which pins are for power, and which pins are for output do you know?

    Cheers,

    Cam.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-11-04 12:07
    c.asmith wrote: »
    Hi, John,

    Which pins are for power, and which pins are for output do you know?

    Cheers,

    Cam.

    Page 3 (marked 14) of the datasheet you linked to has a pin diagram.
  • c.asmithc.asmith Posts: 15
    edited 2013-11-04 12:30
    Hi, Duane,

    Thank you for the information. I notice that it says input between 1 and 24 volts. Is that not a crazy amount of voltage for a small chip? I've always seen things that need 3.3 or 5 volts. Also, is it asking for DC or AC voltage?

    Cheers,

    Cam.
  • jonesjones Posts: 281
    edited 2013-11-04 14:21
    Cam - If you look at the diagram on the right side of page 14, you'll see that the device is actually just four resistors, two of which are sensitive to the magnetic field. The voltage limit is because the more voltage you apply, the more current will flow and eventually the chip will get too hot. Since you want the output to be DC, you should apply DC voltage to pin 8 (and ground to pin 4).

    This device is "ratiometric", meaning the output changes proportionally with the power supply. In other words, for any given magnetic field, if you double the power supply, you double the output. Notice also that the output voltage is pretty small. The maximum sensitivity, according to the datasheet, is 4.2 mV/V-Oe, and the maximum magnetic field is 15 Oersteds (equal to 15 gauss in air. To give some idea of how much that is, the earth's magnetic field is roughly 0.4 gauss). So if your chip has the maximum sensitivity and you put it in the maximum field, you will see 63 millivolts of output per volt of power supply. So if the supply voltage is one volt, in the conditions I described the output will be 63 mV. If you double the supply to 2 volts, the output also doubles to 126 mV. If you use the maximum supply voltage of 24 volts, the output rises to about 1.5 volts. So even with the supply as high as you can go, and the magnetic field as high as this device can measure, you still only get about 1.5 volts out so you're still in the range of typical A/D converters. You will probably be using this with the same voltage as whatever other devices are in your circuit (5V for example) so the output will be much less and you'll want some sort of amplifier to scale the output up so you can measure it with an A/D converter. Note also that the 15 Oersteds (gauss) is the saturation level, which means at or above that field you get the same output even if you increase the magnetic field. To the extent possible you should stay within the linear range the datasheet gives which is 1.5 - 10.5 Oe. In that range, doubling the field doubles the output. Outside that range (e.g. less than 1.5 Oe), the relationship between output and field isn't strictly proportional and if you want if to be accurate you'll have to calibrate it against a known field, which can be done but is a pain in the neck.

    Notice also that the chip is directional, with the max sensitivity parallel to the long axis of the chip. If the field is parallel to that you'll see maximum output. If you rotate the chip to be perpendicular to the field, the output will be zero. In between the output will scale as the cosine of the angle between the chip and the field.

    Bob
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-11-04 14:28
    c.asmith wrote: »
    Hi, Duane,

    Thank you for the information. I notice that it says input between 1 and 24 volts. Is that not a crazy amount of voltage for a small chip? I've always seen things that need 3.3 or 5 volts. Also, is it asking for DC or AC voltage?

    Cheers,

    Cam.

    I'm guessing here, but it looks like the chip doesn't have a digital component so it can handle the higher voltage. It's just a Wheatstone bridge where a couple of the segments of the bridge are affected by the magnetic field. My guess is it's asking for DC voltage.

    You might want to tell us your ultimate goal. Someone around here may know of a better sensor for your application.
  • kwinnkwinn Posts: 8,697
    edited 2013-11-04 20:06
    As Duane posted this chip consists of 4 GMR resistors oriented and connected in a wheatstone bridge circuit so it can operate on DC or AC input (excitation) voltages. Using DC makes for a simpler circuit at the cost of some accuracy, and using AC provides better accuracy but requires more complex circuitry.
  • c.asmithc.asmith Posts: 15
    edited 2013-11-04 20:44
    Thank you everyone for your help :)

    Kwinn, thank you for the info. I have two questions:

    1. Why would AC make it more accurate, and how would you go about creating an AC single to this chip? I was thinking of using a transistor and placing the voltage on and off on the base very quickly would this do the trick?

    Cheers,

    Cam.
  • c.asmithc.asmith Posts: 15
    edited 2013-11-04 20:47
    This was an excellent post Bob. Thank you so much! I really appreciate it! You lost me a bit with the directional part. I think your trying to say that I must place the chip in the same direction as the charged item i'm scanning. Is that correct?
    jones wrote: »
    Cam - If you look at the diagram on the right side of page 14, you'll see that the device is actually just four resistors, two of which are sensitive to the magnetic field. The voltage limit is because the more voltage you apply, the more current will flow and eventually the chip will get too hot. Since you want the output to be DC, you should apply DC voltage to pin 8 (and ground to pin 4).

    This device is "ratiometric", meaning the output changes proportionally with the power supply. In other words, for any given magnetic field, if you double the power supply, you double the output. Notice also that the output voltage is pretty small. The maximum sensitivity, according to the datasheet, is 4.2 mV/V-Oe, and the maximum magnetic field is 15 Oersteds (equal to 15 gauss in air. To give some idea of how much that is, the earth's magnetic field is roughly 0.4 gauss). So if your chip has the maximum sensitivity and you put it in the maximum field, you will see 63 millivolts of output per volt of power supply. So if the supply voltage is one volt, in the conditions I described the output will be 63 mV. If you double the supply to 2 volts, the output also doubles to 126 mV. If you use the maximum supply voltage of 24 volts, the output rises to about 1.5 volts. So even with the supply as high as you can go, and the magnetic field as high as this device can measure, you still only get about 1.5 volts out so you're still in the range of typical A/D converters. You will probably be using this with the same voltage as whatever other devices are in your circuit (5V for example) so the output will be much less and you'll want some sort of amplifier to scale the output up so you can measure it with an A/D converter. Note also that the 15 Oersteds (gauss) is the saturation level, which means at or above that field you get the same output even if you increase the magnetic field. To the extent possible you should stay within the linear range the datasheet gives which is 1.5 - 10.5 Oe. In that range, doubling the field doubles the output. Outside that range (e.g. less than 1.5 Oe), the relationship between output and field isn't strictly proportional and if you want if to be accurate you'll have to calibrate it against a known field, which can be done but is a pain in the neck.

    Notice also that the chip is directional, with the max sensitivity parallel to the long axis of the chip. If the field is parallel to that you'll see maximum output. If you rotate the chip to be perpendicular to the field, the output will be zero. In between the output will scale as the cosine of the angle between the chip and the field.

    Bob
  • kwinnkwinn Posts: 8,697
    edited 2013-11-04 23:15
    c.asmith wrote: »
    Thank you everyone for your help :)

    Kwinn, thank you for the info. I have two questions:

    1. Why would AC make it more accurate, and how would you go about creating an AC single to this chip? I was thinking of using a transistor and placing the voltage on and off on the base very quickly would this do the trick?

    Cheers,

    Cam.

    Using AC gives better results because it tends to cancel out any offset voltages that affect accuracy. Think of it as being similar to differential signalling (one wire positive, the other negative and vice-versa) versus ground referenced signalling. Any noise affects both differential signals equally but since you are looking at the difference between them the noise cancels out. Of course nothing is free, so you pay for using AC with a more complex circuit.

    Using a transistor as you described would not work. You need an opamp and an adc to make any use of this device. The opamp would amplify the signal to a level the adc could use, and the resulting measurement could be displayed or used by a micro.
  • c.asmithc.asmith Posts: 15
    edited 2013-11-05 09:37
    kwinn wrote: »
    Using AC gives better results because it tends to cancel out any offset voltages that affect accuracy. Think of it as being similar to differential signalling (one wire positive, the other negative and vice-versa) versus ground referenced signalling. Any noise affects both differential signals equally but since you are looking at the difference between them the noise cancels out. Of course nothing is free, so you pay for using AC with a more complex circuit.

    Using a transistor as you described would not work. You need an opamp and an adc to make any use of this device. The opamp would amplify the signal to a level the adc could use, and the resulting measurement could be displayed or used by a micro.

    Thank you so much for this information :) I've finished reading the Whats a Microcontroller book, and i'm reading Make Learn Electronics (Book) after that i'm going to read the Anlog and Digital Book from parallax. Do you feel after reading those books I might have a good chance of getting this sensor to work?

    BTW: I'm a full-time software developer.

    Thank you for your help.

    Cam
  • jonesjones Posts: 281
    edited 2013-11-05 09:49
    c.asmith wrote: »
    This was an excellent post Bob. Thank you so much! I really appreciate it! You lost me a bit with the directional part. I think your trying to say that I must place the chip in the same direction as the charged item i'm scanning. Is that correct?

    Magnetic fields have direction. If you google "magnetic field" you'll see the classic diagrams showing the lines of flux that run between the north and south poles. Those flux lines show the orientation of the field at that location and if you want maximum sensitivity the long axis of the chip should be parallel to the flux lines. Depending on what is creating the field sometimes it's obvious what orientation would provide maximum sensitivity and sometimes it's not, and if the sensor is moved over a magnet the field direction will change depending on the relative positions.

    What is it that you're trying to do?
  • kwinnkwinn Posts: 8,697
    edited 2013-11-05 20:14
    c.asmith wrote: »
    Thank you so much for this information :) I've finished reading the Whats a Microcontroller book, and i'm reading Make Learn Electronics (Book) after that i'm going to read the Anlog and Digital Book from parallax. Do you feel after reading those books I might have a good chance of getting this sensor to work?

    BTW: I'm a full-time software developer.

    Thank you for your help.

    Cam

    Yes, I think between those books and asking for help on the forum you can get this sensor to work. The input and output signals for this sensor are very similar to what is used in load cells for measuring force/weight so there are schematics, chips, and articles on the web that could be used as a starting point.
  • c.asmithc.asmith Posts: 15
    edited 2013-11-06 06:40
    Thank you everyone for your help :) This blog is really helpful :)

    Have a great day,

    Cam.
Sign In or Register to comment.