HOME   PCB269 MAIN PAGE     StumbleUpon.Com Recommend to StumbleUpon

Testing PCB269, the 24/7 power supply for low current projects

(filename: PCB269-Testing.htm)

This page tries to answer two questions: What's a quick test for PCB269, and How much power can it provide?

It assumes that you can program an ATtiny85. If you can program Arduinos, you can program ATtiny85s with very little trouble or expense. All of "the stuff" you need to master to get to the point of being able to program them and their fuses may be a little daunting... but once you are there, you will look back on your adventure and say, I think, "Well... that wasn't so bad". At least it isn't expensive! If you have an Arduino, a breadboard, some wire, and the means of programming the Arduino, you've already bought what you need to buy... apart, of course, from the ATtinys. They cost about $3 each. And run on a breadboard as soon as you give them power. With only 8 pins, 5 of which are GPIO, some of which are capable of things like serial comms, I think you can guess that a lot of fancy support circuitry isn't needed! I'm trying to get at least a rough guide to "How you program ATtinys" out. It isn't online yet (29 Nov 17)... but I hope it will be there by 10 Dec 17... pester me, if this hasn't been changed to a link by then, please?

Testing PCB269

To test PCB269, my board based on Nick Gammon's circuit to provide 24/7 power, using solar panels (or other intermittent source), I programmed another ATtiny85. (There's one in PCB269, too.)

For my tests, I didn't do anything "clever" to make this second ATtiny use as little power as possible.

What it does...

When it starts up, either after a power cycle, or after the /reset line is pulled low for a bit, it repeatedly "blinks" an LED briefly. No rocket science here!

If the user pulls input D1 low for a bit, the LED changes its behavior, does a "double-blink" from then on.


I built this program to test a feature of PCB269.

After failure of the power from PCB269... they can occur! They will occur is Vin is not available for too long, or if the circuits powered by Vout are using too much power.

As I was saying: After a failure of the power from PCB269, when Vout eventually begins to rise again, it may rise slowly. Many systems "don't like" a slowly rising voltage on their supply, and respond by "locking up". This is a "brownout" triggered failure... though perhaps "brownup" would be a better term.

Happily, such lock-ups can be cleared by a power cycle, or, in the case of circuits with such an input, a reset cycle.

So PCB269 provides a brief off/on/off pulse after it has resumed operation after a power failure.

What if PCB269 suffers a "brownup" lockup? Happily, inside PCB269, in the ATtiny, to be specific, we have set a fuse that says "don't even try to start operating until you have a "good" Vcc to run from". Thirty minutes after that happens, PCB269 sends the reset signal out to the equipment it is powering.

So! My test circuit is used as follows....

