Introduction: Smart Luminous Carpet

About: When you find what you come to this life for, an inner impetus will lead you to make your dreams come true. I am passionate about electronics, programming, astronomy, books, theology, workout and nature.

Step & LightUp

Step 1: Description

Hello Everybody, this is my second contribution. It is named Smart luminous carpet. we are going to make a carpet that it is lighted up by each footstep. I would try to explain every detail like: electronic diagram, connection, program. But let me tell me you need some soldering skills.

So, let's get started :D

Step 2: Materials

I selected a carpet with these measurements: 1080x660 mm. So depending upon your carpet measurement, you will determine how many meters of strip LED will be needed to cover all your carpet´s perimeter. In my case was 3.5M.

It is needed to get these components:

Websites where you will find them: www.digitkey.com,www.ebay.com, www.digitkey.com,

- (1) Lm724 amplifier(fg 1.0).

- (3) 12V relay(fg1.1).

- (1) 0.1MicroFarad electrolytic capacitor(fg.1.2).

- (1) Lm7805(fg.1.3)

- (3) 2n2222 NPN transistor(fg.1.4)

- (4) 1KiloOhm resistor(fg1.5)

- (1) 10Microfarad electrolytic capacitor(fg.1.6)

- (1) Atmega 328P(fg.1.7). This microcontroller is included into arduino uno board, but this will be got out from uno board.

- (1) Arduino uno board(fg.1.8). It will only be used to load the programm from PC.

- (1) Arduino USB cable(fg.1.9).

- (2) 22PicoFarad ceramic capacitor(fg.2.0)

- (1) 10KiloOhm resistor(fg.2.1)

- (1) SPST(SinglePoleSingleThrow) Switch 3A(fg2.2)

- In my case 3.5 meter of RGB LED Strip Light SMD 5050. You could buy a roll(fg.2.3).

- (1) Glue gun with its sillicone bars(fg.2.4)

- (1) Cautin with soldering tin(fg.2.5)

- (1) 1MegaOhm resistor(fg.2.6)

- (3) Rectifier diode(fg.2.7)

- (1) 5.1V Zener(fg.2.8)

- (1) Enclosure(fg.2.9). The control circuit has to be covered, so in my case, I Reused a old wood box. You can find a 3d printed enclosures here: https://www.thingiverse.com/search/page:2?q=electr...

- (1) Electric plug(fg3.0)

- (1) 16Megaherzios Crystal oscillator(fg.3.1)

-(1) 10KiloOhms trimpot(fg.3.2)

-(1) PCB breadboard universal(fg3.3)

-(8-10M) Rainbow wires(fig.3.4)

-(1) 180Ohms resistor(fig.3.5)

-(1)12V Power source(fig3.6) 3A. It is very important the max current that this power source can supply. 3Ampers is the ideal to this project.

- (24) piezoelectric sensors. There are a large types of piezos. I Reused some rectangular & discs. The disc piezo shown in fig.3.7 is ok, its diammetter is 35 mm. buy them here: https://www.ebay.com/itm/6pcs-35mm-Piezoelectric-P...

- (1) Coin rubber flooring(fg.3.8). It will be the base for your carpet, where the sensor will be placed. The measurement has to be the same as caper´s measurement. In my case was 100x60cm. Get it with your specific area here: https://www.homedepot.com/p/Rubber-Cal-Corrugated-...

- (6) SMD rectifier bridge(fg.3.9). https://www.ebay.com/itm/10pcs-DB107S-DF10S-1A-100...

- (1) Breadboard(fg.4.0)

- (1) 2000 Adhesive contact and brush(fg.4.1)

- (1) Carpet(fg.4.2)

- (1) Micro jst 1.25 6-pin female&Male connector plug (fg.4.3)

- (1) ThermoFit, diammeter 9mm (fg.4.4)

Step 3: Base Circuit

At first, we will build the base circuit. Here is where sensors will be placed and soldered. Besides, an electronic circuit will be built to rectifier the ac signal generated by piezos.

