1

I am using a RPI zero to receive some data from sensors. All these sensors use 3.3V supply.

A teacher gave the idea of using the GPIO pins(not the VCC's itself) to supply power to the sensors, so that I'd be able to turn on and off the devices when I want to. It seems to work for some sensors, but others are working only sometimes.

That raised a question to me, is this a bad practice thing?..to use the GPIO pins (like pin 40) to supply power to other devices.

Thanks.

  • what did the teacher say exactly? .... not what you think you heard, but what was actually said. – jsotola May 4 '18 at 4:52
  • @Bruno can you post the connection diagram? – yogece May 4 '18 at 9:26
  • This might help you check it out bit.do/SwItCh – yogece May 4 '18 at 10:04
3

It is not uncommon on an Arduino to use one of the digital pins to supply power to modules. This works OK for low powered devices (the Arduino can supply 20mA.) The usual motivation is to plug devices (such as the DHT22) into the Arduino without intervening wiring.

In principle you could do the same with the Pi to supply up to 16mA, although this would be unlikely to provide 3.3V (you would have to measure the actual voltage) as these are intended to provide logic levels.

Due to the lower voltage on the Pi it is likely to be more problematic, and frankly IMO not worth the trouble, and nothing can plug into the Pi header.

Why you would WANT to control power to a sensor is unclear.

  • 1
    There are some (rare) conditions which are recoverable if you power cycle a sensor. I have used this for a DHT22 which tended to lock up randomly (sometimes after hundreds of thousands of readings). – joan May 4 '18 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.