{"id":10000,"date":"2015-03-24T16:28:26","date_gmt":"2015-03-24T05:28:26","guid":{"rendered":"http:\/\/legoeng.local?p=10000&preview_id=10000"},"modified":"2022-08-01T10:24:05","modified_gmt":"2022-08-01T00:24:05","slug":"boom-gate-intersection","status":"publish","type":"post","link":"http:\/\/legoeng.local\/boom-gate-intersection\/","title":{"rendered":"Boom-gate intersection (EV3 Hackathon 2015)"},"content":{"rendered":"

\"P1210545\"<\/a>On 27 February 2015, a small group of EDGErs<\/a> went to LEGOLAND for an EV3 Hackathon. This post documents one of the projects that came out of the event.<\/em><\/p>\n

For the EV3 Hackathon, Magee and I built a low-tech intersection–one that controls traffic flow using boom gates rather than bluetooth signals. Since the cars were equipped with ultrasonic sensors, they were able to detect the lowered boom gates and stop.<\/p>\n

<\/div>\n

Here is an overview of the program (click for a larger version):<\/p>\n

\"hackathon<\/a><\/p>\n

The traffic light used the\u00a0EV3\u00a0brick status lights to generate red, amber, and green lights. The boom gates were synchronized with the lights–when the light turned red, the boom gate for that road came down and the boom gate for the intersecting street went up. Here is the loop that controlled the traffic light and boom gates:<\/p>\n

\"hackathon<\/a><\/p>\n

The intersection also featured a pedestrian crossing. When the WALK button (a touch sensor) was pressed, both boom gates were lowered and the traffic light turned red. The EV3 display switched from saying DON’T WALK to showing a cartoon walker. A recorded voice said, “Walk.” After five seconds, the display switched back to DON’T WALK and the normal traffic sequence started again. Here is the pedestrian-crossing section of the program:<\/p>\n

\"hackathon<\/a><\/p>\n

To create the cartoon walker, I used the Image Editor in the MINDSTORMS software to draw a stick figure walking. I saved the image to a file. I then edited the original image, changing the position of the legs, and then saved the new image to another file. In the program, I put both images in a loop, displaying each image for half a second. I ran the loop five times, creating a walking figure on the EV3 display for five seconds.<\/p>\n

Because the walk signal could be pressed at any time, the program needed to keep track of the position of the two boom gates at all times, so that it would know which gate needed to be lowered for the pedestrian crossing. To do this, I used a variable, A down<\/em>, to record whether the A boom gate was up or down. Each time the A gate was raised or lowered, the variable was updated. When the walk button was pushed, I used a switch block to lower the correct gate depending upon the current value of A down<\/em>.<\/p>\n

So, what did I learn? First, working with the EDGE group is a lot of fun! Second, the boom-gate intersection worked reliably to control cars, but it was much less cool than the bluetooth intersection. The one advantage of the boom-gate intersection was that it was more people friendly. With the visible traffic light and the physical boom gates, a person at the intersection would have a better sense of which street currently had the right of way than with the bluetooth intersection. Also, the pedestrian crossing allowed people on foot to use the intersection, not just cars. In the future I would like to incorporate some of these people-friendly features into a bluetooth intersection.<\/p>\n

\n

Also in EDGE Hackathon 2015<\/q><\/h3>\n
    \n
  1. \n\t\t\tBoom-gate intersection (EV3 Hackathon 2015)<\/a>\n\t\t<\/li>\n
  2. \n\t\t\tBuilding with RCX\/NXT lamps and EV3 pieces<\/a>\n\t\t<\/li>\n
  3. \n\t\t\tProgramming Bluetooth on EV3<\/a>\n\t\t<\/li>\n<\/ol>\n

    View the entire series<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

    On 27 February 2015, a small group of EDGErs went to LEGOLAND for an EV3 Hackathon. This post documents one of the projects that came out of the event. For the EV3 Hackathon, Magee and I built a low-tech intersection–one that controls traffic flow using boom gates rather than bluetooth signals. Since the cars were […]<\/p>\n","protected":false},"author":13,"featured_media":10023,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[110,143,69],"_links":{"self":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/10000"}],"collection":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/comments?post=10000"}],"version-history":[{"count":1,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/10000\/revisions"}],"predecessor-version":[{"id":14393,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/10000\/revisions\/14393"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media\/10023"}],"wp:attachment":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media?parent=10000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/categories?post=10000"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/tags?post=10000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}