Each piezo generates a AC signal when it is mechanically deformed. For instance: when we step them, they are deformed. This signal has to be rectifier to be understood by microcontroller. So, for each piezo connected in parallel, a bridge rectifier will be connected with them(fig.5.0). Look at the connection, the piezo´s biggest area is connected to the other piezo´s biggest area, be carefull with that. Do the same parallel connection with the smallest area (fig.5.0). Then, we connected the signal imputs of bridge rectifiers with piezos, we are going to connect the bridges in parallel. Every positive pin of each bridge has to be joint and as the same as each negative pin joint (fig.5.0).

Knowing this, the following step is solder four piezos en parallel (fig.5.1). It is importat to calculate the cm long of the wire. Then in a small pcb we will place the bridges connected in parallel(fig.5.3), you can attach them with glue like kola loka. The 6 pin female connector(fig.5.4) will be attached on PCB. Once we finished the pcb, stick it in any edge where the connector is visible to plug the male connector. Then, we need to cut the led strip in four parts to cover all the carpet´s perimeter like fig.5.5.

Once you attached the four strip on the carpet, we need to solder in paralled: Look at the fig.5.6, all the terminals need to be soldered like that: 12+ soldered with 12+, G with G, R with R and B with B. At the end of a strip, the four terminals need to be soldered with rainbow cables, they will be the outputs that we´ll control by Atmega. These four cables: +12V, G, R & B will be connected to 6 pin female conecctor(fig.5.4) in pcb and the other two pin will be soldered with posive terminal and negative terminal of bridges (fig.5.7). Look at the schematic pcb in fig.5.0 the others four pins has their sign where we will solder the RGB Led strip terminals.

The next step is to make 25 circles smaller than piezos with rubber flooring(fig5.8). These circles will be attached with sillicone on rubber flooring and then we stick the piezos on circles with sillicone. It causes the piezos become more sensitive with stepping. Once finished we need to power the strips directly to see how much they shine(fig.5.9), the 12+ terminal is connected to 12v and any other to ground. Once you tested, the next step is to stick the carpet on rubber flooring base with 2000 adhesive using the brush(fig.6.0). let it dry for 3 hours.

Step 4: Control Circuit

The control circuit are the body parts of luminous carpet. Regardless the piezos generate positive or negatives signals, they are converted into positives signals, that is the role of bridge rectifier. But the positive signals converted has a high voltage value to be read by our Atmega. The atmega needs a voltage to be less than 5volts, If It doesn´t, it would damage. So we don´t interested in how much voltage can generate by each footstep. We only interested if there are any voltage, to turn leds strips on, so using amplifiers we will reduce the voltage value.

To understand the second circuit, we connect in parallel(fig.6.0): a 1MOhm resistor(fig.2.6) & 0.1ufcapacitor(fig.1.2) because we need to filter the voltage generated a little bit and de high resistor allow us not to loose energy. The negative bridge terminal is connected to ground in all the circuit.

An amplifier is a complex ensemble of transistors to do logic & mathematics operations, signal amplification, filters and so on. Lm324(fig.1.0) is an integrated circuit that has 4 amplifiers in its inner. Just one amplifier will be needed like a comparator (figure 6.2).

In the figure.6.2, we can see the OAMP(U2:A) has a negative, a positive input(pin 2&3) and an output(pin 1). OAMP is powered by 12V with its ground. The main purpose of this circuit is to compare a small reference voltage in the negative input with the voltage generated between postive input and ground by piezos. Placing the trimpot(R3) as variable resistor, it is connected in series with R2(180 Ohms) to determinate the reference voltage in negative input. You need to measure the voltage in positive input without stepping. The reference voltage must be higher than voltage of pin 3 (without stepping). When we step the mat, the voltage of pin 3 has to be higher than reference voltage, when it happens, the output gives an voltage that is regulated to 5.1V by Zener 5.1V and 1kOhm resistor in parallel(R1). The atmega328P can only read directly until 5 volts in each analog pins, Zener 5.1 will prevent damage it.

