Electromechanical Decimal to Binary to Hexadecimal Converter




Introduction: Electromechanical Decimal to Binary to Hexadecimal Converter

About: Electromechanical Engineer, Product Designer, Maker. I love to make prototypes and teach others in the process. I graduated from UCF and spent two years working at NASA.

It is using an ESP32 equipped with an OLED display, two mechanical 7 segment displays and 14 relays. I'm using two NXP MC33996's along with the DPDT relays in an h-bridge configuration. To set(display) each individual segment it needs at least a 1ms pulse and to reset the segment it needs to be pulsed with the opposite polarity. This was a proof of concept before I design a much larger clock with 6 digits and 46 relays with two sets of flip dots as colons. The sound is amazing and I could not be happier with how it turned out.

Step 1: Bill of Materials

(1 ×) ESP32 with OLED Display

(2 ×) Mechanical 7 Segment Displays

(11 ×) LEDs - 0805 SMD

(1 ×) Dual Voltage Power Supply - RD-50A MEAN WELL

(11 ×) 180 ohm Resistors for LEDs - 805 SMD

(3 ×) 470uF Electrolytic Capacitors

(2 ×) 47uF Electrolytic Capacitors

(3 x) Momentary Push Button - SMD

(3 ×) 10K Pull-up Resistors - 805 SMD

(14 ×) DPDT Relays

(14 ×) Schottky Diodes - 1.5KE18CA-T - Used as flyback diodes for the relays

(14 ×) TVS Diodes - 1.5KE18CA-T - Used as flyback diodes for the AC segment coils

Here is an overview of the mechanical 7 segment displays:

Step 2: Schematic With PCB Build Files

You can order the board shown in the video from a PCB manufacturer or you can solder it up on your own with through hole components if you'd like with my schematic.

Step 3: Solder the PCB

In this video I use a stainless steel solder paste stencil to perfect put solder where I want. I use a hotplate set to 170C and a hot air gun to solder the SMD components.

Step 4: Program the ESP32 With the Arduino IDE

Download the Arduino core for the ESP32 here:

Download my attached source code and program your ESP32 with the Arduino IDE.

Step 5: Questions?

Thank you for reading my Instructable. Let me know if you have any questions and I will be happy to answer what I can.

