Introduction: Mechanical 7 Segment Display

About: Electrical Engineer and a Maker from India. Engineering is fun once you start applying it!

I am currently in the final year of electrical engineering and was working on my final year project model. As a part of the project, I had modified a ceiling fan to work as a generator. I had replaced the original thin gauge winding with a thicker one to suit the power requirement. But due to lockdown, I was forced to scrap the model and continue just with the theory part. A lot of enameled copper wire was going to be wasted and so I decided to reuse it.

As I always do, I started going through projects on the internet. I came across the 'Mechanical 7 Segment Display' which used servo motors to move the segments. Those are fun to watch but I didn't like the sound they made. So, I decided to choose another way to move the segments.

In this Instructable, I will be showing you how I made a mechanical 7 segment display using electromagnets to move the segments. Before starting, I want to let you know that this is not an efficient design. I have used whatever I had already laying around. I will try to improve it in the future maybe but for now, I am having fun!

Let's get started!


  • 1x Arduino Nano
  • 7x IRF540N N-Channel MOSFET
  • 7x 1N5408 Diode
  • 7x Magnets
  • 7x 10k Resistor
  • 7x 100-ohm Resistor
  • Perfboard
  • Enameled copper wire

Step 1: The Plan

The plan is to move the segments back and forth using electromagnets. The segments will normally sit flush with the surface of the display. Each segment will have a small magnet behind them.

The electromagnet is energized such that the magnet is repelled and hence the segment will be pushed outward above the surface. When the electromagnet is de-energized, the magnet gets attracted to the iron core of the electromagnet and the segment is pulled in back to its original position. The movement of the segment should be within the limits.

The segments will be connected in common anode configuration and controlled using an Arduino in the same way as the normal LED 7 segment display. The only difference is that Arduino cannot supply the current required by the electromagnets. Hence, the switching will be done by MOSFETs.

Step 2: Making Electromagnets

I am using a 24 gauge enameled copper wire which can carry approximately 2A maximum current. You can use an online tool to find out the parameters for your electromagnet. Again, I made mine without much thought and calculations. The magnetic field strength depends upon three factors viz. current, length of wire (or turns), and core material.

The core must a ferromagnetic material i.e a material that can be magnetized. For example, soft iron, steel, nickel alloys, etc. I will be using steel screws which I had or can be easily found. Magnetic field strength is directly proportional to the current (I) and the number of turns (N). You can either increase current or increase the number of turns. Since I was using a relatively thicker gauge wire than you would normally use, the size of the electromagnet was getting too large. To reduce the turns I had to increase the current. I decided to allow a maximum of 1.5A for which the resistance of the coil must be approximately 3.3 ohms (5V/1.5A). I measured the resistance of 1m wire and then calculated how much wire I would need to get a total of 3.3 ohms. This turned out to be approximately 16m. You need magnetic field strength just enough to push the magnet along with the segment. You might need to experiment a little bit here.

I 3D printed a small bobbin onto which the wire will be wound. The STL files have been attached. You can even wound it directly on the screw but I found this convenient. I used a drill to wind the electromagnet to speed up the process. Finally, insert the screw and glue it. Your electromagnet is ready.

Repeat the process 7 times.

Step 3: Assembling the Display

Download the attached STL files and 3D print them. You might need to use supports for the segment.

  • Face (x1)
  • Segment (x7)
  • Limiter (x14)
  • Clamp (x7)

The segments might require some sanding depending on your 3D printer. Make sure that the segments move smoothly in their slots.

Insert the 'limiters' (I couldn't come up with a better name) as shown in the picture. These limit the motion of the segments within a specified range.

Next, glue the magnets in the center of each segment as shown. Make sure that all the magnets are oriented/facing the same way. This will make things a lot easier later.

The clamps will hold the electromagnets in place. Add some tape around the electromagnet is the fit is a bit loose or use a cable-tie to tighten the grip.

Next, glue the clamp along with the electromagnet over each segment.

Step 4: Circuit and Its Working

The circuit diagram has been attached. Make the connections are per the diagram.

Energize one electromagnet in such a way that it pushes the segment. Note the polarity of the supply. Join '+' of all the electromagnets together and connect them to +5V since it is a 'common anode' display. Now if we connect the remaining end of each electromagnet to GND, that particular electromagnet will be energized. These ends are now connected to the Drain (D) terminal of each MOSFET (IRF540N). A positive voltage at the Gate (G) terminal turns ON the MOSFET which closes the D-S path.

An electromagnet is an inductive load. When it is operating, a magnetic field is created around it. But when it is switched OFF, the magnetic field collapses and creates a huge voltage spike which can damage the MOSFET. To avoid this, an alternative path is provided for the excess current to flow and die out by using a freewheeling diode (1N5408). Normally, this diode should at least be rated to handle the normal continuous current.

10k resistor is used as a pull-down resistor to avoid false triggering of MOSFET.

Important: Total current can reach around 10.5A ( = 1.5 x 7). Make sure you use the appropriate gauge of wire. Also, make thick solder traces for the GND connection. I have used 3 strands of solid copper strand to be extra safe.

All the above components are soldered on a perfboard and attached on the backside of the case. The connection to each Gate terminal is brought at the male header terminals for applying pulses using any type of control circuit. To turn ON one segment, apply 5V logic at the male terminals. Here I have used an Arduino in combination with a shift register to provide the appropriate pulses to the display.

Step 5: Time for Coding

The sketch file has been attached. Download and open it using Arduino IDE. There is nothing special in the code.

The bytes are stored in an array (digit[]). The bits are sent serially to a shift register which then 'shifts out' the bits parallelly. The bits are arranged in the following manner:


If you want to display number 1, then segments B and C should be ON while the remaining should be OFF. So, the byte to be sent to display number 1 is '01100000'. The last bit should always be 0 since we have 7 segments and a byte has 8 bits.

Step 6: Enjoy!

Double-check all your connections. Finally, connect the display to a 5V SMPS which can supply at least 10.5A. Connect the output of the shift register to the display and upload the code to the Arduino.

I love watching it and hearing the clicking sound of the segments moving in and out. I know this is not at all useful but I learned a lot and had fun making it. I might make it more efficient in the future.

Thank you for sticking to the end. I hope you all love this project and learned something new today. Let me know if you make one for yourself. Subscribe to my YouTube channel for more such projects.

Step 7: Improvements

A single digit is not much of use. At least 4 digits would be required to display anything useful like time, subscriber counter, etc. As stated earlier, I would like to make a less power-hungry version with some physical modifications.

  • Improving the design to reduce assembly required by printing as much as I can in one go.
  • Reduce the size of electromagnets by using thinner gauge wire and more turns.