Rug With Sensors/ RF Communication With Arduino Micro

Rug With Sensors RF Communication

Rug With Sensors RF Communication









I recently finished the installation Equally diverse, which is made of a series of lamps that react to the sensors placed in a rug underneath the lamps.
Here is how I made the rug with pressure sensors.
I hope you will find it useful. 🙂

Step 1: How to Make the Sensors

SensorsFor the pressure sensors, I used piezo sensors because they are cheap, effective and easy to use.
To create the RF communication, I used an Arduino Micro and a RF transmitter.

Because the sensors connect to the analog pins, you can use only four sensors for each Arduino. Since two sensors cannot emit a signal at the same time, that is not really a problem.

To connect the transmitter to the Arduino, you have to connect, from right to left as you look at it:

  • The first pin to the ground of the micro-controller
  • The second to the VCC of the Arduino Micro
  • The last pin to the data pin (10, in my case)

To connect the piezo sensors, first, you have to cut a wire long enough, and connect:

  • The part that goes to the middle of the piezo to the analog pin of the microcontroller
  • The part that is wired to the edge of the sensor to the ground of the Arduino

My advice is to connect all the grounds of the sensors and then connect one wire to the ground of the Arduino.

Step 2: How to Put the Sensors in the Rug

Sensors in the RugTake a fluffly, for the lack of a better word, rug and place the micro-controller next to one of its edges with the sensors placed on the rug.

Make sure the micro-controller is somewhere safe from being stepped on or in a box that can be seen.

Arrange the sensors so that they will be in different parts of the rug.

Hide the sensors under the fibres of the rug, while using them to secure the wires that connect the sensors to the micro-controller.

That’s all! ^.^

Step 3: Code

#include <VirtualWire.h> 
const char *message = "";
int piezo0 = A0;
int piezo1 =A1;
int piezo2 =A2;
int piezo3 =A3;
int sensorReading0 = 0; 
int sensorReading1 = 0;
int sensorReading2 = 0;
int sensorReading3 = 0;void setup() {
  pinMode(piezo3,INPUT); vw_set_ptt_inverted(true);
}void loop(){
  sensorReading0 = analogRead(piezo0);
  if (sensorReading0 < 100) {  ;
    vw_send((uint8_t *)message, strlen(message)); 

Read more: Rug With Sensors/ RF Communication With Arduino Micro

Leave a Comment

Your email address will not be published. Required fields are marked *