I was out having dinner with some friends who are expecting to have a baby soon, and they were talking about the difficulties involved in picking a name for a baby. You have to think about how old the name is, what kinds of rhymes or mean names can be made from it, do the initials spell something… So many things to worry about, there has to be a better way!
So I set out to come up with a solution, and a gadget would clearly be the best choice. There were only a few requirements.
1. Very quick development time (the baby shower was only 2 weeks away).
2. Generate awesome names for a baby!
3. Require only parts that I had on hand.
4. Very low cost since it is realistically going to end up in a drawer.
I prototyped the system with an Arduino. I ran into two snags developing the software. It’s actually difficult to come up with a bunch of awesome names, and the amount of SRAM in an Arduino is actually quite limited. I looked to the census to overcome the first problem and downloaded a list of names. The list was enormous! A quick NodeJS script reduced it down to a random 8% (or so) sample.
The SRAM space turned out to be a bit more difficult to identify. the first attempt was to just stuff hundreds of names into a huge array. This compiled and uploaded without a problem, but resulted in strange runtime behavior. Sometimes, the device would just stop working and require a restart to begin working again. Other times, it would continue working, but the screen would only output garbage characters. Once I realized that the variable space was too small to hold the variables, I found the PROGMEM modifier. It stored variables in program space (which was more than sufficient for this application).
The names are split into two arrays. The first array is awesome names (including first and middle name together). The other array contains the names from the census. The first four names come from the awesome array, then it switches to the census names with a 25% chance of using part of an awesome name.
Once I was fairly happy with the program, I moved on to the circuit design. I certainly couldn’t give away a full Arduino for a little gag gift that would end up in a drawer somewhere! I prototyped (most of) the design on a breadboard and then designed the schematic in Eagle. It always takes a very long time to lay out traces, but I eventually got the board layout complete and was ready to etch the board. I created the board using the toner transfer method and etched it at hackRVA Makerspace. All in all, it turned out pretty well, with only small problems.
I did go back and update the program to improve the random seed generation because I found that I kept seeing the same few sequences of names. I also messed up by setting the adjust on the LED brightness resistor, instead of the contrast. The full code, schematics, and board layout are available on GitHub at https://github.com/Ranthalion/BabyNamer.