Project in progress

LED Architectural Machin © GPL3+

Architectural machine for controlling a diode matrix ws2812b with 4 connected ultrasonic sensors and distance data collection in Excel.

  • 2,902 views
  • 3 comments
  • 4 respects

Components and supplies

Necessary tools and machines

Apps and online services

Ide web
Arduino IDE
PLX-DAQ
Macros for Microsoft Excel
Google sheets
Google Sheets

About this project

Introduction

My aim was to create a project that can be applied in an architectural way. It was supposed to be playful and collect some data, but at the same time be simple to create, as this is my first experience with an Arduino.

The essence of the project is to make an interactive consumer-driven light show. Using 4 (or more) rangefinders to drive the diode matrix along the (X; Y) axis and collect information in Excel.

First prototype to understand how sensors work in connection with diodes

This is my first Arduino experience. Having started development, I assembled the simplest model in order to figure out how to connect sensors and diodes.

For the first prototype, I took the components from the Arduino IOT Bundle and connected one rangefinder sensor. As a result, the system started working in one direction and sequentially lit up and extinguished the required row of diodes, depending on the distance to the object in front of the rangefinder.

First simple prototype

First burnt diode matrix

Having dealt with the simplest example, the next stage of modernization was to make the light move along the (X; Y) axis. This required a diode matrix. I have chosen a 64 LED ws2812b for the project.

I had to learn how to solder to connect the pins to the matrix. The first soldering experience was not successful and I unfortunately broke the matrix. The contacts are right under the first LED and the first time I did it for too long, it burned out. With the second, exactly the same matrix, everything went well.

First time soldering

4 ultrasonic sensors with diode matrix

And so, having received a working LED matrix, I was faced with the task of how to connect 4 proximity sensors as efficiently as possible. In the end, I lined them up next to each other and did this in the box cover so that they all give the same distance to the far border.

The prototype works according to the principle:

  • It is determined in front of which of the sensors the object is located. This is how the column of diodes is sampled along the X axis.
  • Having chosen the sensor with which to work, the distance to it is read and the illuminating diodes are searched along the Y axis.
LED architectural machin

Data collection and analysis

To write data to EXEL, I used a macro PLX_DAQ, which reads the Serial Port of the Arduino and writes data to the created table.

In our case, we receive data on the average value of the distance to the object in front of each of the sensors.

Moreover, in addition to the aesthetic and interactive part of the installation, it can collect useful data, for example, such as the number of people passing by in one direction or another, or analyze how close to the wall people pass in a given period of time.

Architectural way and further modifications

A fully implemented project can become an excellent interactive and playful exhibition installation or media facade of a modern architectural building or pavilion.

The architectural way of this project reveals its potential when interacting with social environment, involving people by its conspicuous and creating the desire to take part in the interactive. Actually to participate in the creation of an optical design that reflects the silhouette and gestures of people passing by right on the LED Matrix wall, controlled by proximity sensors.

Code

LED architectural machinC/C++
4 ultrasonic sensors control diode matrix and collect distance data
#include <Adafruit_NeoPixel.h>
#include <Ultrasonic.h>

#define PIN 6 
//#define NUMPIXELS 64
#define PIXEL_AMOUNT 64    
#define BRIGHTNESS 150     


int distance1 = 0;
int distance2 = 0;
int distance3 = 0;
int distance4 = 0;

int dist1 = 0;
int dist2 = 0;
int dist3 = 0;
int dist4 = 0;

int d1 = 0;
int d2 = 0;
int d3 = 0;
int d4 = 0;

int row_excel = 5;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(64, 6, NEO_GRB + NEO_KHZ800);

Ultrasonic ultrasonic1(1, 0);  // An ultrasonic sensor HC-04
Ultrasonic ultrasonic2(5, 4);  // An ultrasonic sensor HC-04
Ultrasonic ultrasonic3(10, 11);  // An ultrasonic sensor HC-04
Ultrasonic ultrasonic4(8, 7);  // An ultrasonic sensor HC-04

int showType = 3;

void setColor(uint32_t c) {
  for(uint16_t i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
  }
  strip.show();
}



void setup() {
  Serial.begin(9600);
  strip.begin();
  strip.show();
 
  Serial.println("CLEARDATA"); 
  Serial.println("Time, Sensor 01, Sensor 02, Sensor 03, Sensor 04"); 
}