In summary, we convert the analog signal of piezo in digital number. there are only two posible options(0,1) in the output: 1 equals 5V when we step the mat(voltage positive input higher than reference voltage), 0 equal to 0V when nobody steps the mat(voltage positive input lowest than reference voltage).

Step 5: Programming

In Arduino, we will load this program. The file .ino is attached.

What makes this program is the next instruction: When you step the carpet, the led strip will be turned on by a period of time, but it can take whatever color that can be combined: red, green, blue, purple, yellow, light blue and light, it can also activate a secuency or just turn a led on for two seconds. What happens when people are still stepping? The random secuency will be activated until nobody steps.

int S=A0; //Pin that will read the OAMP voltage output

int c; int red=2, green=3, blue=4; //digital pins to active the relays of each led color.

boolean cd=false;

long randomNumber;

int delayIntermitencia1=150; //time in miliseconds to turn on and off the led strip

int veces=15;


void setup() {

pinMode(S,INPUT);

pinMode(red,OUTPUT);

pinMode(green,OUTPUT);

pinMode(blue,OUTPUT);

Serial.begin(9600);

}

void loop() {
c=analogRead(S); //Always OAMP output voltage will be reading to detect the steps.

if(c>=900){ //This condition is open when we step, 900 is an analog value (0-1024).0 is 0v and 1024 is 5V.

randomNumber = random(5,19); //This variable takes a number between 5-18

Serial.print("Numero azar: ");

Serial.println(randomNumber);

Serial.println(c);

//Depending upon which value takes the variable randomNumber, a specific condition will be run.

if (randomNumber==5){

do{ //Do while is an cycle that for at least once the condition will be obeyed

digitalWrite(red,HIGH); //In this condition the red pin is activated to turn red led on

delay(2000);

c=analogRead(S);

}while (c>=900); // the value of AO will always be read, if it doesn´t detect an value beacuse of step, the led will turn off.

digitalWrite(red,LOW);

delay(100);

} we will see until the tenth condition to make all the posibble colors combinations

..............................................

..............................................

.............................................

//The next conditions is the sporadic role of leds changin the color by each period of time

else if (randomNumber==10){
do{

for (int i=0; i<=veces; i++){ //This cicle makes a sporadic secuency possible.

digitalWrite(red,HIGH);

delay(delayIntermitencia1);

digitalWrite(red,LOW);

delay(delayIntermitencia1);

}

c=analogRead(S);

}while (c>=900);

}

}
delay(150);

}

Step 6: Control Circuit

Ok, now we need tu pull the atmega328P(fig.1.7) out from arduino. At first we need to get a 5V to power Atmega, with lm7805(fig.1.3), see lm7805´s connections in fig.7.0. Now the atmega328P without arduino, is connected like that (see fig.7.1).

Reminding the digital pins in arduino to active relays 2,3,4, now are these number pins: 4,5,6(confirm them in fig.7.1). The next circuit stage is the where each digital pin is connected to 2n2222 transistor(Fig.7.2). The transistor increases the current that each relay(fig1.1) needs to be activated and then, activate the led. a diode(fig.2.7) is connected in paralled and with inverted polarity, it impedes the inverse current generated by the magnetic field of coil. Look at the fig7.2, that is the last stage, as you can see the male connector is present, be carefull when you solder their pins. I soldered 6 diferent rainbow cables of 1.30 metres each one, to not be confused. Once you soldered the male cable of 1.30m you need to cover with thermofit(fig.4.4) and then ignite the cable covered with a lighter to fit it.

Finally, the complete circuit is like fig.7.3. Above, the pdf circuit and proteus(sofware desing) file are attached.

Step 7: Assembling

Now, it is time to solder all the components on pcb(fig.9.0). Then place the circuit into enclosure. finally enjoy it :D.

Step 8: Let Your Imagination Soar With Piezoelectrics

Above you will be able to se some ideas related to this project. Once you finish this, the others ideas don´t be a problem. See you the next time ;)

LED Contest 2017

Participated in the
LED Contest 2017

Arduino Contest 2017

Participated in the
Arduino Contest 2017