OCR Optical Character recognition using VB.net and Arduino

(Last Updated On: July 17, 2019)

ocr

Description:

This tutorial is based on the OCR “Optical character Recognition” technology. In this project, the car number plates will be scanned using the OCR. For the Car number plates reading we will be making our own image processing application in visual basic .net“ VB.net”. The scanned numbers will be then compared with the pre-defined numbers and then display the car owner information and open and close the entrance accordingly using the electronic lock.

On the hardware side, the Arduino Uno will be used for controlling the door lock. The Arduino will do serial communication with the computer/laptop application.

About OCR:

Optical Character Recognition ( which is also known as the optical character reader, OCR) is the technology used for reading/scanning the text images, or any sheet or paper on which the text is written. In this tutorial, we will be using the same concept. We will be using a camera to scan the number plate in real time and then we will compare the scanned number with the predefined numbers stored in the program.


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
WebCam night vision supported: best deal on Amazon: https://amzn.to/2lZl23o
electronic lock: https://amzn.to/2tWDFta
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

Images which will be used as the number plates:

OCR

OCR

OCR

Circuit Diagram:

OCR

In the circuit diagram as you can see, I have used a Servo motor, but in the video, I controlled a door lock. The door lock is already explained in the video, so I decided to share with you the idea of how you can also control a servo motor.

If you are using a small servo motor then you can power the servo motor using the Arduino’s 5 volts. But if you are using a larger Servo motor then I highly recommend you should power the Servo motor using External power supply. You can make an external power supply based on the famous LM7805 voltage regulator. Make sure to add 470uf capacitors at the input and output sides of the voltage regulator for the best performance. You can watch my previous tutorials on how to use the Servo motor. you can find the related videos on my channel “Electronic Clinic”.


Programming:

This code is written for the Electronic Lock. I started by defining a Pin for the Electronic lock. So the electronic lock will be controlled using the Arduino’s Pin number 13. Then I defined a variable data of the type character. The variable data will be used to store the character received from the computer application.

After defining the Variables and Pins, the next step is to tell the controller which pin is the input or output and which baud rate we are going to use. To set any pin of the Arduino Uno as input or output for this we use the built in function which is pinMode() function. This function takes two arguments as the input, the pin number or pin name which in our case is elock, and the status which can be input or output. As the electronic lock is an output device so that’s why we set it to OUTPUT.

For activating the Serial communication we use a function called Serial.begin(). Serail.begin function is also a built in function and it takes only one Argument as the input which is the Baud rate. As the Arduino Uno board will be doing serial communication with the computer so for this we will have to define the baud rate. I Selected 9600. If you want you can set any other Baud rate. Finally we turn off the electronic lock. The void setup function only executes one time, when the Arduino uno Or Mega board is powered up.

The code inside the void loop function is very simple. All we are doing is just reading the serial port, store the received character in a variable data and then use some if condition to check if we have received the desired character to control open or close the electronic lock.


OCR Computer application Program:

This is how the final form looks like after designing. For the EmguCv installation and settings and form designing and program explanation watch video Tutorial available at the end of this Article.

OCR

Watch Video Tutorial:

 

Other Image Processing Projects:

Arduino image processing Eye Pupil Tracking, how to make Haarcascade XML file

 

Arduino Image processing CCTV camera system

 

Arduino Image Processing based Entrance lock Control System

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

3 Comments

Leave a Reply