You power everything up. You deprive PCB269 of its Vin, and eventually the powered circuit (our test ATtiny) drains the power off of PCB269, and everything dies. You restore Vin to PCB269. Usually, everything will fire up fine. PCB269 certainly will... and the test ATtiny usually will. (You don't always get a brownup failure. If you do, just repeat the above.) The LED on the test circuit will be doing simple single blinks.

Pull D1 low for long enough to switch the LED to doing rapid blinks, and then let it go high again. Now the LED will be doing double-blinks.

Go away, walk the dog. About 30 minutes after the system fired up, a reset signal will be sent by PCB269. (Make sure that Vin does not fail during this period... there's nothing wrong with giving PCB269 5v from a USB charger!)

The reset signal will switch the ATtiny with the testing program in it back to doing single blinks! We can "see" that the reset signal ACTUALLY WAS sent!

Power capabilities of PCB269

So... how much can PCB269 power?

I've only done crude and limited tests, to date.

I was using ver 17b06 of the PCB. (Nothing very remarkable about that. It was the first version.)

There was NO LED to indicate Vin present on the instance of PCB269 I was using.

I DID have an ST LE33CZ-TR (RapidOnline part number 82-3010) in my circuit, for the voltage regulator. The one specified by Nick Gammon probably wastes less electricity... but I had no load on the 3v3 output.

I was using a 5.5v, 1F supercap, RapidOnline part number 11-2170

As I said... I'd done nothing "clever" to reduce the power consumption of the ATtiny with the test program in it. Fuses were in default states. Nick Gammon has a long article on Things You Can Do to reduce power consumption.

I was supplying power (to Vin) from a USB port on my PC. It was supplying about 4.8v... which may be a big part of why the results were disappointing! PCB269 should be fine with Vin of up to 7v. Anything above 5v6 is "thrown away", but in an exercise like this, the "extra" 0.8 v that I was missing can be important.

After many hours of charging, and several charge/ discharge cycles (supercaps improve with "conditioning", I gather), my "fully charged" Vout was getting to 3.92v. I suspect that could be improved, with further long periods of charge

The LED/resistor that ATtiny was blinking was on for 20 ms, off for 2200 ms. It drew 800 mA when running continuously on 5v. Less, of course, as the voltage fell.

Given all of the above, I'm afraid that my results weren't very exciting. The unit "worked", but wasn't going to power my "demanding" test circuit overnight. Sigh. But (see above) there are many areas for work, which could lead to better performance.

When Vin was removed, I started the test ATtiny double blinking right away. Initial Vout, with LED blinking: 3.80v. After 3 minutes: It was down to 3.56v. But by 20 minutes, it was already down to 1.8 volts. The blink, while still justvisible was very faint by now. In a similar test, I had 2.37v twelve minutes after disconnecting Vin.

Sigh. Not all I'd hoped for!...

But... "working". Now it's just a matter, I hope, of "tweaking" things to get overnight power coverage. It's a start... with promising avenues for tweaking. In particular, a better Vin will help, I hope. Already, it will "do" to see simple systems across a switchover from public power to standby generator.

The software

Here's the program I had in the test ATtiny. It's actually "two programs in one". How the ATtiny behaves depends on whether you've pulled D1 low or not. This is a "mode select" input, to switch between our "test PCB269" want and a different behavior which is just an enhanced Blinky to impress friends with.

  ATtiny003- enhanced enhancedBlink!

  Two "Blinkys" in one... selected by state of D1 (pin 6)
     D1 low, if that's what you want. (It will already be connected to internal
     pull UP resistor.

  Blink- MODIFIED 26 Nov 17 for ATtiny
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino model, check
  the Technical Specs of your board  at https://www.arduino.cc/en/Main/Products

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald

  modified again, 26 Nov 17, T Boyd

  modified 2 Sep 2016
  by Arturo Guadalupi

  modified 8 Sep 2016
  by Colby Newman

const byte Pin_LED=0;//LED is on this pin. Seems (from what "experts" did) that
   //it is okay to have an LED on this even when ATtiny connected to Arduino-as-ISP
const byte Pin_In0=3;//Alters on/off timings of Blinking
const byte Pin_In1=4;//As In0
const byte Pin_SelectMode=1;//Selects between the two "Blinkys" on offer in
   //the ATtiny with this program in it. ALSO: Prgm "remembers" if it has been in Mode0
   //at any time since the ATtiny was last reset, be it by power cycle, or by a pulse
   //on its /Reset line (pin 1). (DO NOT PULSE /Reset WHILE /Reset STILL WIRED TO
   //Mode 0 is a Basic Enhanced Blinky, for showing off the ATtiny.

   //Mode 1 is a version of Blinky for testing PCB269, in particular whether it
   //is resetting the ATtiny with this program, ATtiny003, in it. (The ATtimy with
   //ATtiny003 is serving as the "powered system", the "customer" for PCB269. It
   //is nothing (directly!) to do with the OTHER ATtiny which will be involved, the
   //ATtiny "inside" PCB269, which is providing the watchdog service.

boolean boHasBeenInMode0 = false;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(Pin_LED, OUTPUT);
  pinMode(Pin_In0, INPUT_PULLUP);
  pinMode(Pin_In1, INPUT_PULLUP);
  pinMode(Pin_SelectMode, INPUT_PULLUP);
}//end of setup()

void loop() {
if (digitalRead(Pin_SelectMode)==LOW)
/*MODE 0- Simple Enhanced Blinky, for showing off ATtiny. DO NOT run
with ATtiny still wired to Arduino-as-ISP.

MODE 0 is entered if D1 (ATtiny pin 6) pulled low by a wire to GND. D1
will be high, if floating, as internal pull UP is connected via the
pinMode statement used.

Needs LED and resistor on
D0 (ATtiny pin 5), and momentary switches to pull one or both of D3, D4 (pins 2 and 3)
to ground.*/


  int DelayOn=300;
  int DelayOff=300;
  if (digitalRead(Pin_In0)==HIGH)
  if (digitalRead(Pin_In1)==LOW) DelayOff=900;

  digitalWrite(Pin_LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(DelayOn);                       // wait for a second
  digitalWrite(Pin_LED, LOW);    // turn the LED off by making the voltage LOW
  delay(DelayOff);                       // wait for a second
} //end of MODE 0 code
{/*MODE 1
  Immediately after power cycle or reset, if Mode 1 selected (by NO pull DOWN
  of D1 (pin 6)), then the LED on D0 will wink BRIEFLY (to conserve power)
  ONCE, and then go off for an extended period.

   If, since power cycle or reset, Mode 0 has been entered, even briefly,
   then the LED will blink TWICE, then go dark for an extended period.
   This is so that the user can "tell" the system "I've seen a power cycle
   or reset... tell me if you do another". If when user returns, there's a
   single blink, it means there has been one. If the system is still doing
   double blink, there has not.


   AH!! But it DOES, if I
   WATCH, after POWER Cycle, for half hour, having briefly put it into Mode0 with an input
   via D1, and ENSURED there's been no reset-by-power-cycle! (^_^)???

  int DelayOn=20;
  int DelayOff=2200;
  int DelayBetweenDbls=50;
 // if (digitalRead(Pin_In0)==LOW)
  //      {DelayOn=30;
  //       DelayOff=30;
  //      }
//  if (digitalRead(Pin_In1)==LOW) DelayOff=900;

  digitalWrite(Pin_LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(DelayOn);                       // wait for a second
  digitalWrite(Pin_LED, LOW);    // turn the LED off by making the voltage LOW

  if (boHasBeenInMode0)
  {//Dbl blink if it HasBeenInMode0
    delay(DelayBetweenDbls);                       // wait for a second
    digitalWrite(Pin_LED, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(DelayOn);                       // wait for a second
    digitalWrite(Pin_LED, LOW);    // turn the LED off by making the voltage LOW
   }//End of Dbl blink if has been in Mode 0

  delay(DelayOff);                       // wait for a second
}//end of MODE 1 code
}//end of loop()

You are the final inspector

You are responsible for any consequences of using what is on any of my pages!

Please get in touch if you discover any flaws in the board, or any ways to go wrong. How are using it would also be of interest.

I would welcome news of any use you put the PCB to... especially if it comes with a photo, and permission to mention here. By all means give me with that any website, blog, etc, you want publicity for.

If you found this of interest, please mention in forums, give it a Facebook "like", Google "Plus", or whatever. I've almost given up writing these pages, because it seems they are seldom read, and of course not every reader will use them... so... is there any point? If you want more of this stuff, help!?

   Search this site                 powered by FreeFind
Site Map    What's New    Search

Click here to visit my main homepage where you can explore other areas, such as education, programming, investing.

Ad from page's editor: Yes.. I do enjoy compiling these things for you. I hope they are helpful. However... this doesn't pay my bills!!! Sheepdog Software (tm) is supposed to help do that, so if you found this stuff useful, (and you run a Windows or MS-DOS PC) please visit my freeware and shareware page, download something, and circulate it for me? Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

How to email or write this page's editor, Tom Boyd

Valid HTML 4.01 Transitional Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org. Mostly passes. A few "bad attributes" due to Google+ button, etc.

Why does this page cause a script to run? Because of the Google panels, and the code for the search button. Also, I have my web-traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try one, check out their site. Why do I mention the script? Be sure you know all you need to about spyware.

....... P a g e . . . E n d s .....