Complete Mechanical 7 Segment Display
by indoorgeek in Circuits > Arduino
10307 Views, 147 Favorites, 0 Comments
Complete Mechanical 7 Segment Display
Hello and welcome back! Over the last few months, I am in the process of making a mechanical 7 segment display that uses PCB coils or electromagnets to actuate the segments. I had a lot of fun while learning new things. The project was so well-received, it even got published in Hackspace Magazine, twice! I received many comments as well as suggestions from you all. Thank you, everyone!
Mosiver, a physicist and maker, got inspired by this project and built an awesome "8x8 Haptic Wordclock". Do check it out!
Till now, I was making only a single digit. One digit is not much of a use. So, in this Instructable, I will be combining 4 digits together to display something useful. This is going to be the last iteration (probably).
Let's get started!
Things You Will Need
1x Arduino
7x DRV8837 H-Bridge Driver IC
2x 74HC04 NOT Gate IC
1x 74HC595 8-bit Shift Register IC
7x Neodymium Magnets 6mm x 1.5mm
1x 7-pin male header
1x 7-pin female header
1x 5-pin right-angled male header
1x 5-pin right-angled female header
4x M3 Screws
PCB Design
There will be only one change in the design, the rest being the same as the previous one. Though the previous version worked as expected, the shape of it wasn't very eye-pleasing. It had an empty space at the bottom as all the electronics were placed in that spot and the rest of the portion were the PCB coils. To make it symmetrical, I split the PCB into two parts. One part with just the coils, while the other part had the electronics as shown in the image. The PCB with the electronics will be attached to the main PCB from the back using header pins as shown. Now you can see only the segments from the front and no empty space. Looks good!
Once I was happy with the design, I uploaded the Gerber files on JLCPCB to get them fabricated. Click here to get the files if you wish to make one.
3D Printing
No major change here as well. Just that the empty is now no more. The rest is the same as the previous versions. I have attached the STEP as well as STL files for one digit.
Also, many of you suggested me to use two colors for the segments to improve the visibility. I tried it and it looked way better! Printing in two colors is an easy task for dual-extruder printers. Here's how you can do the same with Ender 3 (or equivalent).
Printing segments in two colors:
The segment STL file contains 7 segments. Start the print as usual in white. Once the print height reaches 1mm, go to Tune, scroll down and select Change FIlament. The printer will stop printing. Now replace the filament with a contrasting color one and press the knob. The printer will resume printing from where it left.
Putting Things Together
Once I received the PCBs from JLCPCB, I soldered the SMT components on the PCB. The tiny H-bridges were quite tricky but everything went well. I still need to work on my stenciling skills. After SMTs, I soldered the male and female headers on both the PCBs as shown in the images.
There is adequate spacing between the segments and the face to ensure free movement of the segments. Depending on the print results, it might require some sanding.
Each segment has a slot to accommodate a 6 x 1.5 mm disc neodymium magnet. Make sure that the magnetic pole created by the coil on the front side is the same as the pole of the magnet which is facing the coil. In simple words, insert the magnet in the segment in such a way that the coil repels the segment. Use super glue to secure the magnet in place.
Finally, connect the two parts together as shown and there's your digit. Make as much as you want and connect them together. There's one problem with this design. It is not stiff enough. When many digits are connected, it all gets sloppy. So, I printed a big 4 digit display in one piece.
Time for Coding
As mentioned in one of my previous Instructables, I have used shift registers to control the display. Each digit has one register. When more digits are connected, the shift registers get connected in a cascade. This means that data leaving the previous register enters the next register. In other words, the output of the previous register becomes the input to the next register.
Luckily I found this Arduino library called ShiftDisplay by Miguel Pynto. It is a great library for driving multi-digit segments with lots of handy functions. The library also allows us to choose between a Static drive (which is exactly what I wanted) or Multiplexed drive. But there was a slight problem, I had designed the PCB such that the data travels from right to left. Or in other words, the rightmost digit is 1 while the library assumed totally opposite i.e. leftmost digit is 1. But that wasn't too difficult to fix. After going through the code, I found the part of the code which was responsible for sending out the bits. I just reversed the order of sending bits as shown in the image.
You can find this file at Arduino > Libraries > ShiftDisplay > src > ShiftDisplay.cpp. Open it using any text editor (like Notepad++), make the changes, and hit save.
So that was all about the library. I have attached the actual code. It is very straightforward.
Downloads
Enjoy!
Make sure there are no shorts before powering up the display. Now you can display any data you want like you would do on a regular seven-segment display.
Use an external 5V power supply to power the display. Make sure you connect the GND of Arduino and power supply together. The current drawn by a single digit is around 650mA. So, make sure your power supply is capable of delivering the current as per the number of digits connected.
Thank you for sticking to the end. I hope you love this project.