Wake up arduino only (without radio)?


  • Hero Member

    Is there a way to wake up arduino only (without the radio)? I'd like to wake the arduino on each min in order to collect data (i.e. energy meter), but to save battery I'd transmit it only each hour or so...


  • Hero Member

    Ive never done it, but I recall reading about the idea where the radio is only powered when the arduino sets an output pin high, switching on a transistor which provides the power to the radio...


  • Admin

    @rvendrame
    Are you talking about when using mysensors library or in a more general term?


  • Hero Member

    @hek, mySensors-specific, I don't know anything else πŸ˜‰

    It is just a thought anyway --- Maybe the radio consumption is very low if not transmitting so any extra measure is worthless?


  • Hardware Contributor

    @rvendrame: I am working to get ultra low power with mysensors. still in testing as I am debugging my board. I will post my results soon.

    First watchog is consuming a little power (10-15uA I think). But you need it to wake up at interval. Other way is to wake up on pin interrupt, less consuming. But you need something to trigger. I am using a voltage supervisor with capa discharging for that. So when in powerdown I am sub-uA (I have done my sleep routines). I know it doesn't need to be sub uA as there is battery discharge rate. but could be useful sometimes and it is a good exercise!
    .
    I think you will use watchdog as Mysensors lib use it. So you could power off radio with mosfet, then go to sleep. Wake up and increment counter each time you wake up. When you reach your totalcounter (for 1h hour) power on radio. But you will need to reinit it. So I added an initRadio method in Mysensors class for my purpose as you cannot access it (Am I right @Hek? Do you think it could be possible to have this in future version, could be useful sometimes. I have not checked it, or maybe there is better way?). Public, like this :

    // InitRadio
    void initRadio(rf24_pa_dbm_e paLevel=RF24_PA_LEVEL, uint8_t channel=RF24_CHANNEL, rf24_datarate_e dataRate=RF24_DATARATE);

    But when you power off radios, i2c... there are tricks to do as some pins miso,mosi...sda..can break low power. and you need to set pins output=0 or input sometimes it depends what is connected. I had a lot of pains with i2c power off. now it is ok. I will post soon I hope.


  • Hero Member

    @scalz, thanks a lot. Yes, I was afraid to cut radio power, I thought it would have to be reinit. Please let me know once you have your code done.

    I guess simply by calling gw.begin() would not be enough right? Or it will consume too much, as it will handshake/presenting the node,etc again?


  • Admin

    @scalz

    As MySensors is a subclass of RF24, so you can re-do any initialisation directly on the "gw"-object. I think you have to re-init the following parts:

    https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MySensor.cpp#L95-L112
    and
    https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MySensor.cpp#L137-L138


  • Hardware Contributor

    @rvendrame: I was saying this in general as I am trying this actually. I know for rfm there are tricks. but for nrf I had no problems. I don't call gw.begin again as it would do consuming comm. This is why I added a method in Mysensors class to reinit nrf.

    what you could do if you want to make tests:

    1. init a wakeupcounter
    2. if wakeupcounter = 0 or = countCycle (a define for exemple)
      then do stuff (power on mosfet, reinit radio, get sensors value)
    3. power off mosfet
    4. gw.sleep(xx ms)
    5. on wake up increment wakeup counter

    Maybe I missing something as I am not in front of my work. but it is something like this. I have no problem with radio, no fails. and GW see all comms.

    @hek: I saw that it was subclass but was thinking setupradio was protected so I did this in mysensors class. But I will try what you're saying. thank you.

    	// InitRadio in .h
    	void initRadio(rf24_pa_dbm_e paLevel=RF24_PA_LEVEL, uint8_t channel=RF24_CHANNEL, rf24_datarate_e dataRate=RF24_DATARATE);
    
    // in .cpp
    void MySensor::initRadio(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e dataRate) {
    	setupRadio(paLevel, channel, dataRate);
    }

  • Hero Member

    @scalz, @hek , thanks a lot! Final question, do we really need a mosfet? Wouldn't 20mA from any digital pin enough?


  • Hardware Contributor

    @rvendrame: I have never tried to power radio directly from arduino pin. I think it could be possible for nrf but it is 20mA max for arduino pin. for a rfm I think, you can forget it!
    if you want lots of useful infos for power savings : http://www.gammon.com.au/forum/?id=11497 , but maybe you already know it.


  • Hero Member

    @scalz, thanks for the links!



  • Using watchdog as Mysensors is good idea, but is there any other better way to archive same?


Log in to reply
 

Suggested Topics

  • 4
  • 17
  • 2
  • 9
  • 20
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts