Introduction: The Digital Doormat

About: We're born, we make, and we die. So start making!

The digital doormat is a doormat that sends you an email when it is stepped on. Have you ever been curious about who is coming and going from your house? This simple electronics project can provide valuable information regarding the whereabouts of your visitors. It can also be easily modified to perform other functions such as taking pictures or activating a microphone. The possibilities are endless! I hope you enjoy this tutorial on an easy-to-build home automation device, and please vote for this instructable in the IOT and Rug contests!


Step 1: Gather Your Materials/tools


  1. Pressure Sensor (or any other pressure sensor, but this one will definitely work)
  2. Photon
  3. Rug (the size doesn't matter, as long as it is big enough to cover the pressure sensor)
  4. tape (the tape is optional, it will be used to hide the cables)
  5. double sided tape (for mounting the photon housing)
  6. hot glue (the hot glue is also optional, it would be used to hide the cables)
  7. ic socket


The total cost for this project varies depending on what tools/materials you already own. It cost me $20 as the only thing I needed to buy was the pressure sensor.

Step 2: First Try (it Didn't Work)

My first attempt did not work. I tried to use this thing called Velostat to make my own pressure sensing mat. Velostat is a material that changes resistance when pressure is applied, my idea was to make a big network of strips of Velostat and put it under the rug. Then, the Photon would continuously check for resistance: when the resistance changed the Photon would assume someone stepped on the rug and send an email. The Photon is like an Arduino, but is connected to the internet. To send the email, I would use the website called IFTTT.

I believe my first attempt did not work because of the Velostat. Velostat is very tricky to use, I'm not sure if i was using it correctly, but it was impossible to get it to be consistent. I do believe that Velostat could be used as a pressure sensor for this project; and you may be able to get it to work. But I didn't. However, the IFTTT and the Photon worked great, I know this because I got them to work using a simple LDR circuit to test it.

Step 3: Modify the Housing of the Pressure Senser

  1. Take the two screws out of the back of the alarm housing from the doormat alarm. Then open it.
  2. Once it is open, there should be a black and red wire holding the two halves of the housing together. One of the halves has the circuit board and most of the electronics. The other half has the speaker/buzzer in it. Cut the wires connecting the two halves as close to the buzzer side as possible. The picture shows where to cut.
  3. Cut off the cylinder that houses the speaker/buzzer.
  4. Position the Photon in the case where you plan to put it. Attach the power cord to it and mark where the case needs to be cut to allow the cord to go in and charge it.

Step 4: Modify the Housing: Part 2 (optional)

This step is totally optional. I 3d printed a curved piece of plastic to cover the hole made by cutting out the speaker. I did this to keep it tidy and make sure nothing got into it. This would be necessary if you were putting it outside, as it would be a good step towards waterproofing. If you don't have a 3d printer, you can just cover the hole with tape or hot glue or something else. But if you want to 3d print it, you can find the file, as well as a little more information on it here.

I attached it to the plastic housing with a lot of hot glue.

Step 5: Build the Circuit

The circuit is very simple.

  1. Attach the black wire to the gnd pin, and the red wire to A0.
  2. I soldered the red and black wires to an ic socket rather than soldering directing to the Photon, that way, I could use the Photon for something else if I wanted to.
  3. Solder the wires to the ic socket, and then connect the ic socket to the Photon.

Step 6: Code the Particle Photon

The code I used is shown below:

int boardled = D7;

int inPin = A0; // This sets A0 as the input for the doormat sensor

int val = 0; // Currently there is no voltage running through the circuit

int steppedOn = false; // The doormat does not have someone standing on it by default

void setup(){

pinMode(boardled, OUTPUT); // sets the digital pin 13 as output

pinMode(inPin, INPUT); // sets the digital pin 7 as input }

void loop() { val = digitalRead(inPin); // read the input pin

if (val > 0) { Particle.publish("SteppedOn?","yes",60,PRIVATE); /*sends an update to the live viewer, and triggers the IFTTT to send an email. */

steppedOn = true; //The doormat has been stepped on

delay(40000); /*this delays the reading of the input pin by 40 seconds (only after it has been stepped on) because the doormat triggers a chime that plays for about 40 seconds*/



Step 7: Coding: Part 2

  1. The first step is to make an account here (IFTTT).
  2. Follow the instructions provided by the pictures.
  3. Test the whole thing together to make sure it works.

Step 8: Close Up Your Photon in the Plastic Housing

You are ready to close up your case with the Photon in it. Make sure the case is fully closed before reinstalling the original screws.

Step 9: Mount the Photon Housing

This is going to be different for everyone. Use your skills as a maker to figure it out yourself. I will show you how I did it to get you started.

  1. Make a mental plan for how you are going to hide the wires.
  2. Put the sensor under the rug and work the wires towards the nearest outlet.
  3. Once it looks like it's going to work, start gluing or taping to hide the wires.
  4. Put double sided tape on the housing and use it to mount the alarm housing.

Step 10: You're Done!

I made a short video to show it working.


One of the problems that I had while working on this was that it just didn't send an email or update the live feed. My problem was that the alarm was off. To fix this, make sure your alarm system is on and has a battery in it.

Two ways to stop/pause the emails:

  • turn the alarm to the off position
  • turn off the IFTTT app

I hope you found this helpful and will try to make it.

Please vote for this in the Rug and IOT contests!

Feel free to ask questions or comment in the comment section below.

Rugs Challenge

Runner Up in the
Rugs Challenge

IoT Builders Contest

Second Prize in the
IoT Builders Contest

Circuits Contest 2016

Participated in the
Circuits Contest 2016