• Putting Batteries Inside a Laser Cut Enclosure

    Arduino Enigma01/14/2020 at 05:16 0 comments

    To put batteries inside a laser cut enclosure, one has to think in 3D using 2D:

    The pictures in this article will show how:


    And now that there is a built in battery compartment, then the question of how long will it run on batteries becomes more important.

    The following article shows a method of measuring run-time by writing timing checkpoints to EEPROM, no external components needed.


  • How to use Sketchup to design complex PCB shapes for Fritzing

    Arduino Enigma10/26/2019 at 17:40 0 comments
  • Added menu to edit UKWD

    Arduino Enigma10/22/2019 at 04:38 0 comments

    This simulator already had 5 UKWD rewirable reflectors, 4 were available to be used with the M3 machine, the other with the KD. The D reflector wiring can be changed in the field. The 5 reflectors included are examples of known wirings used at some point in time.A mechanism was needed to change the actual wiring of the reflector in this simulator.

    Adding an item now to the menu system is easier than developing it from scratch. It is just a matter of inserting an item in the existing menu system. The UKWD sub menu has two special features, it is skipped if the currently selected machine did not have a D reflector, and the user cannot leave that menu until the pairs specified are correct.

    Read more here:


  • What's the most efficient way to print things

    Arduino Enigma10/10/2019 at 04:06 0 comments

    We are at a stage of the project where things are getting standardized and optimized. The program needs to print a space every once in a while to separate groups of characters, as well as send the CR LF sequence to start printing things in a new line. We are curious what is the best way to do that.

    Let's start by saying that the most efficient way to print strings is to wrap them in the F("") macro. This keeps the string in PROGMEM, otherwise the string is stored in PROGMEM, then at runtime it is copied to precious RAM before printing and it is possible to run out of RAM if the sketch uses a lots of strings.


    Serial.print(F("HELLO WORLD"));  // DO THIS, 18 bytes code, 0 bytes ram

    don't do this:

    Serial.print("HELLO WORLD"); // DON'T DO THIS, 26 bytes code, 12 bytes ram

    Now, what what is the most efficient way to print a single space to separate two characters printed elsewhere? How about a newline / CR LF sequence?

    The sketch below was created to test different ways to print a space and a new line in between the A and B letters. 

    First a very basic sketch was created and compiled. The program size and ram usage were recorded.

    void testSerialSpace()     /*xls*/
    void setup()
    void loop()

     Then different ways to print a space and a new line were added, one at a time and the memory usage was obtained by subtracting it from the baseline program.

    The moral of the story is that the most efficient way to print a space is simply:

    Serial.print(F(" ")); // adds 8 bytes code, 0 ram

    Things got a little more surprising in the newline department.

    The obvious and wrong choice would be to print an empty string using the F("") macro.

    Serial.println(F("")); // adds 26 bytes code and 4 bytes ram

     But this added a whopping 26 bytes of code and 4 bytes of ram. Not sure why.

    After trying different combinations the most efficient way to send a newline is to do a regular print, not a println and send a hex escaped string with the CR LF sequence

    Serial.print(F("\x0d\x0a"));    // adds 10 bytes code and 0 bytes ram

    This result was a little unexpected. but now we know.

    The full results are listed below, ranking from most efficient to least efficient. The strings printed without F("") are at the bottom of the list, with the absolute worst  ways to send a single new line clocking at 40 bytes of code and 4 bytes of RAM.

    // moral of the story:
    // to print a space, use Serial.print(F(" "));
    // to print a newline, use Serial.print(F("\x0d\x0a"));
    //  Only prints AB
    //  Sketch uses 1,794 bytes (0%) of program storage space. Maximum is 253,952 bytes.
    //  Global variables use 182 bytes (2%) of dynamic memory, leaving 8,010 bytes for local variables. Maximum is 8,192 bytes.
    //  Serial.print(F("HELLO WORLD"));
    //  Sketch uses 1,812 bytes (0%) of program storage space. Maximum is 253,952 bytes.
    //  Global variables use 182 bytes (2%) of dynamic memory, leaving 8,010 bytes for local variables. Maximum is 8,192 bytes.
    //  Serial.print("HELLO WORLD");
    //  Sketch uses 1,820 bytes (0%) of program storage space. Maximum is 253,952 bytes.
    //  Global variables use 194 bytes (2%) of dynamic memory, leaving 7,998 bytes for local variables. Maximum is 8,192 bytes.
    //  Serial.print(F(" "));
    //  Sketch uses 1,802 bytes (0%) of program storage space. Maximum is 253,952 bytes.
    //  Global variables use 182 bytes (2%) of dynamic memory, leaving 8,010 bytes for local variables. Maximum is 8,192 bytes.
    //  Serial.print(F("\x0d\x0a"));
    //  Sketch uses 1,804 bytes (0%) of program storage space. Maximum is 253,952 bytes.
    //  Global variables use 182 bytes (2%) of dynamic memory, leaving 8,010 bytes for local variables. Maximum is 8,192 bytes.
    //  Serial.print(" ");
    //  Sketch uses 1,810 bytes (0%) of program storage space. Maximum is 253,952 bytes.
    //  Global variables use 184 bytes (2%) of dynamic memory, leaving 8,008 bytes for local variables. Maximum is 8,192 bytes.
    // Serial.print(...
    Read more »

  • RC1 (release candidate 1)

    Arduino Enigma10/03/2019 at 05:34 0 comments

    Feature complete and code complete.  No apparent glitches. Testing time...



  • Lots of Progress

    Arduino Enigma09/24/2019 at 04:16 2 comments

    The universal enigma engine seems to be working correctly

    Here are a couple of posts with the current project status:




  • The State of Both Machines

    Arduino Enigma07/28/2019 at 17:07 0 comments

    Current pictures of the machines:

    This is how I ended up doing the Transient Voltage Suppression (TVS) Diodes since the legs were a little wider than the holes on the board.

    And a little bit of Yak shaving. This is a programmable tester to make sure the LED display modules are not defective, custom made for this project.

  • Shopping List

    Arduino Enigma06/16/2019 at 05:51 0 comments


    Mini Meduino Mega 2560 R3 Board Pro Mini ATMEGA16U2 with Male header for Arduino


    0.8" 0.8in 16 Segments display 27.7x20mm 0.8 inch


    10 3.5mm Female Stereo Audio Jack Connector panel mount

    10 6" 3.5mm Synth Patch CABLE black


    -connect ground (left pin) on plugboard to ground (left pin)  on main board with a 1K resistor in case a patch cable touches the jack and the ground pin of a TVS, the pin is not shorted to ground. 


    arduino nano v3 


    0.56" 7 Segment LED Display Common cathode 


    Common Components:

    5mm straw hat led

    6x6x5 pushbutton blue / black / 1 red

    2 Position SPDT 1P2T 3 Pin PCB Panel Vertical Slide Switch

    m2 standoff

    10pcs 3 Pin PCB Mount 5.5x2.1mm Female DC Power Jack Socket Connector V6Z5

    copper 5.5mm x 2.1mm DC Power Jack Socket Female Panel Mount Connector plug

    4 AAA Cells Battery Holder

  • Learned a new trick

    Arduino Enigma06/14/2019 at 06:02 0 comments

    The holes for the  TVS (Transient Voltage Suppression) diodes on the plugboard are a little too tight.

    There are two ways to fix this.

    1) find a new component with the correct hole size, replace and reroute the traces to each TVS.

    2) increase the drill size in the gerber files.

    Let's choose option 2.

    Export the Gerbers and find the file ending in _drill.txt

    The first lines define the tools to use and their type.

    line 6 specifies tool T100, a circle of diameter 0.236221 inches. That's a big drill, probably the plugs. Why do we have T100 and T103? They differ by an insignificant amount. The manufacturer will probably use the same drill for these.

    Of interest are drills T101 and T102. T1 is not through plated, so those must be the mounting holes on the corners.

    Further down the file, looking at the holes drilled with T102, notice that the Y coordinates at the end do not change, so this must be the header at the top.

    T101 must be the TVS diode legs then... Let's change Tool 101 to a bigger number, let's say 0.045"

    Here is a rendering of the original plugboard:

    Here is the new plugboard. The size of the copper ring around the plug has been reduced from 2mm to 1.5 in fritzing. But look at the size of the holes on the TVS diodes.

    This is an early experiment. Next, let's measure the actual diode legs and select the final drill size.

    This is the second time ever we have had to go into the Gerber files to manually change something. The first one was to correct some lines that were appearing on the production silkscreen on Sinclair boards. The fix was to increase the diameter of the tool used to paint the silkscreen layer. 

    The lines at the top of the C letter, log and X were rendered in the production PCB.

    The fix was to go in the silkscreen file and slightly increase the tool size so adjacent passes overlap and the line is gone...

    Post under #GerberHacks

  • Arduinos and Keyboards Soldered.

    Arduino Enigma06/07/2019 at 11:03 0 comments

    The Arduinos and keyboards have been soldered. The Arduino Mega and the 16 Segment Displays have been installed on a socket. The Z30 is all soldered except for the displays, this board will be used to test the displays on-hand and then a set will be soldered.

    One decimal point is upside down, its ok, its not soldered...