Manual Controlled Toll Gate Using Push Button

by CodeChamp in Circuits > Microcontrollers

2782 Views, 9 Favorites, 0 Comments

Manual Controlled Toll Gate Using Push Button

Main1.png

Hey Makers!

In this Instructable we will simulate an Toll Booth Gate by using a manual Push Button to open and close the gate.

How Does It Work?

When the vehicle comes in front of the gate, the push button is pressed & the gate is opened, this is done by sending a command via microcontroller to the servo to open the gate 90 Degree.

So, we will let's begin.

Components Needed

4.png
5.png
6.png
3.png
2.png
Untitled-1.png
1.png
0.png
7.png

All That You Need.

Hardware Required

  • NodeMCU
  • Servo Motor
  • Push Button
  • Bread Board
  • Micro USB cable
  • Connecting Wires

Software Required

  • Arduino IDE (with ESP8266 Library installed)

Craft Items

  • Chart ( any colour )
  • Sketch Pen ( any color )
  • Empty Box

Building Process

0.4.jpeg
0.5.jpeg
0.6.jpeg
0.7.jpeg
0.8.jpeg
0.9.jpeg
10.jpeg

The construction part of the craft is been displayed clearly in the images. You can choose any colour (optional). You add your creative ideas to make the Instructable look even more awesome.

Circuit Connection

0.1.jpeg
0.2.jpeg
0.3.jpeg
0.4.jpeg
0.6.jpeg
0.7.jpeg
11.jpeg

Follow each image for the circuit connections, connections are very simple.

This Instructable is part of a series of Instructables with the NodeMCU, my previous Instructables shows you how to Interfacing servo motor and push button with NodeMCU.

So make sure, you check those circuit connections first before trying out this.

Interfacing Servo Motor with NodeMCU

Control LED Using PushButton with NodeMCU

Programming Stage

CODE.PNG
#include <Servo.h>

Servo servo;

const int button = 16;

int temp = 0;

void setup() {

Serial.begin(9600);
pinMode(button, INPUT); servo.attach(2); //D4 servo.write(0); delay(1000); }

void loop() {

temp = digitalRead(button);
if (temp == HIGH) { servo.write(90); Serial.println(" Toll Opened Proceed "); delay(2000); } else { servo.write(0); delay(1000); Serial.println(" Pay to Open Toll "); }

}

Download the "Toll_Gate.ino" file and open it up in the Arduino IDE.

Then Create a new sketch and paste the code below in the Arduino IDE and hit Upload. You can tinker with it if you like based on the application, or just use it as it is.

Downloads

OUTPUT

Output2.jpg
Output1.jpg

That's all makers!

I hope you liked this, Stay Tuned for more Projects!

Thank you.