Creating coordinated Christmas light displays with mesh networking

@Rftop - THANKS! it does work, but as soon as it fires the first time, it just keeps sending events non-stop. But looking at the pins for the jumper (H or L), there is no jumper. So dug through the other 3 and grabbed one, put it on and now it’s firing just once.

So as before… big smile! :smiley:

Next - power in the field. I think. :thinking:

By the way - This bunch is a phenomenal bunch. Hope some day I can give something back. I actually live in IT, but not on hardware or coding. I’m in the strategy/business/application/project planning & management side. So I’m out of my element, but as I learn, I’ll contribute where I can.

5 Likes

A 6V Solar Panel and a larger Li-Po is the easiest.

That’s my first thought. My head scratching begins with being in the woods without clear view of the sky, wondering if it will get enough light. Digging the finger nails in deeper, in reading your recent post, it might be able to limit power draw to still make it work.

I bought 2000mAH Li-Po’s. How important is it to use Adafruit’s panels with their chargers/batteries?

Next question on the PIR, though, even with the jumper, it started firing continuously with no stopping for 2 hrs until I just pulled power, even under a black cloth. I’m really lost. I put the jumper on for “H” - repeating. Guess I don’t understand the two modes.

You can use any 6V Solar Panel with the Boron. Here’s a couple that I’ve tested:

PIR:

Try this out:

// Jumper in H position
int PIR = D4;
int motion = 0;
int pirState = LOW; 
int donePIN =D3;

void setup() {
Serial.begin(9600);
pinMode(PIR, INPUT);  // PIR:  No Motion = High,  Motion = LOW, 
pinMode(D7, OUTPUT);
}


void loop() {

motion = digitalRead(PIR);

  if (motion == HIGH) {        // PIR OutPut is HIGH = MOTION
    digitalWrite(D7, HIGH); 
    
     if (pirState == LOW) {
      // we have just turned on
      Serial.println("Motion detected!");
      // We only want to print on the output change, not state
      pirState = HIGH;
    }
} else {
    digitalWrite(D7, LOW);  // turn LED OFF
    if (pirState == HIGH){
      // we have just turned off
      Serial.println("Motion ended!");
      // We only want to print on the output change, not state
      pirState = LOW;
    }
  }

}

I can’t believe you guys are so helpful on a Sunday morning. Geez…

If I follow the code, and trying to think back through, I should have power on the VUSB, data (PIR OUT) on pin D4.

Adding a Particle.publish() to mimic the Serial.println() but get timestamp, this is what I see and assuming time = UTC (I’m central time) :


event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:37:19.011Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Ended”,“ttl”:60,“published_at”:“2018-12-23T14:37:27.248Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:37:28.449Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Ended”,“ttl”:60,“published_at”:“2018-12-23T14:37:36.689Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:37:38.768Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:37:38.849Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Ended”,“ttl”:60,“published_at”:“2018-12-23T14:37:41.489Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Ended”,“ttl”:60,“published_at”:“2018-12-23T14:37:49.729Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:37:51.489Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:37:51.569Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Ended”,“ttl”:60,“published_at”:“2018-12-23T14:37:54.209Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Ended”,“ttl”:60,“published_at”:“2018-12-23T14:38:02.529Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:38:04.688Z”,“coreid”:“e00fce68e32c4a9de608b584”}

event: Motion
data: {“data”:“Detected”,“ttl”:60,“published_at”:“2018-12-23T14:38:04.768Z”,“coreid”:“e00fce68e32c4a9de608b584”}


@rick.roades, you’ll have better luck if you start a new thread. That will help others in the future for Searching the same issues also.
You may have an open-collector output. You can try pinMode(PIR, INPUT_PULLUP), but that’s a long shot.

I’d also suggest using serial for testing. You can easily hit the 1-publish per second limitation while de-bugging hardware and code.

1 Like