0

TPL5110 + HuzzahESP8266 Project Questions
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

TPL5110 + HuzzahESP8266 Project Questions

by davescherler on Mon Feb 12, 2018 7:29 pm

Hi All,

Hoping someone can clarify a few things about a project that I'm prototyping right now. I have three basic components in my circuit: a HuzzahESP8266, an RTC (see below), and the TPL5110 timer. My sketch is pretty straightforward - it boots up, flashes an LED twice (once Setup is complete), then every five seconds it checks the current time and blinks an LED. Once it has checked the current time three times, it sets toggles the Done pin on the TPL5110 HIGH and LOW to signal it to cut power.

My connections (sorry, I can't seem to find my RTC or the timer in the Fritzing app): I have a 3xAA battery pack going into my timer. I'm running the Drive pin out to the positive side of my power rails and Ground out to the negative side of my power rails. I'm then connecting my power rails to Vbat and GND pins on my ESP. Pin 12 of my ESP is connected to the Done pin of the timer. (Also Pin 0 connects to the LED and 4 and 5 are connected to SDA and SCL of the RTC).

I have two questions: 1) why doesn't my whole project power on when I turn the battery pack on? It doesn't power up until I manually hit the push button on the TPL5110.

2) Once the timer powers up my ESP, the sketch runs as expected and successful cuts off power after I issue the HIGH signal from pin 12 to the Done pin. However, the timer never seems to power up or power my ESP after that. It runs once, cuts power, then remains idle forever. I've tried adjusting the pot and that hasn't had an effect. Should I not be using pin 12 to issue the signal to the Done pin? I read a similar post where the OP said he was only successful with pins 4 and 5 but I can't find any confirmation of that online.

Thanks in advance!

Components:
Huzzah ESP8266
PCF8523
TPL5110
Led

Code: Select all | TOGGLE FULL SIZE
#include <Event.h>
#include <Timer.h>
#include <Wire.h>
#include "RTClib.h"


RTC_PCF8523 rtc;
Timer timer;
const unsigned long fiveSeconds = (1000*5);  //a five second waiting period.
#define DonePin 12
#define LED 0 //LED attached to pin 0.
int counter = 0; //basic counter to tell when to cut power.
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

  pinMode(LED, OUTPUT);
  digitalWrite(LED, LOW);
  pinMode(DonePin, OUTPUT);
  digitalWrite(DonePin, LOW);
  Serial.begin(115200);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (! rtc.initialized()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    //rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }
 
  timer.every(fiveSeconds, PrintCurrentTime);
    digitalWrite(LED, HIGH);
    delay(500);
    digitalWrite(LED, LOW);
    delay(500);
    digitalWrite(LED, HIGH);
    delay(500);
    digitalWrite(LED, LOW); //this signals to me the end of setup();
}

void loop () {
  timer.update();

  if (counter >= 3) {  //when the counter reaches three, cut power to the ESP8266.
    counter = 0;
    digitalWrite(DonePin, HIGH);
    delay(1);
    digitalWrite(DonePin, LOW);
    delay(1);
  }
 
}

void PrintCurrentTime() {
    //print out the current time.
    DateTime now = rtc.now();
   
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
   
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
   
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));
   
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
   
    Serial.println();
    digitalWrite(LED, HIGH);
    delay(2000);
    digitalWrite(LED, LOW);
    counter++;
    Serial.println("counter is: ");
    Serial.print(counter);
    //delay(3000);
}
Attachments
IMG_0757.jpg
IMG_0757.jpg (956.4 KiB) Viewed 168 times
IMG_0755.jpg
IMG_0755.jpg (912.92 KiB) Viewed 168 times

davescherler
 
Posts: 13
Joined: Fri Jul 08, 2016 4:00 pm

Re: TPL5110 + HuzzahESP8266 Project Questions

by davescherler on Thu Feb 15, 2018 10:52 am

Sorry to be that guy who replies to his own post but doing so in hopes that adafruit_support_bill or adafruit_support_mike might have a minute to answer my two questions.

davescherler
 
Posts: 13
Joined: Fri Jul 08, 2016 4:00 pm

Re: TPL5110 + HuzzahESP8266 Project Questions

by PaoloCinaglia on Tue Jul 03, 2018 9:58 am

Man, I don't know if my answer can be still useful, but I can confirm you that only pin avaible to wake up the ESP are the SDA and SCL pins. I've tried every pin but the only working are #4 and #5.

PaoloCinaglia
 
Posts: 20
Joined: Fri Sep 01, 2017 11:07 am

Please be positive and constructive with your questions and comments.