7 Segment Led (Digital Scale)

SRJT08303

Late in the evening Jugaadu with his younger sister were making some activity together for art and crafts. Jugaadu noticed that the measuring scale was broken and they did not have any other scale. It was already late night and therefore no stationery shop could be opened. Jugaadu decided to make something that unbreakable. So Jugaadu decides to make such scale, let us learn from Jugaadu about such type of scale?

Bag Items:

  1. Arduino UNO UNO
  2. Jumper Wires
  3. USB Cable
  4. Foam sheet
  5. Battery and DC Jack
  6. Glue gun
  7. Ultrasonic sensor
  8. Seven Segment Display
  9. Cutter
  10. Breadboard
  11. Scale

"

We can make a digital scale by using the ultrasonic sensor and 7 Segments LED display. With the help of ultrasonic sensors, we can calculate the distance which can be printed on 7 segments LED. Hence our need for digital scale can be fulfilled.

    #include  

#include  
#include  

int trig =10; 
int echo =9; 
int MAX_DISTANCE=200; 
NewPing sonar(trig, echo, MAX_DISTANCE); 

int CLK=8; 
int DIO=7; 
int TEST_DELAY =500; 
TM1637Display display(CLK, DIO); 

void setup() { 
Serial.begin(9600); 
} 

void loop() { 
display.setBrightness(0x0f); 
uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 }; 
display.setSegments(data); 
int distance = sonar.ping_cm(); 

Serial.print("Ping: "); 
Serial.print(sonar.ping_cm()); 
Serial.println("cm"); 
display.showNumberDec(distance, false, 3,1); 
delay(50); 
}