0
\$\begingroup\$

enter image description hereI have an ultrasonic sensor (JSN-SR04T) connected to an Arduino. In order to achieve low power consumption i decided that i want to switch the Ultrasonic sensor off for 8 seconds intervals in between , I connected the sensor via a transistor and used a signal from the Arduino to the npn base to control the switching (ON/OFF) of the transistor.

My problem is that the sensor remains on even when i switch of the signal to transistor base. Does anyone know how to solve this. I suspect that the sensor finds its way to ground even somehow

\$\endgroup\$
1
  • \$\begingroup\$ Add an R value between sensor Gnd and Arduino gnd to overcome the leakage current. \$\endgroup\$ Jun 7, 2021 at 19:37

2 Answers 2

1
\$\begingroup\$

If either ECHO or TRIG is low, the sensor will probably be grounded through protection diodes. You could use high-side switching (on VCC instead of GND) but the same applies...you can get voltage from any input through your high-side protection.

Best bet is to use your same circuit as above, but make sure the other inputs are set to 5V when you're power saving.

\$\endgroup\$
2
  • \$\begingroup\$ You mean set to GND/Low output or high-impedance input during low power state, surely? or (what I mean is) you can do that instead without aint the transistor circuit for there other signal connections. \$\endgroup\$
    – vicatcu
    Jun 7, 2021 at 22:09
  • \$\begingroup\$ @vicatcu Set everything low if you're switching power, or high if you're switching ground. Bottom line is that if you deprive it of Vcc or ground, it can still get that connection through other inputs if available, defeating the power saving. \$\endgroup\$ Jun 8, 2021 at 14:31
1
\$\begingroup\$

Disconnect Vcc rather, it is not a good practice to disconnect Gnd becouse there is always some drop on transistor and your Gnd-s voltage level would be shifted.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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