+21622886281
Arduino Project

Simulation of the functioning of railway barriers with Arduino

Objective of this project:

There are barriers between a railroad train and a pedestrian or car crossing.

In this project we will realize a system that simulate the operation of automatic barriers for railways trains.

We will design this system using:

  • Arduino UNO
  • two ultrasonic sensors hc-sr04 for the detection of the arrival of the train.

  • two servomotors to lower or raise the barriers

Operation of the barrier controlled by Arduino:

Components required

  • Arduino UNO
  • HC-SR04 sensor

  • Servomotor
  • Supply power module

  • LEDs
  • test plate

  • connecting wires

  • toy train

Mounting:

To do the assembly, we connected:

For the first sound sensor HC-SR04:

  • the VCC pin to the 3.3V pin of the Arduino

  • the Trig pin to pin 3 of the Arduino

  • the ECHO pin to pin 4 of the Arduino

  • the GND pin to the GND pin of the Arduino

For the second sound sensor HC-SR04:

  • the VCC pin to the 3.3V pin of the Arduino

  • the Trig pin to pin 8 of the Arduino

  • the ECHO pin to pin 9 of the Arduino

  • the GND pin to the GND pin of the Arduino

For the first servomotor:

  • red wire: power supply wire to be connected to the 5V terminal of the power supply module

  • brown wire: wire to connect to the GND pin of the Arduino

  • Yellow: Positioning signal wire connected to pin 3 of the Arduino

For the second servomotor:

  • red wire: power supply wire to be connected to the 5V terminal of the power supply module

  • brown wire: wire to connect to the GND pin of the Arduino

  • Yellow: Positioning signal wire connected to pin 7 of the Arduino

For LEDs:

  • the terminals (-) of the LEDs to GND of the Arduino

  • the (+) terminal of the first red LED to pin 2 of the Arduino

  • the (+) terminal of the second red LED to pin 7 of the Arduino

Arduino program:

Here are the micropython programs that allow you to:

  • calculate the distance between the HC-SR04 sensor and the detected object

  • raise or lower barriers

  • turn LEDs on or off




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top