Turn all Arduino sensors on and off

I am creating a wearable for myself with this mini Arduino:

I have a 500mAh 3.7v battery.

My problem is that I have a sensor that consumes too much electricity, I will not always use that sensor. I want to be able to turn it on and off. What dou you recommend?

I can't use a relay because as I told you, I'm creating a wearable and I have to keep the system small.

Is there a way to turn off (cut all electricity) all the sensors and turn it on when I want?

[Mod edit: See also other question, same project, different question: Problem with DW1000 Indoor Positioning UWB ]

Sure but read and follow this link: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

This li nk could also be helpful: BEGINNERS and LEARNERS read this... - Using Arduino / Project Guidance - Arduino Forum

Depends in part the power requirements for the sensor. If the sensor requires 20mA or less, the uC can "source" the positive voltage (less a small voltage drop.)
Otherwise, the Internet is full of driver circuits: FET, transistor.

This post covers some more details:
Powering sensors with Digital pins instead 5v - Using Arduino / General Electronics - Arduino Forum

And, more
arduino power swirching FET circuit - Google Search

1 Like

I think a MOSFET is my solution. It can be one of this type: https://www.amazon.com/-/es/HiLetg-IRF520-MOSFET-controller-units/dp/B01I1J14MO

But, the PCB is too big for what I want. Do you know if I can unbind it and do it manually?

That is, something like this:

I want to know if it's safe, I'm a complete novice and I don't want to burn anything.

Could be, but this one (IRF520) does not work with a 3.3volt-logic seeeduino,
and is a poor choice for a 5volt-logic Arduino.

Tell us exactly what sensor you are going to use (weblink please),
and this seeeduino is not an Arduino, and a big step up for "a complete novice".
Leo..

1 Like

The sensor that I will use is DW1000, it consumes 160 mAh and in sleep mode it consumes <5mA. It has a function to put it in sleep mode, but the documentation is not clear, that's why I'm looking for an alternative.

This is the library.

Part of my code is (It works to turn it off once it's on, but not to turn it on, I thought I'd do a reset to turn it on again, but it's an unorthodox method) :

void loop() {

  DW1000Ranging.loop();
 
  if (Serial.available()) {
    int state = Serial.parseInt();
    if (state == 1) {
     Serial.println("ON");
     //DW1000.spiWakeup();
     //delay(500);
     //DW1000.reset();
     //DW1000.softReset();
     //delay(200);
     //DW1000Ranging.loop();
    }
    if (state == 2) {
     Serial.println("OFF");
     DW1000.deepSleep();
     delay(500);
    }
  }
 
}

But as I said, an easy solution is to force the sensor off with a MOSFET.

I imagine there are alternatives, right? Another MOSFET?

From the DW1000 datasheet:

  1. SLEEP mode current 1 μA
  2. DEEP SLEEP mode current 50nA

Better investigate that further before thinking of a mosfet kludge.

Or maybe ask this in your cross-post.
Leo..

Has MOSFET for 3.3v and be used in that type of Arduino? I am looking for a quick and easy alternative.

That says it's 3.3v. Are you sure it's not?

If it's safe to switch supply (high-side) or ground (low-side) with a mosfet depends on the idle state of the data lines of the chip.
If you do it wrong, then phantom-powering could easily fry the chip.
Leo..

@raym3d You have 2 different questions about the same project. Asking the same question twice is definitely against the forum rules, asking 2 different questions about the same project is OK but please make it clear in your OP that that's what you are doing. I have added a comment to both questions linking them together.

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.