void loop() {
  
  {

  row_excel++;

  Serial.print("DATA,TIME,");
   Serial.print(",");

     if (ultrasonic1.read(CM)< 30)
  //Serial.print("Sensor 01: ");
  Serial.print(ultrasonic1.read(CM)); // Prints the distance on the default unit (centimeters)
  //Serial.println("cm");
   Serial.print(",");

     if (ultrasonic2.read(CM)<30)
  //Serial.print("Sensor 02: ");
  Serial.print(ultrasonic2.read(CM)); // Prints the distance on the default unit (centimeters)
  //Serial.println("cm");
   Serial.print(",");

    if (ultrasonic3.read(CM)<30)
  //Serial.print("Sensor 03: ");
  Serial.print(ultrasonic3.read(CM)); // Prints the distance in inches
  //Serial.println("cm");
   Serial.print(",");

    if (ultrasonic4.read(CM)<30)
  //Serial.print("Sensor 04: ");
  Serial.print(ultrasonic4.read(CM)); // Prints the distance in inches
  //Serial.println("cm");
    Serial.print(",");

  Serial.println(row_excel);
       
  delay(100);

   distance1 = ultrasonic1.read();
   distance2 = ultrasonic2.read();
   distance3 = ultrasonic3.read();
   distance4 = ultrasonic4.read();

   dist1 = ultrasonic1.read();
   dist2 = ultrasonic2.read();
   dist3 = ultrasonic3.read();
   dist4 = ultrasonic4.read();

   d1 = ultrasonic1.read();
   d2 = ultrasonic2.read();
   d3 = ultrasonic3.read();
   d4 = ultrasonic4.read();
  }
 
// 1 line
if ( distance1 >= 4 && distance1 <= 6 )
 strip.setPixelColor(0, strip.Color(127, 127, 127));
 

else if ( distance1 >= 7 && distance1 <= 9 )
 strip.setPixelColor(1, strip.Color(127, 127, 127));


else if ( distance1 >= 10 && distance1 <= 12 )
 strip.setPixelColor(2, strip.Color(127, 127, 127));


else if ( distance1 >= 13 && distance1 <= 15 )
 strip.setPixelColor(3, strip.Color(127, 127, 127));


else if ( distance1 >= 16 && distance1 <= 18 )
 strip.setPixelColor(4, strip.Color(127, 127, 127));
 

else if ( distance1 >= 19 && distance1 <= 21 )
 strip.setPixelColor(5, strip.Color(127, 127, 127));
  

else if ( distance1 >= 22 && distance1 <= 24 )
 strip.setPixelColor(6, strip.Color(127, 127, 127));
  

else if ( distance1 >= 25 && distance1 <= 27 )
strip.setPixelColor(7, strip.Color(127, 127, 127));


// 2 line
else if ( d1 >= 4 && d1 <= 6 == d2 >= 4 && d2 <= 6 )
 strip.setPixelColor(8, strip.Color(127, 127, 127));


else if ( d1 >= 7 && d1 <= 9 == d2 >= 7 && d2 <= 9 )
 strip.setPixelColor(9, strip.Color(127, 127, 127));


else if (d1 >= 10 && d1 <= 12 == d2 >= 10 && d2 <= 12 )
 strip.setPixelColor(10, strip.Color(127, 127, 127));

else if (d1 >= 13 && d1 <= 15 == d2 >= 13 && d2 <= 15 )
 strip.setPixelColor(11, strip.Color(127, 127, 127));


else if (d1 >= 16 && d1 <= 18 == d2 >= 16 && d2 <= 18 )
 strip.setPixelColor(12, strip.Color(127, 127, 127));


else if (d1 >= 19 && d1 <= 21 == d2 >= 19 && d2 <= 21 )
 strip.setPixelColor(13, strip.Color(127, 127, 127));
 

else if (d1 >= 22 && d1 <= 24 == d2 >= 22 && d2 <= 24 )
 strip.setPixelColor(14, strip.Color(127, 127, 127));


else if (d1 >= 24 && d1 <= 27 == d2 >= 25 && d2 <= 27 )
 strip.setPixelColor(15, strip.Color(127, 127, 127));




//3 line
else if ( distance2 >= 4 && distance2 <= 6 )
 strip.setPixelColor(16, strip.Color(127, 127, 127));


else if ( distance2 >= 7 && distance2 <= 9 )
 strip.setPixelColor(17, strip.Color(127, 127, 127));


else if ( distance2 >= 10 && distance2 <= 12 )
 strip.setPixelColor(18, strip.Color(127, 127, 127));


else if ( distance2 >= 13 && distance2 <= 15 )
 strip.setPixelColor(19, strip.Color(127, 127, 127));


else if ( distance2 >= 16 && distance2 <= 18 )
 strip.setPixelColor(20, strip.Color(127, 127, 127));
 

else if ( distance2 >= 19 && distance2 <= 21 )
 strip.setPixelColor(21, strip.Color(127, 127, 127));
  

else if ( distance2 >= 22 && distance2 <= 24 )
 strip.setPixelColor(22, strip.Color(127, 127, 127));
  

else if ( distance2 >= 25 && distance2 <= 27 )
strip.setPixelColor(23, strip.Color(127, 127, 127));




//4 line
else if ( dist2 >= 4 && dist2 <= 6 | dist3 >= 4 && dist3 <= 6 )
 strip.setPixelColor(24, strip.Color(127, 127, 127));


else if ( dist2 >= 7 && dist2 <= 9 | dist3 >= 7 && dist3 <= 9 )
 strip.setPixelColor(25, strip.Color(127, 127, 127));


else if (dist2 >= 10 && dist2 <= 12 | dist3 >= 10 && dist3 <= 12 )
 strip.setPixelColor(26,strip.Color(127, 127, 127));

else if (dist2 >= 13 && dist2 <= 15 | dist3 >= 13 && dist3 <= 15 )
 strip.setPixelColor(27, strip.Color(127, 127, 127));


else if (dist2 >= 16 && dist2 <= 18 | dist3 >= 16 && dist3 <= 18 )
 strip.setPixelColor(28, strip.Color(127, 127, 127));


else if (dist2 >= 19 && dist2 <= 21 | dist3 >= 19 && dist3 <= 21 )
 strip.setPixelColor(29, strip.Color(127, 127, 127));


else if (dist2 >= 22 && dist2 <= 24 | dist3 >= 22 && dist3 <= 24 )
 strip.setPixelColor(30, strip.Color(127, 127, 127));


else if (dist2 >= 24 && dist2 <= 27 | dist3 >= 25 && dist3 <= 27 )
 strip.setPixelColor(31, strip.Color(127, 127, 127));






//5 line
else if ( distance3 >= 4 && distance3 <= 6 )
 strip.setPixelColor(32, strip.Color(127, 127, 127));


else if ( distance3 >= 7 && distance3 <= 9 )
 strip.setPixelColor(33, strip.Color(127, 127, 127));


else if ( distance3 >= 10 && distance3 <= 12 )
 strip.setPixelColor(34,strip.Color(127, 127, 127));


else if ( distance3 >= 13 && distance3 <= 15 )
 strip.setPixelColor(35, strip.Color(127, 127, 127));


else if ( distance3 >= 16 && distance3 <= 18 )
 strip.setPixelColor(36, strip.Color(127, 127, 127));
 

else if ( distance3 >= 19 && distance3 <= 21 )
 strip.setPixelColor(37, strip.Color(127, 127, 127));
  

else if ( distance3 >= 22 && distance3 <= 24 )
 strip.setPixelColor(38, strip.Color(127, 127, 127));
  

else if ( distance3 >= 25 && distance3 <= 27 )
strip.setPixelColor(39, strip.Color(127, 127, 127));




// 6 line
else if ( d3 >= 4 && d3 <= 6 == d4 >= 4 && d4 <= 6 )
 strip.setPixelColor(40,  strip.Color(127, 127, 127));


else if ( d3 >= 7 && d3 <= 9 == d4 >= 7 && d4 <= 9 )
 strip.setPixelColor(41, strip.Color(127, 127, 127));


else if (d3 >= 10 && d3 <= 12 == d4 >= 10 && d4 <= 12 )
 strip.setPixelColor(42,  strip.Color(127, 127, 127));


else if (d3 >= 13 && d3 <= 15 == d4 >= 13 && d4 <= 15 )
 strip.setPixelColor(43, strip.Color(127, 127, 127));


else if (d3 >= 16 && d3 <= 18 == d4 >= 16 && d4 <= 18 )
 strip.setPixelColor(44, strip.Color(127, 127, 127));


else if (d3 >= 19 && d3 <= 21 == d4 >= 19 && d4 <= 21 )
 strip.setPixelColor(45, strip.Color(127, 127, 127));


else if (d3 >= 22 && d3 <= 24 == d4 >= 22 && d4 <= 24 )
 strip.setPixelColor(46,  strip.Color(127, 127, 127));


else if (d3 >= 24 && d3 <= 27 == d4 >= 25 && d4 <= 27 )
 strip.setPixelColor(47, strip.Color(127, 127, 127));





// 7 line
 else if ( dist3 >= 4 && dist3 <= 6 | dist4 >= 4 && dist4 <= 6 )
 strip.setPixelColor(48, strip.Color(127, 127, 127));


else if ( dist3 >= 7 && dist3 <= 9 | dist4 >= 7 && dist4 <= 9 )
 strip.setPixelColor(49, strip.Color(127, 127, 127));


else if (dist3 >= 10 && dist3 <= 12 | dist4 >= 10 && dist4 <= 12 )
 strip.setPixelColor(50, strip.Color(127, 127, 127));


else if (dist3 >= 13 && dist3 <= 15 | dist4 >= 13 && dist4 <= 15 )
 strip.setPixelColor(51, strip.Color(127, 127, 127));


else if (dist3 >= 16 && dist3 <= 18 | dist4 >= 16 && dist4 <= 18 )
 strip.setPixelColor(52, strip.Color(127, 127, 127));


else if (dist3 >= 19 && dist3 <= 21 | dist4 >= 19 && dist4 <= 21 )
 strip.setPixelColor(53,strip.Color(127, 127, 127));


else if (dist3 >= 22 && dist3 <= 24 | dist4 >= 22 && dist4 <= 24 )
 strip.setPixelColor(54, strip.Color(127, 127, 127));


else if (dist3 >= 24 && dist3 <= 27 | dist4 >= 25 && dist4 <= 27 )
 strip.setPixelColor(55,strip.Color(127, 127, 127));






// 8 line
else if ( distance4 >= 4 && distance4 <= 6 )
 strip.setPixelColor(56, strip.Color(127, 127, 127));


else if ( distance4 >= 7 && distance4 <= 9 )
 strip.setPixelColor(57, strip.Color(127, 127, 127));


else if ( distance4 >= 10 && distance4 <= 12 )
 strip.setPixelColor(58, strip.Color(127, 127, 127));


else if ( distance4 >= 13 && distance4 <= 15 )
 strip.setPixelColor(59,strip.Color(127, 127, 127));


else if ( distance4 >= 16 && distance4 <= 18 )
 strip.setPixelColor(60,strip.Color(127, 127, 127));
 

else if ( distance4 >= 19 && distance4 <= 21 )
 strip.setPixelColor(61,strip.Color(127, 127, 127));
  

else if ( distance4 >= 22 && distance4 <= 24 )
 strip.setPixelColor(62, strip.Color(127, 127, 127));
  

else if ( distance4 >= 25 && distance4 <= 27 )
strip.setPixelColor(63, strip.Color(127, 127, 127));


else  strip.clear(); 


strip.show();

delay(100);

}

Custom parts and enclosures

Distance data collection in Excel
Use macro for Excel to collect data about distance in front of each Ultrasonic sensors.
plx-daq_distance_data_collection_hLrubGk1ie.xlsm

Schematics

4 ultrasonic sensors with diode matrix
4 ultrasonic sensors with diode matrix gpn4ms3cwn

Comments

Similar projects you might like

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 41,096 views
  • 9 comments
  • 59 respects

Rgb led matrix using neopixel

Project tutorial by edison science corner

  • 7,489 views
  • 1 comment
  • 6 respects

Arduino tutorial: LED Matrix red 32x8 256 Led

Project showcase by Bihari lifehacker

  • 5,136 views
  • 0 comments
  • 5 respects

8 Pieces of Daisychained WS2812B 8x8 RGB LED Matrix

Project showcase by HeathenHacks

  • 4,929 views
  • 2 comments
  • 8 respects

LED RF Entryphone Coconut Build

Project in progress by javier muñoz sáez

  • 1,489 views
  • 0 comments
  • 2 respects

How to Build 8x8x8 LED Cube

Project tutorial by DIY Projects Lab

  • 2,830 views
  • 0 comments
  • 7 respects
Add projectSign up / Login