This project is about making a robot. That can write for me. In my handwriting. A robot that copies my friend's homework and writes it for me in my handwriting. I don't even need to touch pen & paper. I just need someone's homework and feed it into this robot. And this robot will write it for me on paper. And no one can guess that if this is written by a robot & not by me.
I decided to make it because I was bored of writing homework. Just copying homework is boring. So, I decided to make this robot.
This robot works on the principle of OCR and image combination. This can be fed to the Arduino program. The Arduino then controls two servo motors (SG90). To draw a shape on paper. The motors operate on an inverse kinematics mechanism.
For this robot to generate text in your handwriting, it requires sample data of your handwriting.
So, you need to write all the alphabets, numbers, and symbols.
- Take a blank page.
- Write all upper case alphabets (Capital letters) i.e. A-Z.
- Write all lower case alphabets (Small letters) i.e. a-z.
- Write all digits (numbers) i.e. 0-9.
- Write all the possible special characters like " ',. ? ! = + - * etc.
Take a clear photograph of the pages.
The photograph may not be aligned straight. So, use any document scanner. And align the images straight. And make the background white (this is very important).
Then you need to crop the images into individual images. Each image should contain a character in it.
Select any image size (dimensions height x width) and keep it fixed for the entire duration. I used a 60x40 image size.
Name the cropped images as per the character they contain. For example- an image for 'a' can be named as a.png whereas an image for 'A' can be named as 'a_capital' or 'a_c', so it will be easy to access them in code.
Now write the code to combine images as per text and enjoy.
This image is the homework. This is my friend's handwriting. Which I will convert to my own handwriting.
For doing so, I will scan and convert it to text with the help of google lens. Paste this text into a text file. The path to this file is provided in Code.
Go to IDE & Run the code and you. will see the magic.
And the homework got written in my handwriting. I can easily send this homework to my teacher. The generated homework is in image format. Which can be converted to pdf if required.
If you have any assignment/ homework and you got the answer from google. Then just paste it into the document(text file). And run the code.
Your assignment will be generated within seconds. Without writing.
The generated image/ assignment is 70-80% similar to what human handwriting looks like. This efficiency can easily be increased if the image quality is good. And the scanner is good enough.
The python code will send data to Arduino ide. And depending on the character received, the Arduino will control the two servo motors.
The two servos motors will be connected to a rigid support. They will form a 5 bar mechanism. It consists of inverse kinematics mechanisms.
The code in Arduino IDE uses inverse kinematics to make accurate angle calculations for the servo motor.
The angle calculation for the motors is done by trigonometry. So, by placing it in front of paper it can draw anything. Thus producing whatever sent to it.
If we want to print X.
The Adruino IDE already has the matrix format for each character. So whenever a character arrives at Arduino IDE from Python IDE. The respective matrix is used.
As of now, only straight lines, circles & squares are drawn from it. I am trying to improve it further to draw characters.
My teacher didn't catch me, hope neither yours. (Just kidding - I haven't submitted this to my teacher, neither you should do it).
This project is just for technology demonstration prototype & not for malpractice.
That's all for now.
Happy Tinkering!!
Comments