@Leonardo, I don't quite know how your setup looks.
Especially your external circuitry as mentioned in my comment above, might make the difference.
This was my test code, which causes my Core to go all black
void setup()
{
pinMode(D7, OUTPUT);
digitalWrite(D7, HIGH);
// also tried
//pinMode(D7, INPUT_PULLUP); // same result LED off during deep sleep
}
void loop()
{
unsigned long ms = millis();
while(millis() - ms < 10000)
SPARK_WLAN_Loop();
Spark.sleep(SLEEP_MODE_DEEP, 5);
}
What does your Core do with this code (with and without external circuitry)?
Hmm, sure you can use another pin, but what is your actual concern with the LED being on during deep sleep?
If it is to safe energy, you might save some since the LED does not consume anything anymore, but it would not stop the sensor to drain your power.
How does your setup look, what sensor do you use and how do you power it?
Could you power the sensor via another pin, which also goes off once the Core enters deep sleep?
Yea that is my other concern but I will figure out some how now that I know it is the ultrasound sensor problem hahaha.
I am using a HC SR04 sensor, and I put the Vcc of the sensor to the Vin of the Spark Core as I need the 5v. Maybe have to use some relay or transistors to control it.
@bko, I agree with your suspicions. The sensor draws power even when the Core is in deep sleep (< 2ma). Controlling the power to the module via a transistor would allow a complete shutdown of the module and remove the "ghost LED" effect altogether.
@peekay123 & @bko, I suspect it was a bad idea of me to split/fork the original thread just in the middle of my own trouble shooting with @Leonardo
and
which led to
and
But as a non-Elite I can only "Reply as linked Topic" and not split where needed .
Maybe one of you can somehow stitch this together a bit better, to prevent any further double medication