Customize Your Halloween Pumpkin Lighting

“Once upon a midnight dreary, while I pondered, weak and weary,"  I came up with some Halloween uses for the WeMos. This blog will give you some ideas and code to create your own customized lighted pumpkin. Below are the items you will need to complete your own.

(WeMos Matrix LED shown center vs. standard flickering tea light shown right and left)

Shopping List

LED Matrix Shield for WeMos D1 Mini WeMos D1 Mini 9V Battery Shield for WeMos D1 Mini    

1. WeMos D1 Mini

2. WeMos Matrix LED Shield

3. WeMos DC - 9v Battery Shield

4. 9v barrel Jack connector

5. 9v Battery

6. Craft Pumpkin from your local craft store

 

How to Customize Your Halloween Pumpkin

1. Carve out your design in your craft pumpkin including a full circle so you can remove the top section of your pumpkin. Keep size in mind as you will need room for the electronics and 9v power source.

2. Upload one of our provided code sketches or one of your own to the WeMos D1 Mini.

3. Stack the Mini, Battery Shield and Matrix LED.

4. Stab the male pins into the bottom of your pumpkin top leaving room for the battery. Pictured below we have attached the Gadgets That Go 9v battery holder to the bottom of the top pumpkin. You can attach it using another holder or a rubber band attached to the top. If the pumpkin is placed in a high location you may also simply place the electronics on the inside bottom of the pumpkin, so they are not clearly visible.

5. Enjoy the show!

WeMos Matrix LED Example Effects

Flicker Effect

/* Gadgets that Go
 * Matrix LED pumpkin flicker (WeMos Matrix Shield Example)
 * Created 2017-10-7 / Aaron Schnetzer
 */

#include "wemos_matrix_led.h"

long interval = 150; //update interval
long previous = 0;
int randx;
MLED led(8); //update from 0-8
MLED ledlow(4);

void setup(){}

void loop(){
  // put your main code here, to run repeatedly:
  long current = millis();
  if(current - previous > interval){
      previous = current;
      Serial.println(randx);
      
      //create rain drop effect
        for(int i=0; i<8; i++){ 
          for(int j=0; j<8; j++){
            randx = random(2); 
            if(randx > 0){
              ledlow.dot(i,j);
              ledlow.display();
            } else {
              led.dot(i,j);
              led.display();       
            }
          }
        }
  }
}

Strobe Effect

/* Gadgets that Go
* Matrix LED pumpkin strobe (WeMos Matrix Shield Example)
* Created 2017-10-7 / Aaron Schnetzer
*/

#include "wemos_matrix_led.h"

int strobe_rate = 250; //set strobe rate - 1000 = 1second
MLED led(8); //set intensity=8

void setup(){}

void loop() {
  for(int i=0; i<8; i++){ 
    for(int j=0; j<8; j++){
      led.dot(i,j);
      led.display();  
                 
    }
  } delay(strobe_rate);

  for(int x=0; x<8; x++){ 
    for(int y=0; y<8; y++){
      led.dot(x,y,0);//clear dot   
      led.display();      
    }
  } delay(strobe_rate);
   
}

Buildup Effect (shown)

/* Gadgets that Go
* Matrix LED pumpkin buildup (WeMos Matrix Shield Example)
* Created 2017-10-7 / Aaron Schnetzer
*/

#include "wemos_matrix_led.h"

int buildup_rate = 250; //set buildup rate - 1000 = 1second
MLED led(8); //set intensity=8

void setup(){}

void loop(){
  for(int i=0; i<8; i++){ 
    for(int j=0; j<8; j++){
      led.dot(i,j);
      led.display();  
                 
    }delay(buildup_rate);
  } 

  for(int x=0; x<8; x++){ 
    for(int y=0; y<8; y++){
      led.dot(x,y,0);//clear dot   
      led.display();      
    }
  } delay(buildup_rate);
   
}

Need any other WeMos boards or shields for your project? Visit GadgetsThatGo.com


Leave a comment

Please note, comments must be approved before they are published