DIY Smart Pen

DIY Smart Pen


Hello guys in today’s smart world using a pen is quite boring, pens are being so low tech since they are invented. so I added some automation to it make it smart




1) Arduino Nano :-
2) MPU6050 GYRO :-
3) Servo motor :-
4) Lipo Battery :-



My this pen automatically open and close as per the orientation, like when pen lays down it will automatically close the pen and when pen lift to use it will automatically open.

Gyro scope gives data like acceleration data of X, Y & Z axis and GYRO data of X, Y & Z axis

but for this project we don’t need all such data just need data of Y axis

as per the image below we are getting data of Y axis when pen in laying or vertical position and we will use those data in code to run servo to make pen open and close.

graph is generated from Arduino serial plotter 

I used MPU6050 Gyro sensor to detect the orientation of when pen is in laying condition arduino nano receive the data from MPU6050 Gyro sensor and command servo to close the pen.


In same way when pen lift up to use then it became in vertical position and arduino gets data from MPU6050 and command servo to open the pen.


If you want to learn basics and configuration of MPU6050 Gyro sensor visit the link.

Complete code



Low cost PCB on PCBWay - only $5 for 10 PCBs and FREE first order for new members

PCB Assembly service starts from $88 with Free shipping all around world + Free stencil 

PCBWay 2nd PCB Design Contest



Hobbiest Electrical DIY project passionate

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image

Post comment