A pantograph is a machine that lets an artist copy an image by tracing the original. Traditional mechanical pantographs use a complex linkage system to move the output pen relative to the stylus. While 1:1 pantographs do serve a purpose, the real value comes from a pantograph’s ability to scale the output. It is possible to create an output drawing several times the size of the traced image and also to do the opposite, which is particularly useful for fine engraving work. Mechanical pantographs are now niche machines, but this tutorial will walk you through how to build an electronic version using an Arduino and Hall effect sensors.
Hall effect sensors detect the presence of a magnetic field and engineers often use them as proximity sensors. For example, security systems use Hall effect sensors to detect when a door closes or opens. But Hall effect sensors also detect the magnitude of the magnetic field, which means they are useful for more than binary proximity detection. In this case, two 49E linear Hall effect sensors in the joints of the pantograph’s tracing arms monitor rotational angle. Those connect to an Arduino Nano board as analog inputs so the Arduino can monitor the magnitude of the magnetic fields and determine the angle of each joint.
With some simple trigonometry, the Arduino can use the joint angles and arm lengths to calculate Cartesian XY coordinates. A push button on the input stylus lets the Arduino know when the user is tracing a line or when they are moving between lines. The Arduino then outputs the traced lines as a series of G-code commands, like what a 3D printer or pen plotter works with. A simple GUI interface displays the traced image and the user can configure the scale and resolution. To produce a scaled output, the user can either print the image or send the G-code to a pen plotter. This electronic pantograph does have practical applications, but it is especially useful as an educational project to learn the fundamentals of Hall effect sensors, analog inputs, and applied trigonometry.
Read more about this on: Arduino Blog