This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2744: Use GPIO to power on a hall effect sensor



Hi, experts,
We'd like to use a hall effect sensor in our application, to replace our mechanical switch in our old design. In order to reduce power consumption as much as possible, we plan to use a GPIO to power on the sensor, so that it could be powered off completely when this function is not needed (for example during nights).
Some basic parameters of the sensor is followed:
1. supply current when chip enable: 4mA max
2. supply current when chip disable: 12 uA
3. Awake time: 50us
4. Period: 50ms

I think it should be OK to connect two GPIO together as the power supply for the sensor, as a single GPIO could provide max 6mA. I am not sure if there are other things to consider.
For example, when GPIO is output high, it will source 4mA for 50us and then 12uA for about 50ms, and repeat the procedure. Is this OK for GPIO?

Thanks

  • I don't see any problem. If your sensor doesn't mind getting about 0.2-0.3V less than the supply of the microcontroller you can take only one pin. Remember that drawing more current will lead to lower output voltage.

    You can also add a simple PNP to power your sensors, having no trouble with (possible) higher currents.

    Dennis
  • Powering a sensor form a GPIO pin is not a good idea. Depending on the supply current, the voltage drop on the pin varies. If the sensor has a varying supply current (and hall sensors usually have), this makes the supply voltage change and this directly changes the sensor output. Usually a hall sensor has an output of 50% of the supply voltage at no current. So if the supply changes due to a current change, this changes the output as well, an you don't know what you're reading.
    But you mention "when chip disable: 12µA", so apparently your sensor has an enable/disable input. Use it. Unless you can't afford those 12µA. Then I recommend a P-channel FET in the supply, driven by an MSP I/O pin.
  • Hi, 

       I didn't quite understand your comment. In my application, the sensor will consume max 4mA, and one GPIO can provide 6mA. So if I use two GPIO as the Vcc for the sensor, I think there should be no (or only very small) voltage drop. Am I right?

  • It's not about how much current the I/O pin can provide, it is about the different voltage drop on the pin driver at different loads.
    Assuming the sensor currently draws3mA. Then the voltage drop on the I/O pin will be 0.3V (VCC=3V). So the sensor has 2.7V supply voltage. It's output voltage on no current will be 1.35V. Now the sensed current increases. The sensor takes 4mA. This causes a voltage drop of 0.4V. The sensor now has only 2.6V supply, which drops the output voltage for zero current to 1.3V, plus the increase caused by the measured current. Once the system has swung into, the sensor current consumption drops to 3mA again, which will cause the drop on the pin to decrease, the sensor voltage to increase and the zero-current output voltage will change back to 1.35V, causing the reading to increase without any change in the sensed current.
    You'll never know what your sensor means when its supply changes with any change of its current draw.
  • Hi Jens-Michael Gross

      Thanks for you detailed explanation, but as a software engineer, I don't what it means by " It's output voltage on no current will be 1.35V". 

      As per my understanding, you seem to be talking about this issue assuming the sensor outputs some analog voltage. In my application, the sensor outputs a digital single, either high or low. So I think some voltage drop should be acceptable, as long as it's not serious enough to make MCU misinterpret its high output as low.

      Thanks

  • The hall sensors I have worked with do emit an output voltage that is 0.5*VCC when not exposed to a magnetic field. The output changes with 50% of the VCC change.
    Thia is because those sensors simply have an OpAmp with a virtual GND on 1/2 VCC whose inputs are connected to both sides of the sensor element.
    In my applications, the hall sensors were used to measure a current, where the field through the sensor is proportional to the current flowing through a magnetic core.
    That's why I wrote about 'no current', but actually I meant 'no magnetic field'. Sorry for confusing you.

    If you only want to detect the presence of a magnetic field, without need to precisely determine the strength of the field, then the stability of the supply voltage isn't that important.

**Attention** This is a public forum