timthegamer345600
Created June 18, 2020

The push plate

By stepping on a plate and without using your hands you can control and use automatic doors, elevators and much more safe and easy.

The push plate

Things used in this project

Hardware components

Arduino Nano Every
Arduino Nano Every
×1
Resistor 10k ohm
Resistor 10k ohm
×4
Relay (generic)
×1
Switch Accessory, Spring
Switch Accessory, Spring
Needs to be 12 mm in diameter and about 11 mm in height.
×4
9V battery (generic)
9V battery (generic)
×1
Resistor 220 ohm
Resistor 220 ohm
Used to set the right brightness on the LCD display.
×2
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
Any type of trimpotentiometer will work as long as 10k.
×1
Battery Holder, PP3 (9V) x 1
Battery Holder, PP3 (9V) x 1
Any 9V battery holder will work. I used a bigger plastic one.
×1
Hook Up Wire Kit, 22 AWG
Hook Up Wire Kit, 22 AWG
×1
Linear Regulator (7805)
Linear Regulator (7805)
5V 1A voltage regulator to power the circuit for the LCD.
×1
Capacitor 22 pF
Capacitor 22 pF
×2
16 MHz Crystal
16 MHz Crystal
×1
Capacitor 10 µF
Capacitor 10 µF
×1
Electrolytic Capacitor, 0.1 µF
Electrolytic Capacitor, 0.1 µF
×1
Button SMD
×2
SD-card reader/writer
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
I used a BC547B.
×1
Resistor 1k ohm
Resistor 1k ohm
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
Most regular diodes schould work.
×1
Machine Screw, M4
Machine Screw, M4
For mounting LCD display. Should be about 15 mm long.
×4
M4 Nut
Two is used on each screw. One to act as a distance between LCD and box and the other to tighten down screw.
×8
M4 Washer
×4
Machine Screw, M2
Machine Screw, M2
Used to mount different components in the box.
×11
M2 Washers
×10
M2 Nut
Two nuts is used on each screw except on the screw that holds the back plate in place. One nut is used on each screw to give a distance between the component and the box and the other is used to tighten down the component.
×21
Perfboard
Is used to mount all the components for the custom circuit for the LCD display.
×1
Sheild for Arduino Nano with screw terminals
Used to make it easier to hook up the different compnents and also makes it easier to upgrade or change components later on.
×1
Perfboard 25 mm X 45 mm
Is used to mount all the components for the relay circuit.
×1
Perfboard 16 mm X 25 mm
Is used to mount all the components for the custom LCD display adapter.
×1

Software apps and online services

Arduino IDE
Arduino IDE
Used for all programming.

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Used to make the custom circuit board.
Helping Hand Tool, with Magnifying Glass
Helping Hand Tool, with Magnifying Glass
Not necessary but makes the work a lot easier.
Solder Wire, Lead Free
Solder Wire, Lead Free
3D Printer (generic)
3D Printer (generic)
Hot glue gun (generic)
Hot glue gun (generic)
Cable Cutter, 143mm
Cable Cutter, 143mm
Wire Stripper, Automatic
Wire Stripper, Automatic
Plier, Long Nose
Plier, Long Nose
Screwdriver (philips head)

Story

Read more

Custom parts and enclosures

Base

This is the base for the push plate. A plate is mounted on top of this base which is then pushed down to open doors or use elevators. The four holes is used to mount springs. The hole in the middle is where a push button is mounted.

Top

This is mounted on top on the base with four springs. When the top is pushed down it presses the button in the base which activates for an example a door. If this was in full scale the peoples which wanted to use the device would step on the top.

Box for the electronics

This is where all the electronics is mounted despite the external button. LCD display, Arduino and much more is mounted in this box.

Lid for the electronics box

This plate hides the electronics.

Base

This is the base for the push plate. A plate is mounted on top of this base which is then pushed down to open doors or use elevators. The four holes is used to mount springs. The hole in the middle is where a push button is mounted.

Base

This is the base for the push plate. A plate is mounted on top of this base which is then pushed down to open doors or use elevators. The four holes is used to mount springs. The hole in the middle is where a push button is mounted.

Base

This is the base for the push plate. A plate is mounted on top of this base which is then pushed down to open doors or use elevators. The four holes is used to mount springs. The hole in the middle is where a push button is mounted.

Schematics

Circuit scematic for the electronics

This scematic shows how everything is connected. The scematic shows both how to connect the Arduino and the Atmega328. Everything is powered by a 9V battery. Everything has the same ground which all are connected to the 9V battery´s negative terminal.

Code

Code for the Arduino

C/C++
This is the program which is used on the Arduino Nano Every.
#include <SPI.h> //Includes the SPI libary.
#include <SD.h> //Includes the SD libary.

File myFile; //Initilizes the SD libary. 

const int buttonPin = 2; //Varible for the pin which an external button is connected to. 
const int relayPin = 3; //Varible for the pin which the relay is connected to. 
const int exSignal = 5; //Varible for the pin for the signal to the LCD circuit. 
const int resetPin = 6; //Varible for the pin which the external reset button is connected to. 

int buttonState = 0; //Varible for the state of the external button. 
int resetButton = 0; //Varible for the state of the external reset button. 
int count = 0; //Varible for the counter which counts the users. 

unsigned long time = 0; //Creates a varible for time. 