Anthony Garofalo(Proto G)



    • Water Contest

      Water Contest
    • Fix It! Contest

      Fix It! Contest
    • Metalworking Contest

      Metalworking Contest

    15 Discussions

    Hi! I actually don’t know how to comment You’r Ible?
    I have a ”calculator” ewer since them 80’s, that have the capabilety to translate any given number from  decimal to Biquinary to Hex- to decimal to Octal, and all the functions from to and to, in what so ewer order.

    You list the same part number 1.5KE18CA-T for the relays and segment coils, yet the schematic shows a 1N5817 across the relay coils and 1.5KE18CA-T for the segment coils. Should something be different in the parts list from what the schematic shows?

    Anthony - I would be very interested in your proposed clock. Do you plan to do an Instructable on that as well?


    1 more answer

    6 months ago

    Very Very Cool..

    Just a little constructive critique, your schematic diagram is quite difficult to read, and is fairly cluttered.
    I would have shown a the connection from the chip, through the relay and to the segment on a single continuous diagram, but for just one segment, and make a note that the relay circuit is the same for each segment, and then just list off each segment circuit at the NXP chips.

    This would make it easier to follow and far easier for someone to use and expand for their own projects.

    1 reply

    Thanks, I agree, but I will not be updating that schematic any more but I will try to make the clock easier to understand. Feel free to update the schematic as I have released all the build files including the KiCAD PCB files.

    Wow, I'm surprised nobody has commented on this article because it's actually pretty good. The author takes an electro-mechanical display technology typically found only in professional outdoor equipment and is figuring out how to put it to good use in something cool for indoor use. Like a clock. Well done!

    To benefit from your experience, I have a few questions/comments:

    I suspect you are using relays instead of h-bridge ICs to preserve the electro-mechanical style of the display and you like the clicky-ness?

    The AlfaZeta datasheet for the displays used in the project seem to recommend a minimum pulse width of 1ms at 19V for any segment, not to exceed 45ms during a 945ms period (5% duty cycle) in order to prevent heat accumulation in the energizing coils. Is that your experience with these displays?

    The AlfaZeta datasheet also suggests a minimum coil voltage of 16V. But the schematic for the project indicates you are using 12V. An reason for the difference or did you determine from experiment that 12V was sufficient?

    Are the 1.5KE18CA ESD suppressors and 1N5817 rectifiers really needed? The MC33996 has internal over voltage protection on each output specifically for inductive loads.

    You mentioned in the video that you were glad you didn't go for the full project on the first go. What issues did you find in the smaller project that made starting with it a better idea?

    Thanks for an interesting article. Made me think!


    2 replies

    Thank you! Experimenting with 12V proved perfectly fine for me and I have never had a misfire even at full speed. The coils are not heating up at all with my setup even though I am driving them faster than recommended but that may be because I'm using 12V.

    Using relays was used for the sound but they are being used in an h-bridge configuration. Using MOSFETs would be quieter but you wouldn't be able to run the segments any faster because I'm already running them faster than recommended.

    The schematic in the instructable is updated to include rework I had to do and improvements I made. MC33996 reset pin needs to be connected to reset of the ESP32 or 3.3V. I added shottky diodes to the relays and TVS diodes to the individual segment coils. Also changed the SOPWR pin on the MC33996 from 12V to 3.3V. So keep in mind if you want to use these gerbers as is, you will need to rework the board just as I did. The footprint on my ESP32 board was mirrored as well so I had to add the protoboard with the pins swapped.

    I also thought I didn't need the TVS diodes or the schottky diodes either because the MC33996 has internal protection but I was wrong. The relays and segment coils have spikes of over 300Volts without the changes I made. Both NXP chips partially failed the first time I powered the board up. In the video where the digits are being driven at maximum speed, repeatedly slamming those chips with 300V isn't good. Now they're below 50V spike which the chips are rated for and everything is working perfectly.

    Ah. I was afraid of that. The output port over-voltage suppression specification on the MC33996 was too optimistic or intended for the occasional spike, not a continuous stream of them.

    I'm guessing the AlfaZeta specification is very conservative given that they end up being used in outdoor environments. Makes sense.

    Thanks for the reply!



    Question 6 months ago

    Are relays obligatory? I mean, they are very expensive - can't we use transistors in H bridge configuration?

    1 more answer

    The relays are not necessary and are purely a aesthetic decision and the digits could just as easily been driven with an MC33880 operating as an SPI octal h-bridge. The relays are currently used in an h-bridge configuration.

    No, I made my own controller.


    6 months ago

    I don't even know what the title of this instructable means, but I'm sure its very impressive. I clicked the link in hopes to learn something, but this is just way over my head. I get that you're using flippy numbers to make a clock that clicks... and something to do with binary. LOL. That said, I do think that the resulting clock will be really freaking cool and I hope that when all is finished, you add a video of that. It looks cool, it sounds cool... and thank you for the video explaining the 7 segment displays and your plans - it helped a dummy like me get the gist of what you're trying to do.

    I'm going to have to spend hours now researching "electro-mechanical" and "hexadecimal". I did about 30 seconds of research on them and am more confused than when I clicked the link.

    Anyway, just wanted to say good job, and I think the end result is going to be awesome and I'm actually sorry that I'm not able to fully appreciate it.

    1 reply


    Hex is a base-16 numbering system.
    People use base-10 because we have 10 fingers.
    In base 10 there are ten symbols: 0, 1, 2.....9. When you get to 9 you run out of room so you put a 1 in the tens place. Repeat this process until 99. Add a hundreds place, etc.

    In hex there are 16 symbols: 0, 1, 2,....9, a, b, c, d, e, f
    a = 10, b = 11, and so on until f = 15.
    So when you get to 15 (f) you move over to the sixteens place. So "10" in hex actually equals 16. a0 equals 160 (the a is worth ten, but it is in the sixteen spot). a1 = 161, a2 = 162,......FF = 255

    Why do this?
    Hex is a better way to represent binary, a base-2 system. It only uses 0 and 1. So 10 in binary equals two. 11 = 3. 100 = 4.
    Computers & electronics work by turning bits (transistors) on (1) or off (0).
    If you've ever seen a computer crash it spits out stuff like 0xffa0dfff. These are memory addresses

    FF is 255. In binary it would be written as 11111111. This is an 8-bit address.
    FFFFFFFF is a 32-bit address. Imagine trying to read a string of 32 ones & zeroes.