• EUR€
  • £GBP
  • $USD

How to Make a Rechargeable Mini Lightning Cloud

DFRobot Jul 26 2016 676


Do you want to build a rechargeable mini lightning could? Follow this tutorial, you'll be taught how to make one!


Material List

Blazing WS2812 LED stripPegboard
DFP layer Mini player moduleHot glue gun & glue stick
High frequency relayLeads
Pyroelectric infrared sensor for human bodyMasking tape
5V Voltage Step Up Boost Module
Light Emitting Diodes
Arduino Pro miniA plastic bottle
Self-locking switchSteering arm
220 Ohm Resistor
Power supply connector 
Color pin header 
1000mA lithium battery 
16v330uF capacitor 
16G memory disk 

Circuit Diagram


Making procedure
Step One:  Hardware Making Procedure?Connect each hardware with reference to my circuit diagram?
1. Weld the power supply connector, self-locking switch, battery interface, light emitting diodes and resistor with batteries and switch boards according to the circuit diagram.
2. Weld the 3.7V and 5V voltage step up boost module in parallel connection on the switch board.


3. Use pegboard, color pin header and capacitor to weld a sensor shield; weld the digital pins of D6, D9 and D13 in yellow line on the Arduino mini board separately with the yellow pin headers on the sensor shield.
4. Weld output terminal of the voltage step up boost module with the sensor shield terminal as completion for the whole welding part. Up next is mainly to connect the sensor and deal with the performance of it.
5. Use eight WS2812 LED strips as a whole bunch, cut it with scissors into four sections, before welding them together with leads.

6. The main purpose of using relay is to detect if there is human body coming close with pyroelectric infrared sensor. When the contact of the relay is closing up, the DFPlayer Mini is powered on. Meanwhile, long press the switch to connect ADKEY 1 with negative pole in short circuit, so that the DFPlayer Mini can repeat the first song. The actual test performs better than using serial port control. Connect the relay and DFPlayer Mini module with dupont line. The rest of the two dupont lines are plugged into the positive and negative pin headers separately on the sensor shield. Insert the memory disk in which the already downloaded lightning sound was stored.
7. Plug the human pyroelectric infrared sensor into D9 pin on the sensor shield; insert the WS2812 LED strip into D6 pin on the shield board.