void setup() {
  pinMode(buttonPin, INPUT); //Makes the pin for the external button to an input. 
  pinMode(relayPin, OUTPUT); //Makes the pin for the relay to an output.  
  pinMode(exSignal, OUTPUT); //Makes the pin for the signal to the LCD circuit to an output.
  pinMode(resetPin, INPUT); //Makes the pin for the reset button to an input. 

  SD.begin(4); //Starts the SD libary. 

  myFile = SD.open("Visitors.txt", FILE_WRITE); //Opens a .txt file with the name "Visitors".
  myFile.println("Counts the amount of visitors and writes down how many passes per hour under MAX 24H"); //Writes the following sentence in the file on the SD-card. 
}

void loop() {
  buttonState = digitalRead(buttonPin); //Stores the state of buttonPin in the buttonState varible.
  resetButton = digitalRead(resetPin); //Stores the state of the resetPin in the resetButton varible. 

  time = millis(); //Stores the time which has passed since the Arduino was powered on in the time varible. 
  
      
      if (resetButton == HIGH) { //If the reset button is pushed then start the secuence below. 
      myFile.print(count); //Prints the amount of users in the file on the SD-card.
      myFile.println("have used this device while it has been powered on."); //Prints the following sentence in the file on the SD-card. 
      myFile.close(); //Closes the file on the SD-card.
      {for(int i=0; i<10; i++) while(1);} //Goes into an endless loop which is a way to stop the program. 
  } else if (resetButton == LOW) { //If the reset button is off it will start the secuence below. 
     if (buttonState == HIGH){ //If the external button is pushed it will start the sequence below. 
        digitalWrite(exSignal, HIGH); //Turns on the external signal to the LCD ciruit. 
        count = count + 1; //Adds one to the counter to indicate that someone used the device.
        myFile.print("One person just used this device since: "); //Prints the messege "One person just used this device since: " when someone used the device. 
        myFile.print(time / 1000); //Prints the time stored in the time varible into the file on the SD-card. 
         //It also divides the value by 1000 to give it in seconds instead of microseconds.
        myFile.println("seconds it was started."); //Prints the following sentence in the file on the SD-card.  
        delay(10000); //Waits 10 seconds or 10000 microseconds before continuing. 
        digitalWrite(exSignal, LOW); //Turns off the external signal. 
        digitalWrite(relayPin, HIGH); //Turns on the relay. 
        delay(20000); //Waits 20 seconds or 20000 microseconds before continuing. 
      } else if (buttonState == LOW) { //If the state of the external button is low start the secuence below. 
        digitalWrite(exSignal, LOW); //Turns off the external signal to the LCD circuit. 
        digitalWrite(relayPin, LOW); //Turns off the power to the relay. 
     }}}

Code for the the external cicuit for the LCD

C/C++
This program is used on the seperate circuit for the LCD display.
#include <LiquidCrystal.h> //Includes the liquid crystal display libary. 

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //Initilazies the LCD libary and tells which pins are used. 

const int signalPin = 6; //Variable for the pin which recieves the external signal. 
const int rows = 2; //Number of rows on your display. 
const int columns = 20; //Number of columns on your display. 
                        //Change to 16 if you are using a 16x2 lcd display.
int signalState = 0; //Variable for the state of the signal from Arduino Nano. 

void setup() {
  pinMode(signalPin, INPUT); //Makes the pin for external signal to a input.

  lcd.begin(columns, rows); //Sets up the display by telling number of coulmns and rows.
}

void loop() {
  signalState = digitalRead(signalPin); //Stores the state of the pin for external signal in a variable. 
  
  if (signalState == HIGH) {  //If theres power on pin 12 on the IC it will start the sequence below. 
    lcd.clear(); //Clears the display.
    lcd.setCursor(1, 0); //Selects the first row and second column. 
    lcd.print("Make sure to keep"); //Prints the messege "Make sure to keep".
    lcd.setCursor(1, 1); //Selects the second row and second column.
    lcd.print("your distance (2m)"); //Prints the messege "your distance (2m)".
    delay(5000); //Waits 5 seconds or 5000 microseconds before continuing.

    lcd.clear(); //Clears the display. 
    lcd.setCursor(2, 0); //Selects the first row and third column.
    lcd.print("Wash your hands"); //Prints the messege "Wash your hands".
    lcd.setCursor(5, 1); //Selects the second row and sixth column. 
    lcd.print("regularly!"); //Prints the messege "regularly!".
    delay(5000); //Waits 5 seconds before continuing.

    lcd.clear(); //Clears the display.
    lcd.setCursor(6, 0); //Selects the first row and sixth column.
    lcd.print("Thanks!"); //Prints the messege "Thanks!".
    delay(20000); //Waits 20 seconds or 20000 microseconds before continuing. 
  } 
  else if (signalState == LOW) { //If theres no power on pin 12 on IC it will start the sequence below. 
    lcd.clear(); //Clears the display.
    lcd.setCursor(1, 0); //Selects the first row and second column.
    lcd.print("Step on the plate"); //Prints the messege "Step on the plate".
    lcd.setCursor(3, 1); //Selects the second row and fourth column.
    lcd.print("to open door!"); //Prints the messege "to open door!".
  }}

Credits

timthegamer345600

timthegamer345600

1 project • 0 followers

Comments