Author Topic: Help with a wind meter project  (Read 2041 times)

drsprite

  • NewMember
  • *
  • Posts: 41
Help with a wind meter project
« on: March 01, 2021, 11:14:42 AM »
Hi all, I'm setting up a wind anemometer which will send a measurement packet every 2.5 seconds. I plan to power it off of an 18650 3.7-4.2v battery, a tp4056 charger and a 6v solar panel.

Right now I'm using an esp32 (nodemcu variant) and using the ULP co-processor to count the anemometer pulses while the esp sleeps. Then it wakes up, gets the co-processor reading, sends the packet using an RFM95W, then back to sleep. I have the esp32 using deep sleep, no bluetooth, no wifi, CPU is at 10mhz and removed the LEDs. It's working pretty ok unless I have 2 days without sun then the battery dies.

My series of questions:

1. Is Moteino a better choice for this type or project?
2. If I sleep the motino then I can't count pulses, right?
3. So I'd still need something else like an attiny85 to count pulses, right?
4. Or is the Moteino truly power efficient that I don't need an attiny85 and I don't need to sleep it?

Looking for guidance if possible
« Last Edit: March 01, 2021, 11:18:50 AM by drsprite »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help with a wind meter project
« Reply #1 on: March 01, 2021, 12:34:11 PM »
Sounds like your anemometer needs permanent power.
You need to sleep everything including sensors and anything that uses power, and only take readings before you transmit. Or find another anemometer that doesn't need permanent power.
Otherwise its not low power and you need a way to power your project permanently.
You could perhaps use the hardware interrupt pin 3 of the Moteino to count pulses in between wakes.

drsprite

  • NewMember
  • *
  • Posts: 41
Re: Help with a wind meter project
« Reply #2 on: March 01, 2021, 12:43:08 PM »
It doesn't need power (I don't think). I connect 1 wire to an input pin and the other to ground, and as it spins it goes low. That's how it gets counted. If the Moteino is sleeping, is it still able to count interrupts?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help with a wind meter project
« Reply #3 on: March 01, 2021, 01:44:41 PM »
Yes it wakes and hits the interrupt routine with every pulse. You just need to increment a volatile variable and go right back to sleep.
There is a pulse counting example in this sketch, but this sketch does not sleep.
So in loop() you just go back to sleep after your interrupt is complete. This is of course valid on a Moteino with RFM69. I believe it should last a lot longer than 2 days if properly put to sleep.

drsprite

  • NewMember
  • *
  • Posts: 41
Re: Help with a wind meter project
« Reply #4 on: March 01, 2021, 02:05:00 PM »
Since this is a wind meter, that's constantly spinning (unless there's no wind), wouldn't that mean the mote would never sleep if the interrupt is always waking it? Could be bad for battery life?

Uncle Buzz

  • Full Member
  • ***
  • Posts: 146
  • Country: fr
Re: Help with a wind meter project
« Reply #5 on: March 01, 2021, 02:44:04 PM »
Not cheap, but maybe something like this counter chip at typically 10nA while counting (if I have read the datasheet correctly) could be a good companion to the moteino for this application.

drsprite

  • NewMember
  • *
  • Posts: 41
Re: Help with a wind meter project
« Reply #6 on: March 01, 2021, 03:11:57 PM »
Interesting - I've never used one of these. I've got some reading to do on how to integrate it

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help with a wind meter project
« Reply #7 on: March 01, 2021, 04:00:04 PM »
Since this is a wind meter, that's constantly spinning (unless there's no wind), wouldn't that mean the mote would never sleep if the interrupt is always waking it? Could be bad for battery life?
I don't think so. What is the pulse frequency at the highest wind? Does the wind blow all the time?
The interrupt is very quick, just wakes + increments, then loop puts everything back to sleep.
Ultimately you have to measure. Or just use an external low power counter if the power savings are really worth the expense and extra code.

drsprite

  • NewMember
  • *
  • Posts: 41
Re: Help with a wind meter project
« Reply #8 on: March 01, 2021, 04:45:01 PM »
I don't think so. What is the pulse frequency at the highest wind? Does the wind blow all the time?
The interrupt is very quick, just wakes + increments, then loop puts everything back to sleep.
Ultimately you have to measure. Or just use an external low power counter if the power savings are really worth the expense and extra code.

Yeah the wind seems to always be blowing. Right now it counted 46 revolutions in 2.5 seconds (equating to 34mph). That's most certainly a gust... average seems to be somewhere from 10-20 counts within 2.5 seconds. Overnight would be less - maybe 0-5 counts every 2.5 seconds. I don't know how that would be a battery savings if I'm constantly waking the mote up though? I'd rather not an external counter unless it makes sense?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help with a wind meter project
« Reply #9 on: March 01, 2021, 04:50:06 PM »
Ok ... you're waking it for a few microseconds to increase the count. Or just measure the wake to know for sure.
Then you wake it when its time to send the packet, that's a much bigger hit than a simple edge that triggers an interrupt.

I'd rather not an external counter unless it makes sense?
Yeah me neither, not without a real reason!

drsprite

  • NewMember
  • *
  • Posts: 41
Re: Help with a wind meter project
« Reply #10 on: March 01, 2021, 04:58:47 PM »
Ok interesting. Sounds like it's not a big battery hit in this method