8. Plug the relay into the D13 pin on the sensor shield, connect the DFPlayer Mini module, link the circuit and check the performance of each hardware.
Step Two Upload codes onto Arduino board#include <Adafruit_NeoPixel.h>          #define PIXEL_PIN    6  //??????    #define SENSOR_PIN   9  //???????    #define SPEAKER_PIN  13  //????????    #define PIXEL_COUNT 32  //?????    Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);    int randomNumber;    void setup() {      pinMode(SPEAKER_PIN, OUTPUT);      digitalWrite(SPEAKER_PIN, LOW);      strip.begin();      strip.show();      pinMode(SENSOR_PIN, INPUT);      randomSeed(analogRead(0));            Serial.begin(9600);    }    void loop() {                  if( digitalRead(SENSOR_PIN) == HIGH){        digitalWrite(SPEAKER_PIN, HIGH);        randomNumber = random(300);        Serial.println(randomNumber % 67);        thunder_strike(randomNumber % 67);            delay(3000);        digitalWrite(SPEAKER_PIN, LOW);      }else{        if(millis() % 100000 == 0){          for(int i=20; i<100; i++){            colorWipe(strip.Color(i,i-20,0),0);                        }          for(int i=100; i>20; i--){            colorWipe(strip.Color(i,i-20,0),0);                        }          colorWipe(strip.Color(0,0,0),0);                    delay(3000);                  }      }                                        }    void thunder_strike( int type) {      if(type < 20){                      colorWipe_short(0, PIXEL_COUNT, strip.Color(73, 147, 255), 3);            colorWipe(strip.Color(0, 0, 0), 0);            delay(500);            colorWipe_short(0, PIXEL_COUNT, strip.Color(73, 147, 255), 3);            delay(20);            colorWipe(strip.Color(0, 0, 0), 0);            delay(500);      }else if(type < 40){                      colorWipe(strip.Color(104, 94, 94), 3);            colorWipe(strip.Color(0,0,0), 0);            delay(500);            colorWipe(strip.Color(104, 94, 94), 3);            delay(20);            colorWipe(strip.Color(0,0,0), 0);            delay(500);      }else if(type < 60){              colorWipe(strip.Color(181, 165, 95), 3);            delay(1000);            colorWipe(strip.Color(0,0,0), 0);            delay(100);            colorWipe(strip.Color(181, 165, 95), 3);            delay(500);            colorWipe(strip.Color(0,0,0), 0);            delay(500);      }else{            rainbowCycle(5);            colorWipe(strip.Color(0,0,0), 0);      }    }    void colorWipe_short(uint16_t be, uint16_t en, uint32_t c, uint8_t wait){      for (uint16_t i = be; i < en; i++) {        strip.setPixelColor(i, c);        strip.show();        delay(wait);      }    }    // Fill the dots one after the other with a color    void colorWipe(uint32_t c, uint8_t wait) {      for (uint16_t i = 0; i < strip.numPixels(); i++) {        strip.setPixelColor(i, c);        strip.show();        delay(wait);      }    }    void rainbow(uint8_t wait) {      uint16_t i, j;      for (j = 0; j < 256; j++) {        for (i = 0; i < strip.numPixels(); i++) {          strip.setPixelColor(i, Wheel((i + j) & 255));        }        strip.show();        delay(wait);      }    }    // Slightly different, this makes the rainbow equally distributed throughout    void rainbowCycle(uint8_t wait) {      uint16_t i, j;      for (j = 0; j < 256 * 5; j++) { // 5 cycles of all colors on wheel        for (i = 0; i < strip.numPixels(); i++) {          strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));        }        strip.show();        delay(wait);      }    }     void theaterChase(uint32_t c, uint8_t wait) {      for (int j = 0; j < 10; j++) { //do 10 cycles of chasing        for (int q = 0; q < 3; q++) {          for (int i = 0; i < strip.numPixels(); i = i + 3) {            strip.setPixelColor(i + q, c);  //turn every third pixel on          }          strip.show();          delay(wait);          for (int i = 0; i < strip.numPixels(); i = i + 3) {            strip.setPixelColor(i + q, 0);      //turn every third pixel off          }        }      }    }    //Theatre-style crawling lights with rainbow effect    void theaterChaseRainbow(uint8_t wait) {      for (int j = 0; j < 256; j++) {   // cycle all 256 colors in the wheel        for (int q = 0; q < 3; q++) {          for (int i = 0; i < strip.numPixels(); i = i + 3) {            strip.setPixelColor(i + q, Wheel( (i + j) % 255)); //turn every third pixel on          }          strip.show();          delay(wait);          for (int i = 0; i < strip.numPixels(); i = i + 3) {            strip.setPixelColor(i + q, 0);      //turn every third pixel off          }        }      }    }    // Input a value 0 to 255 to get a color value.    // The colours are a transition r - g - b - back to r.    uint32_t Wheel(byte WheelPos) {      WheelPos = 255 - WheelPos;      if (WheelPos < 85) {        return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);      }      if (WheelPos < 170) {        WheelPos -= 85;        return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);      }      WheelPos -= 170;      return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);    } 

Step Three: Lightning cloud appearance design and hardware installation


1. Use cutter knife to cut holes for the installed loudspeaker, human pyroelectric infrared sensor and rope hole for the steering arm. Also cut the holes for the installed switch, charger port and pilot ligh

2. Install the control switch and rechargeable batteries onto the plastic bottle; make them firm with hot glue.
3. Install the steering arm onto the rope hole with hot glue, then insert the human pyroelectric infrared sensor, DFPlayer Mini module, and relay in order and stabilize them with hot glue. Take all the sensor leads out from the bottleneck.
5. Enclose the installed trumpet with hot glue. Put small amount of cotton into the bottle. This can serve as the sound-absorbing cotton.
6. Dismantle a lampshade, use electric drill to make holes and install the lampshade at the bottom of the bottle. Stick it with hot glue. The uses of the lampshade are many. One is to serve as hair cell (sensory receptor) of the trumpet; second is to support the lightning cloud and shape the cotton.
7. To prevent bottle deformation under hot temperature when sticking the cotton, wrap the bottle with masking tape; stick each LED strip horizontally onto the four directions of the bottle.
8. Cut two straws to make tail bracket of the lightning cloud, wrap the bracket with masking tape to avoid hot temperature, stabilize the bracket and masking tape with hot glue.
9. Stained the bottle’s surface with balls of cotton using hot glue. Stain more cotton at the top of the bottle, otherwise too much cotton at the bottom will come off because of gravity. Do not tear cotton into small pieces. Mould cotton shape after full adhesion.
Up until this stage, the lightning cloud is nearly finished. For this time, I only made a Mini version as practice, before planning to make a big one. Heart-tormenting? Wait, if you want to download special effect thunder music, you can visit the following website. Code uploads needs to use Adafruit_NeoPixel.h library file. Well~that’s it!

4. Insert the leads of the human pyroelectric infrared sensor, relay, LED strip and DFPlayer Mini module into the sensor shield. Put the Arduino and sensor shield into the bottle.