Smart City Tunnel with PiicoDev

Updated 31 March 2022

Tunnels are a critical part of road infrastructure and they feature some pretty cool tech. This Smart Tunnel project demonstrates some of the technology involved and how some real-world problems might be solved. 

Features

  • RFID Trip Counting - Each unique RFID tag is tracked to give a total count of trips taken, and a per-vehicle breakdown.
  • Configurable Lanes - Each of the two lanes can be enabled/disabled with a capacitive button. A lane has either a red or green light to indicate its status.
  • Text display - The entry of the tunnel sports a text display that can show custom messages. Presently it warns when a lane is closed, or shows a safety message and trip count.
  • Ventilation - A user-controllable ventilation fan circulate fresh air through the tunnel.
  • Street Lights - Street lighting activates when ambient light is low.

Materials

Construction

Download the plans. This file is scale 1:1

I designed the cutting pattern with a vector editor and cut it out on a laser cutter - though it could just as easily be cut out by hand. The design features perforations for easy folding; If you're cutting the design by hand you can just score the cardboard to help create the fold lines. The cardboard is creased and folded into a tunnel shape, with the joins being stapled in place. Alignment tabs help keep everything secure. 

From here, it's just a matter of taping the electronics in place. Each arch features a flat platform that adds rigidity and creates a handy point to mount electronics and wiring.

tunnel-paper-construction

Connection

PiicoDev connections are daisy-chainable - each module plugs into the next without the need for soldering. The following diagram shows the topology. Note that since there are two RGB Modules being connected, they will each need unique ID switch configurations. See the PiicoDev Connection Guide for more information.

piicodev-connection-diagram

The servo and is powered by 5V from the Pico (VBUS) and receives signal from GP28.

The button is soldered to some pin headers and plugs directly into the expansion board, bridging GP16 and GND.

The RFID reader is the most complicated, needing a few point-to-point jumper wires as follows:

  • SCK to GP2
  • MOSI to GP3
  • MISO to GP4
  • RST to GP5
  • NSS to GP6

rfid-trip-countinglane-status-lights-and-sign
active-street-lightsuser-controlled-ventilation

raspberry-pi-pico-connections

Code

Download the code for this project, unzip, and copy it to your Pico. If you need help getting started, follow the guide: How to Setup a Raspberry Pi Pico and Code with Thonny

There are several files to upload - most of the files are device drivers. The user code (code that actually runs our project) is located in main.py.

Dazzle

A little bit of a creative touch goes a long way. Infrastructure should not just be utilitarian - it can be beautiful too. More and more roadways and other classically utilitarian infrastructure are being beautified by artists. One way we can beautify our tunnel is by adding murals to the walls. I also included some simple road artwork.

printed-artwork

The completed tunnel:

completed-tunnel

Next Steps

Our tunnel has some pretty impressive features - but this is just the start! There's plenty of other features and experiments we could include. Here's some inspiration:

  • Add a CO2 sensor and trigger the ventilation based off CO2 concentration.
  • Include a dangling bar to warn tall vehicles of height limits before they enter the tunnel.
  • Add a load-cell and ADC to weigh each vehicle that passes through the tunnel - classify each vehicle based on weight.
  • Include a distance sensor and classify each vehicle based on height.

Attachment - Project Files

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.