Intersections as we know them today can be unsuitable or even dangerous for some people.
Traffic jams can cause priority vehicles to lose precious minutes. In addition, the rules of priority at intersections are often ignored voluntarily or involuntarily, which can lead to accidents between users and vehicles in intervention.
In addition, the pedestrian intersection lights are often not adapted to people with reduced mobility and offer them too short a duration to allow them to cross the road
The project that will be presented to you responds to these two problems and aims to make intersectionssafer and more accessible.
First, to address the issue of safety and speed of priority vehicles in intersections, the lights at the intersection that do not correspond to the priority vehicle lane will turn red.
This is possible thanks to the use of a GPS signal sent by the priority vehicle to the server. It shows where it is and whether it is approaching a crossroads or a traffic light intersection.
Secondly, to address the issue of safety and the adaptation of pedestrian lights for people with reduced mobility, when the disability card is scanned, the pedestrian lights turn green for a sufficiently long period of time for the user to cross in complete safety and serenity.
For the demonstration of this project, we carried out a smaller-scale simulation. For this purpose, we have replaced the GPS tracking with hall effect sensors that allow us to detect whether the priority vehicle is present at the intersection. Also, we will use a push button to replace the magnetic card sensor.
Pressing the push button simulates a pedestrian with reduced mobility who wants to cross. Once the signal is detected, the time for the person to cross the road before turning red is longer.
If a priority vehicle is detected at the entrance to the junction, using the Hall sensor, all the lights turn red except the one in the lane concerned which flashes green. Once the vehicle has passed the second sensor on the other side, the normal traffic cycle resumes
2. High level architectureHigh Level Architecture
3.PrerequisitesThe following tools are required to run this demonstration.
- Python 3.8+ environment for running ACME oneM2M platform.
- Arduino IDE 1.8.9 (or later)
- Visual studio code
- Node.js environment for IoT Applications
Download the necessary resources from the main repository:
https://github.com/FranC-Hackathon
This repository includes different projects:
- oneM2M-IoT-Device: The NodeMCU Sketch(es)
- oneM2M-IoT-Application: IoT applications written in Node.js
You will also need an implementation of oneM2M platform :
- ACME: An open-source implementation in Python (link)
https://github.com/ankraft/ACME-oneM2M-CSE
5. Start the oneM2M-compliant IoT Platform5.1. Configure the IoTPlatform (ACME)
The default configuration can be used for a local demonstration. The IoT platform will listen on port 8080. The database is reset after each restart.
If needed, you can change the configuration of the IoT Platform by editing the file: "acme.ini”.
5.2. Start the IoTPlatform (ACME)
The IoT Platform can be launched through:
python3 -m acme
You should see at the end of the logs "CSE Started".
5.3. Login to ACME web interface
Open the following URL in your browser to access the ACME IoT platform web interface: http://127.0.0.1:8080/
With the default configuration, enter the originator "CAdmin" and then "Connect"
You will be then able to see the oneM2M resource tree:
The NodeMCU source code is available on the folder "oneM2M-IoT-Device" folder.
6.1. Schematics
- 1 Breadboard
- 1 NodeMCU board
- 2 hall sensors
- 1 Push button
- 4 red leds
- 4 green leds
- 1 white led
Solution Wiring
6.2. Set up Arduino IDE for NodeMCU development
If not already installed, download and install the Arduino IDE from the following link: https://www.arduino.cc/en/Main/Sousing
NB: We do not recommend using the Arduino Web Editor for this demonstration because the NodeMCU board is not supported.
When plugged, if the NodeMCU port is not detected, then you need to download and install the USB driver manually using the following link: https://github.com/nodemcu/nodemcu-devkit/tree/master/Drivers
6.3. Add NodeMCU board support to Arduino IDE Firstly, open the Arduino IDE, go to "Files" > "Preferences" entry.
Copy the below URL in the "Additional boards Manager URLS" Textbox:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Click "OK" to close the "Preferences" dialog box.
After completing the above steps, go to "Tools" > "Board:..." and then select "Board Manager"
Type in the textbox "esp8266", then navigate to "esp8266 by esp8266 community" and "install" the software for Arduino.
Go to "Tools" > "Board...", and then select "NodeMCU 1.0"board.
Once all the above process been completed, you are ready to program the NodeMCU board with Arduino IDE.
6.4. Configure the NodeMCU sketch
Open the sketch "NodeMCU_RemoteControlSensor-ServoActuator.ino" in your Arduino IDE.
Set your WIFI parameters
char* WIFI_SSID = "FILL_THE_WIFI_SSID";
char* WIFI_PSWD = "FILL_THE_WIFI_PSWD";
Set the IP address of the ACME IoT platform in your network:
String CSE_IP = "X.X.X.X";
6.5. Compile the NodeMCU sketch
Click on verify button to compile the sketch.
Compilation output:
6.6. Upload the sketch to theNodeMU board
Click on upload button to upload the sketch to the NodeMCU board.
Upload output:
6.7. Debug the code execution using serial monitor Click on button to open the Arduino Serial Monitor to display the NodeMCU console.
Then after opening the Serial Monitor select 115200 from the drop-down list.
6.8. Check IoT device resources on ACME web interface
You should see Application Entity resource with “DESCRIPTOR”
and “DATA”
containers created on the oneM2M web interface.
7.1. Configure the application
You can use one of the provided application: NodeJS IoT Application
NodeJS IoT Application
Set the IP address of the ACME platform (variable "monitorIP"). You can keep localhost (127.0.0.1) if you are running the ACME platform and the application in the same computer.
7.2. Start the application
NodeJS IoT Application
On a terminal, install the following Node.js modules using the npm tool (installed by default when Node.js is installed):
> npm install express
> npm install request
> npm install body-parser
Start the Node.js oneM2M IoT application using the following command:
> node FranCpp__IoT_Application.js
7.3. Check IoT application resource on ACME web interface
You should see Application Entity (AE) resource created on the oneM2M web interface. Also check the creation of Subscription resource.
8. DemonstrationThe smart crossroads has two functions :
- Adaptation of crosswalks for people with reduced mobility
Pressing the push button simulates a pedestrian with reduced mobility who wants to cross over.
The pedestrian light turns green and stays on for a longer period of time to allow the mobility-impaired pedestrian time to cross safely.
- Securing intersections for high-priority vehicles
When an high-priority vehicle arrives at the hall sensor that indicates its entry into the intersection, the light in its lane turns green while the lights in the other lanes turn red until it passes the second hall sensor that indicates its exit from the intersection.
Comments