Geiger Counter and Sleep mode

Post Reply
M_o7ammed
Posts: 24
Joined: Fri Sep 07, 2018 9:37 pm
Company: Khalifa University

Geiger Counter and Sleep mode

Post by M_o7ammed » Mon Sep 10, 2018 9:38 am

Hi,

I'm working on a project where I need to take measurements using the Geiger Tube and Waspmote. Also, I need to turn Waspmote into sleep mode whenever the sensor is not sensing anything, but I got confused while using the Sleep mode and I got lost. Can someone provide me with the appropriate code for my situation or at least guide me to the right approach???

Thanks.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Geiger Counter and Sleep mode

Post by libelium-dev » Mon Sep 10, 2018 10:25 am

Hi,

Which specific problems do you have with sleep mode?

Please take a look into the interruption programming guide for more info about sleep modes. Also please be sure you're using our last API version.

Regards

M_o7ammed
Posts: 24
Joined: Fri Sep 07, 2018 9:37 pm
Company: Khalifa University

Re: Geiger Counter and Sleep mode

Post by M_o7ammed » Mon Sep 10, 2018 10:39 am

For example, whenever I use one of these commands, I get an error that it is not defined or not available.

{
// case 1: switch off all power supplies
PWR.sleep(ALL_OFF);

// case 2: sensor board power supply remains on
PWR.sleep(SENSOR_ON);

// case 3: SOCKET0 power supply remains on
PWR.sleep(SOCKET0_ON);

// case 4: Both SOCKET0 and sensor power supply remain on
PWR.sleep(ALL_ON);
}

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Geiger Counter and Sleep mode

Post by libelium-dev » Mon Sep 10, 2018 12:51 pm

Hi,

Which error do you get? Could you please share with us your full code?

In any case you should use deepSleep function for your purpose. Please take a look into the example code.
http://www.libelium.com/development/was ... leep-mode/

Regards

M_o7ammed
Posts: 24
Joined: Fri Sep 07, 2018 9:37 pm
Company: Khalifa University

Re: Geiger Counter and Sleep mode

Post by M_o7ammed » Mon Sep 10, 2018 5:08 pm

I'm just trying the available examples:

Code: Select all

#include <WaspPWR.h>
#include <waspPWR.cpp>

void setup()
{
  USB.ON();
  USB.println(F("PWR_1 example"));
}

void loop()
{
  USB.println(F("enter sleep"));

  // Go to sleep disconnecting all the switches and modules
  // After 8 seconds, Waspmote wakes up thanks to internal watchdog
  /* Other possible values are:
      WTD_16MS:  16ms
      WTD_32MS:  32ms
      WTD_64MS:  64ms
      WTD_128MS: 128ms
      WTD_250MS: 250ms
      WTD_500MS: 500ms
      WTD_1S:    1s
      WTD_2S:    2s
      WTD_4S:    4s
      WTD_8S:    8s
  */
  PWR.sleep(SENSOR_OFF);

  USB.ON();
  USB.println(F("\nwake up"));

  // After wake up I check intFlag and blink LEDs
  if ( intFlag & WTD_INT )
  {
    USB.println(F("---------------------"));
    USB.println(F("WTD INT captured"));
    USB.println(F("---------------------"));
    Utils.blinkLEDs(300);
    Utils.blinkLEDs(300);
    Utils.blinkLEDs(300);
    intFlag &= ~(WTD_INT);
  }

}

And I keep getting this error:

Code: Select all

exit status 1
'SENSOR_OFF' was not declared in this scope

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Geiger Counter and Sleep mode

Post by libelium-dev » Tue Sep 11, 2018 9:52 am

Hi,

What API do you use?

SENSOR_OFF isn't declared in the last API v035. Here you can find the options that your can use
http://www.libelium.com/downloads/docum ... df#page=11

Regards

M_o7ammed
Posts: 24
Joined: Fri Sep 07, 2018 9:37 pm
Company: Khalifa University

Re: Geiger Counter and Sleep mode

Post by M_o7ammed » Sun Sep 16, 2018 12:32 pm

Thanks, It's working now :))))

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Geiger Counter and Sleep mode

Post by libelium-dev » Mon Sep 17, 2018 9:25 am

You're Welcome!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest