{"id":22267728,"url":"https://github.com/addleonel/anpr-arduino","last_synced_at":"2026-02-22T23:33:40.476Z","repository":{"id":186139780,"uuid":"674691821","full_name":"addleonel/ANPR-Arduino","owner":"addleonel","description":" Automatic Number Plate Recognition (ANPR ) using Arduino","archived":false,"fork":false,"pushed_at":"2023-11-07T12:32:24.000Z","size":18088,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T14:32:22.436Z","etag":null,"topics":["anpr","arduino-uno","computer-vision"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/addleonel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-04T14:35:06.000Z","updated_at":"2025-10-01T07:26:42.000Z","dependencies_parsed_at":"2023-11-07T13:35:38.534Z","dependency_job_id":"f8b03ffa-7eca-456d-a546-c39795d1dc77","html_url":"https://github.com/addleonel/ANPR-Arduino","commit_stats":null,"previous_names":["addleonel/anpr-arduino"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/addleonel/ANPR-Arduino","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addleonel%2FANPR-Arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addleonel%2FANPR-Arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addleonel%2FANPR-Arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addleonel%2FANPR-Arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/addleonel","download_url":"https://codeload.github.com/addleonel/ANPR-Arduino/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addleonel%2FANPR-Arduino/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29730747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anpr","arduino-uno","computer-vision"],"created_at":"2024-12-03T11:08:34.493Z","updated_at":"2026-02-22T23:33:40.459Z","avatar_url":"https://github.com/addleonel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ANPR with Arduino\n\nAutomatic license plate recognition with Arduino.\n\n## Architecture\n\nThis project is made up of four environments:\n\n![](https://raw.githubusercontent.com/addleonel/ANPR-Arduino/main/docs/diagram.png)\n\n1. Database and back-end\n2. API\n3. Desktop application (a script executor)\n4. Arduino and camera\n\n## Requirements\n\n### Database, back-end, and API\n\nI recommend using a virtual environment. You can use `venv` or `conda`. Then you need to install the dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\nI'm using Django to run the server, so you need to run the migrations, makemigrations, and createasuperuser. You can do it with the following commands:\n\n```bash\npython manage.py migrate\npython manage.py makemigrations\npython manage.py createsuperuser\n```\n\n### Desktop application\n\nBefore running the desktop application you need to install tesseract. You can follow the instructions in [Tesseract installation](https://github.com/UB-Mannheim/tesseract/wiki).\n\nOpen the `engine.py` file (which is in the `massif` folder) and change `pytesseract.pytesseract.tesseract_cmd` according to your tesseract installation path. For example:\n\n```python\npytesseract.pytesseract.tesseract_cmd = r'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'\n```\n\n### Arduino and camera\n\nRun the Arduino IDE and open the FirmataStandard example (`File \u003e Examples \u003e Firmata \u003e FirmataStandard`). Then upload it to the Arduino, Make sure to connect the Arduino first.\n\nMake sure to connect the camera to the computer.\n\n## How all components are connected\n\nAs we notice the database, server, API, and desktop application is almost ready to run, but before doing that we need to connect LEDs and sound sensor to the Arduino. The following diagram shows how all components are connected:\n\n![](https://raw.githubusercontent.com/addleonel/ANPR-Arduino/main/docs/diagram-2.png)\n\nthe LEDs are connected to pins 10, 11, 12, and 13. The sound sensor is connected to the pin A0. You can change the pins in the `controller.py` file:\n\n```python\nled_1 = board.get_pin('d:12:o')\nled_2 = board.get_pin('d:11:o')\nled_3 = board.get_pin('d:10:o')\nsound_pin = board.get_pin('a:0:i')  # Analog pin 0, input mode\nled_4 = board.get_pin('d:13:o')\n```\n\nThere are four colors of LEDs, each color is associated with a specific action:\n\n| Variable | Color  | Action                                                                                                                |\n| -------- | ------ | --------------------------------------------------------------------------------------------------------------------- |\n| led_1    | Red    | Indicates that the license plate is in the database and that it is on the wanted or banned list.                      |\n| led_2    | White  | It indicates that the license plate is in the database and that there are no problems due to any improper commission. |\n| led_3    | Yellow | Indicates that it identified a license plate. Regardless of whether or not it is part of the database.                |\n| led_4    | Blue   | Turn on when the sound sensor detects a sound.                                                                        |\n\nAn extra feature is that camera rotates 180 degrees. to do that we need another Arduino, a Stepper motor, and a stepper motor driver. Finally, upload the following code to the new Arduino:\n\n```cpp\n#include \u003cStepper.h\u003e\n\nint stepsPerTurn=2048;\nStepper motor(stepsPerTurn, 8, 10, 9, 11);\nint stepsPerTurnLoop = 512;\nvoid setup() {\n  Serial.begin(9600);\n  motor.setSpeed(10);\n}\n\nvoid loop() {\n  motor.step(stepsPerTurnLoop);\n  delay(2000);\n  motor.step(-stepsPerTurnLoop);\n  delay(2000);\n}\n```\n\n## How to run it\n\nThen you can run the server:\n\n```bash\npython manage.py runserver\n```\n\nwhen the server is running make sure to connect the Arduino and the camera. You can run the desktop application which is located in the `massif` folder in another terminal:\n\n```bash\npython engine.py\n```\n\n## Results\n\nThe following video shows the results. An entertaining video about the project\n\n[![An entertaining video about the project](https://img.youtube.com/vi/7bi59xWkrVs/0.jpg)](https://www.youtube.com/watch?v=7bi59xWkrVs) \u003cimg src=\"https://github.com/addleonel/ANPR-Arduino/blob/main/docs/results.gif\" alt=\"gif\" width=\"500\" height=\"360\"\u003e \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddleonel%2Fanpr-arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddleonel%2Fanpr-arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddleonel%2Fanpr-arduino/lists"}