Forum Replies Created

Viewing 15 posts - 181 through 195 (of 196 total)
  • Author
    Posts
  • in reply to: RF95 test sketch is not working #4854
    LIM PHANG MOH
    Keymaster

    Hi,

    First check, are both USB connected to a PC with a terminal open?

    while (!Serial) ; // Wait for serial port to be available

    This will wait for the serial port (in this case USB) to open before running the remaining of the codes. With the default radio configuration, it will even run without antenna for few meters.

    • This reply was modified 7 years, 5 months ago by LIM PHANG MOH.
    in reply to: Weatherproofing project #4723
    LIM PHANG MOH
    Keymaster

    I would definitely suggest using some sealant/epoxy to tighten everything up on holes that you drill on the enclosure.
    And it’s best to orient the holes facing downwards although you might have already seal them.
    The amount of heat that we get here in tropical area is crazy close to 50 Degree Celsius inside the enclosure based on our past experience. 25-30 Degree Celsius is really a very accommodating range. Below 0 Degree Celsius, I doubt that the Li-Ion would charge effectively although it can still be used to power still down to -20 Degree Celsius.

    Also if possible, do add some desiccant packs, it really helps.

    in reply to: Current Spikes with Low Power #4704
    LIM PHANG MOH
    Keymaster

    Glad that it work.

    in reply to: Current Spikes with Low Power #4700
    LIM PHANG MOH
    Keymaster

    Can you give me a link to Ver.1.50 or above?

    You can install from the Arduino IDE library manager itself.
    But, if you want to install it manually, here you go.

    in reply to: Current Spikes with Low Power #4698
    LIM PHANG MOH
    Keymaster

    Version:1.40

    This is the root cause. Please use version 1.50 and above. It’s a compiler optimization issue which causes the BOD to be enabled without you noticing it.

    for(byte pin = 0; pin<22; pin++)
    {
    pinMode(pin,OUTPUT);
    digitalWrite(pin,LOW);
    }

    You don’t have to.

    in reply to: Current Spikes with Low Power #4696
    LIM PHANG MOH
    Keymaster

    With WDT enabled, it would add around 4 uA on top of the 0.1 uA of the chip in power down.
    So, there’s some stuff still sucking some current somewhere in your setup. I just tested my Mini Utra 8 MHz and it is 1.7 uA (on-board regulator consume 1.6 uA) in power down. Turning on the WDT of 8 s results in 6.0 uA which is spot on with the values from the datasheet.
    Using Arduino IDE 1.6.8. Meter has a 0.1uA resolution. Running at 5V & 3.3V shouldn’t be that far off.

    The regulator totally removed from the board?

    in reply to: Current Spikes with Low Power #4694
    LIM PHANG MOH
    Keymaster

    A multimeter has a very slow refresh rate compare to what is being captured actually. If you use a small resistor and measure the voltage across it at the input supply and use an oscilloscope, you might see the timing more accurately.

    Are you using the latest version of the library? I asked because if you are not, the previous version might not compile correctly on the latest Arduino IDE 1.6.x branch due to the compiler optimization. The BOD will not be turned off although the code says so due to this optimization. BOD has strict timing in terms of instruction cycle to turn it off. Too fast or too fast will not get it to turn on/off accordingly. Your 28 uA is giving me that impression.

    Other than that, just make sure all pins are output low.

    And, what multimeter are you using and what is the resolution of the DC uA range?

    in reply to: Current Spikes with Low Power #4688
    LIM PHANG MOH
    Keymaster

    Hi,
    It should be due to this:

    for (i = 0; i < wdtCounter; i++)

    But, how long does this duration of the spike? In any case, it should not be even noticeable, as that line of code execute is few us.
    To even improve your code, if your maximum argument does not exceed 255 (unsigned char), then use unsigned char as your argument. Using the int variable would mean using 16-bit signed variable. The comparison that take place in the loop when converted into machine code will yield different results. And if you can, do a count down instead of count up implementation. That way, in the machine code, it only need to do a compare zero routine which the AVR core has a single instruction to do just that.

    And regarding the amount of 0.028mA, is there anything else connected? Even wires that leads to nowhere?

    in reply to: No member named 'powerDown' #4671
    LIM PHANG MOH
    Keymaster

    Hi Dean,

    I was originally planning to do something like this:

    // Put the Beecvr to sleep. Enters the RSUltra into sleep mode.
    void gotoSleep (uint8_t dur) {
    uint16_t counter = 0;
    uint16_t sleepCount;

    // put the Beecounter to sleep
    digitalWrite(pwrPin, LOW); // cut power to the Beecounter
    digitalWrite(ploadPin, LOW); // as well as the pload pin on the Beecounter

    // put the XBee to sleep
    pinMode(xbee_sleeprq_pin, INPUT); // use internal pullup to pull pin to 3.3V

    // put the RSUltra to sleep
    sleepCount = hourWDTinterval * dur;
    while(counter < sleepCount) { // enter powerDown mode LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); // iterate the counter counter++; } wakeup(); }

    Okay, that code will only work with AVR based Arduino. You can either use the :

    • LowPower library together with an external RTC module to wake up perioidcally through attachInterrupt().
    • RTCZero library without LowPower library (the RTCZero library has a simple function to put into standby mode). The built-in RTC in the Mini Ultra Pro board can be used to wake up the processor with any desired period of time as it has calendar support. You can try to work from this example.

    Please let me know if you have any questions.

    I’m sorry if the response was slow for the past few days, I was away on an emergency.

    • This reply was modified 7 years, 10 months ago by LIM PHANG MOH.
    in reply to: Trouble understanding how the library works. #4670
    LIM PHANG MOH
    Keymaster

    I’m really confused now. In a previous post you said that the only mode currently supported is the standby() function. The powerDownWakePeriodic example uses: LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

    which I believe you said won’t work the mini ultra?

    I’m sorry because I thought you were referring to the normal AVR based MCU in this particular thread.
    I will answer your question in your original thread.

    I have done some progress. I inserted a serial flush() in my code and now the serial print command seems to work as it should.

    Yes, you need to use Serial.flush() to ensure all characters are transmitted out before the device go into sleep which will power down the serial interface. Some people use delay(), but Serial.flush() is the correct way to do it.

    If I put the LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); function in a for loop. Will the sleep time increase times the number of loops?

    You can do something like this:

    LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
    if (sleepCounter++ >= SLEEP_DURATION)
    {
      // Do your sensor acquisition, data logging, data transmission, etc here
      // Reset the sleep counter
      sleepCounter = 0;
    }

    Declare the sleepCounter variable using appropriate variable type that can hold the maximum value you intended. The constant SLEEP_DURATION is the sleep duration of you wanted in order to achieve (SLEEP_DURATION x 8 s).

    in reply to: No member named 'powerDown' #4665
    LIM PHANG MOH
    Keymaster

    Hi Dean,

    Looks like either your library is not installed properly or missing.
    Please post your code here using the code tags.

    in reply to: Trouble understanding how the library works. #4664
    LIM PHANG MOH
    Keymaster

    Hi StefanA & Dean,
    Best place to start is the powerDownWakePeriodic example.

    Can you guys post your code here?

    in reply to: No member named 'powerDown' #4642
    LIM PHANG MOH
    Keymaster

    Hi Dean,

    On Arduino Zero, only the standby function is currently supported.
    But, you can use the RTC (using the RTCZero library) functionality to wake the processor up to any period of time according to your need but in seconds resolution.

    in reply to: Problem with lowPower and mysensors #4629
    LIM PHANG MOH
    Keymaster

    There seems to be same definition used in the MyHwATMega328.h which is also defined in LowPower.h.
    I’m not familiar with mysensors, but if you can change that enum naming in MyHwATMega328.h file into something else, that would solve the problem.

    in reply to: SLEEP_MODE_EXT_STANDBY not declared on ATMega168 #4143
    LIM PHANG MOH
    Keymaster

    Ralf,

    It seems that extended standby is not supported on the ATmega168. I must have been referring to the avrlibc distribution instead of the datasheet while writing the library. Will do a patch to restrict the usage only to the chips having the extended standby mode support. For now, refrain from using that mode.

Viewing 15 posts - 181 through 195 (of 196 total)