Low Power

  • 6 Replies
  • 699 Views
*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 695
    • 1998 12v Ram
Low Power
« on: July 20, 2015, 11:14:28 AM »
Well since I redid my whole radio / lbb box setup... I really didn't want to use the radio accessory power to power the little guy.

Just running on straight always on battery power from the upper cigarette lighter, but then I'm concerned on power usage.. not like it'll ever drain 2 batteries in its lifetime, but no sense in wasting power if you don't have to.

Enter low power stuff

So I nabbed a simple low power library that uses the watchdog to wakeup the arduino. Instead of an interrupt... which imho is a waste of a pin, and the code is never going to fault out and break.. pretty robust.

So the library is in the library thread, Arduino Libraries

In main includes
Code: [Select]
#include <LowPower.h>

Loop adjustment
Code: [Select]
void loop() {
  // Sleep
  unsigned int sleep = 0;

Code: [Select]
    // Freq Measure
    if (FreqMeasure.available()) {
      sleep = 0;
      [...]
    } else {
      sleep++;
    }
    if (sleep > 33000) {
      if (serial_out) { Serial.println("Going to sleep"); }
      delay(10);
      LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
      delay(10);
      if (serial_out) { Serial.println("Waking up"); }
      sleep = 0;
    }

else falls out to a 1ms delay, that counts up to 1second, if no frequency updates in a second, fall out to full sleep for 8 seconds, reset timer, and repeat.

Working pretty stout so far. I haven't measured draw but I'm expecting atleast 10mA less draw.
AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.


*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 995
  • Jack of all trades
    • '94 Dodge dually
Re: Low Power
« Reply #1 on: July 20, 2015, 11:24:23 AM »
I was wondering about the same thing... I was just going to see what I could do to kill the power to all the externals at least.. stepper driver, CAN, etc.

I think you can do a software reclock on the arduino and bring it down to a couple MHZ to reduce power... On a Mega that has a ton of extra digital IO's you could poll every second or whatever and if it's been powered off for X number of cycles, lower the clock speed.
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Offline me78569

  • Sr. Member
  • ****
  • 274
Re: Low Power
« Reply #2 on: July 20, 2015, 12:57:27 PM »
Why not just run your power from a keyed power source?  you could use a relay if you wanted to I suppose.
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 695
    • 1998 12v Ram
Re: Low Power
« Reply #3 on: July 20, 2015, 01:03:04 PM »
Waaaaaay to lazy for that, LOL

30-40mA is not even a real draw anyways.
AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.


*

Offline me78569

  • Sr. Member
  • ****
  • 274
Re: Low Power
« Reply #4 on: July 20, 2015, 03:29:54 PM »
Got ya.  I ran mine on the same lead as my tuner ignition sense so it was easy.

Are you cycling the veins ever to clean them?
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 695
    • 1998 12v Ram
Re: Low Power
« Reply #5 on: July 20, 2015, 04:21:35 PM »
Ya when the box is turning on it takes a whole second to send position, so it defaults to full open, then starts to close.
AMP 2 Corinthians 8:21
For we take thought beforehand and aim to be honest and absolutely above suspicion, not only in the sight of the Lord but also in the sight of men.


*

Offline me78569

  • Sr. Member
  • ****
  • 274
Re: Low Power
« Reply #6 on: July 20, 2015, 04:36:12 PM »
Duh,


With no measure it will go wide open haha.  My mind is mush.
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj