Arduino Lightning Counter Display


In this project, we are going to make Arduino Lightning Counter Display. The Arduino Lightning Counter Display is a project that utilizes Arduino Nano, a 4-digit 7-segment display, and an EMP sensor to count and display the number of lightning strikes in a given area. Lightning is a natural phenomenon that can be both fascinating and dangerous, and this project aims to provide a visual representation of lightning activity.

Hardware Required

You will require the following Hardware Components for Arduino Lightning Counter Display.

Components#Buy From Amazon
Arduino nano1Buy Now
EMP sensor1Buy Now
4-Digit 7-Segment Display1Buy Now
Jumper WiresFewBuy Now
Breadboard1Buy Now

What is 4 Digit 7 Segment Display?

The 4-digit 7-segment display operates by selectively turning on or off the individual segments to form the desired numerical digit. Each segment of the display is labeled from “a” to “g” and represents a specific portion of the digit. By controlling the segment illumination, different digits can be displayed.

To use the 4-digit 7-segment display with an Arduino or other microcontroller, the common cathode or common anode configuration must be determined. In the common cathode configuration, the common terminal is connected to the ground (GND), and each segment is controlled by applying a high voltage (typically 5V) to illuminate it. In the common anode configuration, the common terminal is connected to the positive voltage supply, and each segment is controlled by grounding it to turn it on.

The Arduino is programmed to sequentially turn on the segments of each digit to display the desired numbers. By rapidly cycling through the digits, the display can create the illusion of showing multiple numbers simultaneously.



Pin Configuration

Pin NamePin Type
VCC5v Power Supply
SCLKClock Input Pin
RCLKClock Input Pin
DIOData Input/Out Pin
GNDGround Pin


  1. Digit Configuration: 4 digits
  2. Display Type: 7-segment LED display
  3. Common Cathode or Common Anode configuration
  4. Maximum Segment Current: Typically 10-20mA per segment
  5. Forward Voltage: Typically 1.8V – 2.5V per segment


  1. Compact and easy-to-read numerical display
  2. Can display numbers from 0 to 9 and some additional characters
  3. Multiple digits for displaying larger numbers or alphanumeric characters
  4. Compatible with Arduino and other microcontrollers
  5. Low power consumption

Circuit Diagram

The following circuit shows you the connection of the Arduino Lightning Counter Display, Please make the connection carefully


Working Explanation

The EMP sensor is a crucial component in this project as it detects the electromagnetic pulses generated by lightning strikes. When a lightning strike occurs, the EMP sensor picks up the electromagnetic waves and sends a signal to the Arduino Nano. The Arduino then processes this signal and increments the lightning strike count.

The 4-digit 7-segment display is used to showcase the lightning strike count. Each digit of the display is controlled by the Arduino, which sends the appropriate signals to display the corresponding numbers. The display continuously updates as lightning strikes are detected and counted by the system.

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Installing Libraries

Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow


//For more Projects:

#include “Four7Seg74hc595.h”

esl::Four7Seg74hc595 display( 5,6,7 ); // SCLK, RCL, DIO pins, respectively

int reading;
int lm35Pin = 1;
char sbuf[5];
uint16_t count;
uint32_t ts1, ts2;

// this constant won’t change:
const int buttonPin = 2; // the pin that the pushbutton is attached to
const int ledPin = 13; // the pin that the LED is attached to

// Variables will change:
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button

void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
for (uint8_t i=0; i < 100; i++) {
display.setDigits( “—-“, 4 );
count = 0;
sprintf( sbuf, “%04u”,count);
display.setDigits( sbuf, 4 );
ts1 = ts2 = millis();

uint32_t ts;
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState != lastButtonState) {
if (buttonState == LOW) {

} else {
// Delay a little bit to avoid bouncing
lastButtonState = buttonState;
//Serial.print(“number of lightning: “);
ts = millis();
if ( ts – ts1 >= 10 ) {
sprintf( sbuf, “%04u”, buttonPushCounter );
ts1 += 10;
display.setDigits( sbuf, 4 );


  1. Weather monitoring systems
  2. Safety and security systems
  3. Environmental research and analysis
  4. Lightning activity tracking for outdoor events
  5. Educational projects and experiments


The Arduino Lightning Counter Display project offers an engaging and informative way to monitor and display the number of lightning strikes in a given area. By utilizing Arduino Nano, a 4-digit 7-segment display, and an EMP sensor, users can visually observe and track lightning activity. This project finds applications in weather monitoring, safety systems, research, and educational projects, providing valuable insights into the occurrence of lightning strikes.

Leave a Comment