{"id":550,"date":"2021-03-22T16:51:33","date_gmt":"2021-03-22T16:51:33","guid":{"rendered":"https:\/\/starthardware.org\/en\/?p=550"},"modified":"2021-03-23T19:08:24","modified_gmt":"2021-03-23T19:08:24","slug":"raylfx-level-crossing-with-arduino","status":"publish","type":"post","link":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/","title":{"rendered":"RaylFX \u2013 Level Crossing with Arduino"},"content":{"rendered":"\n<p>This module of the <a href=\"https:\/\/starthardware.org\/en\/raylfx-effects-for-model-railroads-and-model-making-with-arduino-nano\/\" target=\"_blank\" rel=\"noreferrer noopener\">RaylFX system<\/a> uses Arduino to control a level crossing. It consists of two boom barriers, two St. Andrew&#8217;s crosses and street lights for the night. The closing is triggered by two TCRT5000 light barriers.<\/p>\n\n\n\n<p>For proper operation of the lighting, this module must be connected to the <a href=\"https:\/\/starthardware.org\/en\/raylfx-effects-for-model-railroads-and-model-making-with-arduino-nano\/\" target=\"_blank\" rel=\"noreferrer noopener\">RaylFX control module<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Components<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>1x <a href=\"https:\/\/amzn.to\/2MCr0Yc\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino Nano<\/a>*<\/li><li>1x <a href=\"https:\/\/amzn.to\/36nY4KH\" target=\"_blank\" rel=\"noreferrer noopener\">Breadboard and jumper wires<\/a>*<\/li><li>2x <a href=\"https:\/\/amzn.to\/2KXmVgV\" target=\"_blank\" rel=\"noreferrer noopener\">TCRT5000 photoelectric sensor<\/a>*<\/li><li>2x <a href=\"https:\/\/amzn.to\/3iXWMLK\" target=\"_blank\" rel=\"noreferrer noopener\">Servo-motor<\/a>* (I&#8217;d recommend buying better servos, because they need to be triggered relatively often..)<\/li><li>4x 220 Ohm resistor<\/li><li><a href=\"https:\/\/amzn.to\/3oqcUqo\" target=\"_blank\" rel=\"noreferrer noopener\">LEDs<\/a>* <\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Wiring Diagram<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-railway-wiring-diagram.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"490\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-railway-wiring-diagram-1024x490.jpg\" alt=\"RaylFX model railway, model making Arduino level crossing with boom barrier and St. Andrew's cross wiring diagram\" class=\"wp-image-552\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-railway-wiring-diagram-1024x490.jpg 1024w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-railway-wiring-diagram-300x144.jpg 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-railway-wiring-diagram-768x367.jpg 768w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-railway-wiring-diagram.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>This module also works with an Arduino Nano. The red LED in the wiring diagram is connected to the digital pin 5 on the Arduino board via a 220 Ohm resistor. You can simply connect more LEDs in parallel to the red LED here. However, they should still share one resistor together in series. LEDs can be connected to pin 3 and 6 as street lights, with the one on pin 6 flickering randomly.<\/p>\n\n\n\n<p>The boom barrier servos are connected to pins 8 and 9. Pins 2 and 4 are connected to the digital pins (D0) of two TCRT5000 photoelectric sensor. Their sensitivity can be adjusted by the integrated potentiometers. As soon as one of the light barriers triggers, the St. Andrew&#8217;s crosses flash and after an adjustable time the barriers close. When both photoelectric sensor are unobstructed again, the boom barrier opens and the St. Andrew&#8217;s crosses stop flashing.<\/p>\n\n\n\n<p>Attention: The control signal of the <a href=\"https:\/\/starthardware.org\/en\/raylfx-effects-for-model-railroads-and-model-making-with-arduino-nano\/\" target=\"_blank\" rel=\"noreferrer noopener\">RaylFX control module<\/a> is applied to pin A4. It controls the time of day and is required for the correct operation of the street lighting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code Settings<\/h2>\n\n\n\n<p>The following settings can be made in the code:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Switch-on time of the street lamps (ms)<\/li><li>Flickering of the street lamp at pin 6<\/li><li>Flashing speed of the LEDs of the St. Andrew&#8217;s cross<\/li><li>Minimum (closed) and maximum (open) of the servos<\/li><li>Switching time of the boom barrier sequences (flashing, closing, opening, flashing)<\/li><li>Speed of the boom barrier motion<\/li><\/ul>\n\n\n\n<p>In the following part of the program you can adjust the above parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int streetlightTimeout = 100;                         \/\/ switch-on time of the street lights (ms)\nint streetlightFlickering = 1000;                     \/\/ the higher the value, the slower the LED flickers at pin 6\nint crossBlinkSpeed = 1000;                           \/\/ blinking speed of the St. Andrew's cross\nint servo1Min = 40;                                   \/\/ servo 1 minimum (closed)\nint servo2Min = 40;                                   \/\/ servo 2 minimum (closed)\nint servo1Max = 160;                                  \/\/ servo 1 maximum (opened)\nint servo2Max = 160;                                  \/\/ servo 2 maximum (opened)\nint boombarrierTimeouts&#091;4] = {1000, 2000, 2000, 1000};  \/\/ boom barrier {blink, close, open, blink}\nint boombarrierSpeed = 5;                             \/\/ 5 = fast, 25 = medium, 50 = slow\n\n<\/code><\/pre>\n\n\n\n<p>The level crossing module uses the <em>Servo <\/em>library. This library must be installed first. For this go in the Arduino menu to Sketch&gt;Include Library&gt;Manage Libraries \u2026 and search for <em>Servo<\/em> in the search field. Install the current version of the <em>Servo <\/em>library from <em>Michael Margois &amp; Arduino<\/em>.<\/p>\n\n\n\n<p>When uploading you have to make sure that the correct board is selected in the Arduino menu. To do this, &#8220;ATmega328P (Old Bootlaoder)&#8221; must also be selected in the Processor subitem of the Tools menu.<\/p>\n\n\n\n<p>The following program code can be easily copied with the above mentioned changes and loaded onto the Arduino nano.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code for the RaylFX Level Crossing Module<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Servo.h&gt;\n\n\/*\n     Rayl-FX Level Crossing Module\n     StartHardware.org\/en\n\n     Permalink: https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/\n\n*\/\n\n\/* ***** ***** Settings ***** ***** ***** *****  ***** ***** ***** *****  ***** ***** ***** ***** *\/\n\nint streetlightTimeout = 100;                         \/\/ switch-on time of the street lights (ms)\nint streetlightFlickering = 1000;                     \/\/ the higher the value, the slower the LED flickers at pin 6\nint crossBlinkSpeed = 1000;                           \/\/ blinking speed of the St. Andrew's cross\nint servo1Min = 40;                                   \/\/ servo 1 minimum (closed)\nint servo2Min = 40;                                   \/\/ servo 2 minimum (closed)\nint servo1Max = 160;                                  \/\/ servo 1 maximum (opened)\nint servo2Max = 160;                                  \/\/ servo 2 maximum (opened)\nint boombarrierTimeouts&#091;4] = {1000, 2000, 2000, 1000};  \/\/ boom barrier {blink, close, open, blink}\nint boombarrierSpeed = 5;                             \/\/ 5 = fast, 25 = medium, 50 = slow\n\n\/* ***** ***** From here begins the program code, which does not need to be adjusted ***** ***** ***** ***** *\/\n\nint streetlightPin1 = 3;                \/\/ this pin connects to streetlights\nint streetlightPin2 = 6;                \/\/ this pin connects to a flickering streetlights\nint crossBlinkPin1 = 5;                 \/\/ this pin connects to the LEDs of the St. Andrew's cross\nint crossBlinkPin2 = 7;                 \/\/ this pin connects to the LEDs of the St. Andrew's cross\nint boombarrierServoPin1 = 8;           \/\/ this pin connects to a boom barrier servo\nint boombarrierServoPin2 = 9;           \/\/ this pin connects to a boom barrier servo\nint sensorPin1 = 2;                     \/\/ this pin connects to a photoelectric sensor\nint sensorPin2 = 4;                     \/\/ this pin connects to a photoelectric sensor\n\n\/* Memory Variables *\/\nint streetlightBrightness = 0;          \/\/ stores how bright the street lights shine\nint myState = 0;                        \/\/ stores the current stage of the level crossing: 0 = clear, 1 = blink, 2 = close boom barrier, 3 = boom barrier closed, 4 = open boom barrier\nboolean drivesby = false;               \/\/ stores if there currently is a train driving by\n\n\/* Timer Variables *\/\nlong streetlightTimer = 0;              \/\/ timer for the street lights\nlong myTimer = 0;                       \/\/ timer\nlong servoTimer = 0;                    \/\/ timer for the servos\n \n\/* Servo Objects *\/\nServo myServo1;                         \/\/ servo object 1\nServo myServo2;                         \/\/ servo Object 2\nint myServoPosition&#091;2] = {80, 80};      \/\/ stores current servo positions\n\n\/* Variables from the control module to determine the time of day *\/\nboolean receive = false;\nboolean receiveStarted = false;\nint receiveTimeout = 10;\nlong receiveTimer = 0;\nint receivedTime = 0;\nint receivePulse = 0;\nint lastReceivePulse = 0;\nint receivePin = 18;\nint myTime = 23;\n\n#define PAYLOAD_SIZE 2                  \/\/ mandatory for communication with master-module\nint timeOfDay = 0;                      \/\/ stores timeOfDay of master-module (0 and 255)\nbyte nodePayload&#091;PAYLOAD_SIZE];         \/\/ temporarily stores data of master-module\n\nvoid setup() {\n  Serial.begin(115200);                 \/\/ starts the serial communication\n  pinMode(receivePin, INPUT);           \/\/ receiving pin from the control module\n\n  \/* Servo Variablen *\/\n  myServo1.attach(boombarrierServoPin1);\n  myServo2.attach(boombarrierServoPin2);\n\n  myServo1.write(servo1Min);\n  myServo2.write(servo2Min);\n\n  myServoPosition&#091;0] = servo1Min;\n  myServoPosition&#091;1] = servo2Min;\n\n  delay(500);                           \/\/ servos are moved to initial position\n\n  pinMode(crossBlinkPin1, OUTPUT);\n  pinMode(crossBlinkPin2, OUTPUT);\n  pinMode(sensorPin1, INPUT);\n  pinMode(sensorPin2, INPUT);\n\n\n  streetlightOff();\n}\n\nvoid loop() {\n  receiveFunction();                    \/\/ execute instructions for reception\n  if (receiveStarted == false) {        \/\/ if no data is currently being received:\n    \n    if (myTime &gt; 22) {                  \/\/ ***** late evening *****\n      streetlightOn();                  \/\/ turn on street lights\n      \n    } else if (myTime &gt; 18) {           \/\/ ***** evening *****\n      streetlightOn();                  \/\/ turn on street lights\n      \n    } else if (myTime &gt; 12) {           \/\/ ***** noon *****\n      streetlightOff();                 \/\/ turn off street lights\n      \n    } else if (myTime &gt; 9) {            \/\/ ***** forenoon *****\n      streetlightOff();                 \/\/ turn off street lights\n      \n    } else if (myTime &gt; 7) {            \/\/ ***** morning *****\n      streetlightOn();                  \/\/ turn on street lights\n      \n    } else {                            \/\/ ***** night *****\n      streetlightOn();                  \/\/ turn on street lights\n    }\n\n\n    if ((digitalRead(sensorPin1) == 0) || (digitalRead(sensorPin2) == 0)) {\n      if (myState == 0) {\n        myState = 1;\n        myTimer = millis();\n      }\n      else if ((myState == 4) || (myState == 5)) myState = 2;\n    } else {\n\n      if (myState == 3) {\n        myState = 4;\n        myTimer = millis();             \/\/ reset timer\n      }\n    }\n\n    Serial.println(myTime);\n\n    switch (myState) {\n      case 0:                           \/\/ idle\n        crossOff();\n        break;\n      case 1:                           \/\/ blink\n        crossOn();                      \/\/ St. Andrew's cross blinking\n        if (myTimer + boombarrierTimeouts&#091;0] &lt; millis()) { \/\/ when time expired\n          myTimer = millis();           \/\/ reset timer\n          myState = 2;                  \/\/ go on to next state\n        }\n        break;\n      case 2:                           \/\/ close boom barrier\n        crossOn();                      \/\/ St. Andrew's cross blinking\n        closeBoombarriers();\n        if (myTimer + boombarrierTimeouts&#091;1] &lt; millis()) { \/\/ when time expired\n          myTimer = millis();           \/\/ reset timer\n          myState = 3;                  \/\/ go on to next state\n        }\n        break;\n      case 3:                           \/\/ boom barrier closed\n        crossOn();                      \/\/ St. Andrew's cross blinking\n        break;\n      case 4:                           \/\/ open boom barrier\n        crossOn();                      \/\/ St. Andrew's cross blinking\n        openBoombarriers();\n        if (myTimer + boombarrierTimeouts&#091;2] &lt; millis()) { \/\/ when time expired\n          myTimer = millis();           \/\/ reset timer\n          myState = 5;                  \/\/ go on to next state\n        }\n        break;\n      case 5:                           \/\/ blink\n        crossOn();                      \/\/ St. Andrew's cross blinking\n        if (myTimer + boombarrierTimeouts&#091;3] &lt; millis()) { \/\/ when time expired\n          myTimer = millis();           \/\/ reset timer\n          myState = 0;                  \/\/ go on to next state\n        }\n        break;\n    }\n  }\n}\n\nvoid crossOn() {\n  if (millis() % crossBlinkSpeed * 2 &lt; crossBlinkSpeed) {\n    digitalWrite(crossBlinkPin1, LOW);\n    digitalWrite(crossBlinkPin2, HIGH);\n  } else {\n    digitalWrite(crossBlinkPin1, HIGH);\n    digitalWrite(crossBlinkPin2, LOW);\n  }\n}\n\nvoid crossOff() {\n  digitalWrite(crossBlinkPin1, HIGH);\n  digitalWrite(crossBlinkPin2, HIGH);\n}\n\nvoid closeBoombarriers() {\n  if (servoTimer + boombarrierSpeed &lt; millis()) {\n    if (myServoPosition&#091;0] &gt; servo1Min) myServoPosition&#091;0]--;\n    myServo1.write(myServoPosition&#091;0]);\n    if (myServoPosition&#091;1] &gt; servo2Min) myServoPosition&#091;1]--;\n    myServo2.write(myServoPosition&#091;1]);\n    servoTimer = millis();\n  }\n\n}\n\nvoid openBoombarriers() {\n  if (servoTimer + boombarrierSpeed &lt; millis()) {\n    if (myServoPosition&#091;0] &lt; servo1Max) myServoPosition&#091;0]++;\n    myServo1.write(myServoPosition&#091;0]);\n    if (myServoPosition&#091;1] &lt; servo2Max) myServoPosition&#091;1]++;\n    myServo2.write(myServoPosition&#091;1]);\n    servoTimer = millis();\n  }\n\n}\n\nvoid streetlightOn() {\n  if (streetlightTimer + streetlightTimeout &lt; millis()) {\n    streetlightBrightness++;\n    if (streetlightBrightness &gt; 255) streetlightBrightness = 255;\n    streetlightTimer = millis();\n    analogWrite(streetlightPin1, 255 - streetlightBrightness);\n  }\n\n  if (random(streetlightFlickering) == 1) analogWrite(streetlightPin2, random(255) - streetlightBrightness);\n\n}\n\nvoid streetlightOff() {\n  streetlightBrightness = 0;\n  analogWrite(streetlightPin1, 255);\n  analogWrite(streetlightPin2, 255);\n  streetlightTimer = millis();\n}\n\nvoid receiveFunction() {                      \/\/ receives time of day from control-module\n  receivePulse = digitalRead(receivePin);     \/\/ read out the receive pin\n  \n  if ((receiveTimer + receiveTimeout &lt; millis()) &amp;&amp; (receiveStarted == true)) {\n    \/\/ on timeout and active reception\n    receiveStarted = false;                   \/\/ end active reception\n    myTime = receivedTime - 1;                \/\/ store received time\n    receivedTime = 0;                         \/\/ reset the auxiliary variable for time reception\n    Serial.println(myTime);                   \/\/ serial output\n  }\n  \/\/ if a pulse is detected at the receive pin that was not there before\n  if ((receivePulse == 0) &amp;&amp; (lastReceivePulse == 1)) {\n    receiveTimer = millis();                  \/\/ restart timer\n    if (receiveStarted == false) receiveStarted = true;  \/\/ start active reception, if not already done\n    receivedTime++;                           \/\/ there was a pulse, so increase the auxiliary variable to receive time\n  }\n  lastReceivePulse = receivePulse;            \/\/ remember current state at pin for next pass\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Here you can find more RaylFX Modules<\/h2>\n\n\n<ul class=\"wp-block-latest-posts__list is-grid columns-3 wp-block-latest-posts\"><\/ul>\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/starthardware.org\/en\/category\/projects\/arduino-projects\/raylfx\/\" target=\"_blank\" rel=\"noreferrer noopener\">View all RaylFX modules \u00bb<\/a><\/div>\n<\/div>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>This module of the RaylFX system uses Arduino to control a level crossing. It consists of two boom barriers, two St. Andrew&#8217;s crosses and street lights for the night. The closing is triggered by two TCRT5000 light barriers. For proper operation of the lighting, this module must be connected to the RaylFX control module. Components&hellip;&nbsp;<a href=\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">RaylFX \u2013 Level Crossing with Arduino<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":553,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[5,9],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-projects","category-raylfx"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RaylFX \u2013 Level Crossing with Arduino<\/title>\n<meta name=\"description\" content=\"RaylFX \u2013 How to build a level crossing with Arduino. It consists of two boom barriers with servo motors and flashing St. Andrew&#039;s crosses.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RaylFX \u2013 Level Crossing with Arduino\" \/>\n<meta property=\"og:description\" content=\"RaylFX \u2013 How to build a level crossing with Arduino. It consists of two boom barriers with servo motors and flashing St. Andrew&#039;s crosses.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/\" \/>\n<meta property=\"og:site_name\" content=\"StartHardware - Tutorials for Arduino\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-22T16:51:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-23T19:08:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-servo-title-1024x576-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Hermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/starthardware.org\/en\/#website\",\"url\":\"https:\/\/starthardware.org\/en\/\",\"name\":\"StartHardware - Tutorials for Arduino\",\"description\":\"Arduino, Electronics, Fun\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/starthardware.org\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-servo-title-1024x576-1.jpg\",\"contentUrl\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-servo-title-1024x576-1.jpg\",\"width\":1024,\"height\":576,\"caption\":\"RaylFX model railway, model making Arduino level crossing with boom barrier and St. Andrew's cross\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#webpage\",\"url\":\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/\",\"name\":\"RaylFX \u2013 Level Crossing with Arduino\",\"isPartOf\":{\"@id\":\"https:\/\/starthardware.org\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#primaryimage\"},\"datePublished\":\"2021-03-22T16:51:33+00:00\",\"dateModified\":\"2021-03-23T19:08:24+00:00\",\"author\":{\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/37dd49804e351d0045589790d695d99c\"},\"description\":\"RaylFX \u2013 How to build a level crossing with Arduino. It consists of two boom barriers with servo motors and flashing St. Andrew's crosses.\",\"breadcrumb\":{\"@id\":\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/starthardware.org\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RaylFX \u2013 Level Crossing with Arduino\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/37dd49804e351d0045589790d695d99c\",\"name\":\"David Hermann\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c1f55f9c9addf2633dc5513f65e57c6b11de8c1d05cab7a65be1e402233d543?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5c1f55f9c9addf2633dc5513f65e57c6b11de8c1d05cab7a65be1e402233d543?s=96&d=mm&r=g\",\"caption\":\"David Hermann\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RaylFX \u2013 Level Crossing with Arduino","description":"RaylFX \u2013 How to build a level crossing with Arduino. It consists of two boom barriers with servo motors and flashing St. Andrew's crosses.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/","og_locale":"en_US","og_type":"article","og_title":"RaylFX \u2013 Level Crossing with Arduino","og_description":"RaylFX \u2013 How to build a level crossing with Arduino. It consists of two boom barriers with servo motors and flashing St. Andrew's crosses.","og_url":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/","og_site_name":"StartHardware - Tutorials for Arduino","article_published_time":"2021-03-22T16:51:33+00:00","article_modified_time":"2021-03-23T19:08:24+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-servo-title-1024x576-1.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Hermann","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/starthardware.org\/en\/#website","url":"https:\/\/starthardware.org\/en\/","name":"StartHardware - Tutorials for Arduino","description":"Arduino, Electronics, Fun","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/starthardware.org\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#primaryimage","inLanguage":"en-US","url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-servo-title-1024x576-1.jpg","contentUrl":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2021\/03\/raylfx-arduino-level-crossing-boom-barrier-servo-title-1024x576-1.jpg","width":1024,"height":576,"caption":"RaylFX model railway, model making Arduino level crossing with boom barrier and St. Andrew's cross"},{"@type":"WebPage","@id":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#webpage","url":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/","name":"RaylFX \u2013 Level Crossing with Arduino","isPartOf":{"@id":"https:\/\/starthardware.org\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#primaryimage"},"datePublished":"2021-03-22T16:51:33+00:00","dateModified":"2021-03-23T19:08:24+00:00","author":{"@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/37dd49804e351d0045589790d695d99c"},"description":"RaylFX \u2013 How to build a level crossing with Arduino. It consists of two boom barriers with servo motors and flashing St. Andrew's crosses.","breadcrumb":{"@id":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/starthardware.org\/en\/raylfx-level-crossing-with-arduino\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/starthardware.org\/en\/"},{"@type":"ListItem","position":2,"name":"RaylFX \u2013 Level Crossing with Arduino"}]},{"@type":"Person","@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/37dd49804e351d0045589790d695d99c","name":"David Hermann","image":{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/5c1f55f9c9addf2633dc5513f65e57c6b11de8c1d05cab7a65be1e402233d543?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c1f55f9c9addf2633dc5513f65e57c6b11de8c1d05cab7a65be1e402233d543?s=96&d=mm&r=g","caption":"David Hermann"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":26,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":677,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/550\/revisions\/677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media\/553"}],"wp:attachment":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}