Skip to content

Quiz Buttons - The Sequel

I wanted to make a simple quiz button array, where 4 buttons are connected to a central hub, and when you press one button, it lights up and disables all other buttons from being pressed. The 4 buttons (and lights) are stored in an external assembly, that are connected to the main hub by TRRS audio cables. The audio cables are used just as a 4 pin data cables, nothing else about them is relevant.

This story continues from the work from previous weeks.

Design

I first drew the design with iPad notes. The desired components for the board were:

  • Arduino Micro
  • ULN2003 transistor to control the 12V power supply to the lamps
  • Connectors for power supply
  • Connectors for TRRS audio cables

I first thought about using through holes for the power supply and audio cables, but then I was told that screw terminals would be better, as they allow me to remove the connections if I want to.

I used through hole connectors and screw terminals, as those worked best with the components that I already had available for me. ULN2003A uses through hole connectors, as does Arduino Micro. My button-and-lamp assemblies used abiko-connectors, and I had designed and tested a lot with them. The TRRS connectors had just plain outcropped metallic prongs that I needed to solder wires to. I wanted the connectors to the outside of the box, so they could not be attached directly the the board, so I attached to wires, which were attached to the screw terminals.

Because Arduino Micro is not part of the KiCad default component list, I had to download them from SnapMagic. I added them using Preferences -> Footprint Libraries and Preferences -> Symbol Libraries buttons.

Symbols

Footprints

I also changed the Nickname for the libraries from A000053 to ArduinoMicro, which came to bite me in the butt later, as the default linking between the symbol and the footprint use the default name. So I had to specify it by hand using the Footprint assignment tool in Schematic Editor. I also had some other problems with the footprints not appearing in the PCB Editor at all, even after pressing the Update PCB with changes made to the schematic button. I fixed that by removing the project and starting a new one.

For the ULN2003 I used the footprint for DIP-16_W-7.62mm, as that matched the apparatus that I had. I selected the footprint when adding the symbol (with Add Symbol button), by utilizing the drop down menu at the bottom right corner. Some symbols might not have predesignated footprint, or there might be something wrong with the setup (like I had with A000053 ArduinoMicro libraries), which means that the footprint is not selectable in here, and needs to be assigned with Footprint assignment tool.

The buttons that I used in Schematic editor to draw the schematics.

I added all the components. Joined the pins.

Changed the external holes to screw terminals, for easier removal of connections.

Drew all the tracks.

Had to redraw everything as I needed to flip the arduino and ULN to the bottom of the board. I selected all the parts that I wanted on the other side of the board and pressed F to flip them. For some reason flip along y-axis button did not work. Then I dragged all the pieces to the other side of the board and redrew the tracks.

The tracks were 0.2 mm thick, and I was encouraged to make them 0.5mm thick. To do that, I hid all the other components except the tracks from the Appearance window under the objects tab, and then selected all.

Pressed E to edit the track properties and set the track width to 0.5mm.

Milling

Exported the files from KiCad and milled the board. To export the files, I clicked File -> Fabrication Outputs -> Gerber files in PCB Editor, where I selected to Include layers F.cu (the front cuts) and Edge cuts (to cut the board out of the design.) Then I milled them with the same procedure I used during Electronics Production week

After milling I filed the contour tabs and cleaned the board with steel wool and alcohol.

Print solder guard layer, with UV-printing machine. For that I needed a file that had everything else marked as black except for the solderable connections. To do that, I exported two files as .svg: one file had the edge cut, the other had the edge cut and the f.mask. Opened the f.mask file in inkscape and flipped the color layers around so that the previously white areas were black and black areas were white. I did it by hand, selecting all elements and changing their fill color to white, and then selecting the background rectangle and changing its fill color to black. I could have just used Extensions->Color->Negative to do the same thing, if I would have been smarter.

In inkscape, as both layers had the edge cut included in it, I could autocrop it with resize to selection, so that both files were the same size and relative position between each other.

The I went to the machine, put A4 paper in the printer, and printed the file with just the edge cut in it. I could use this print as a template to place by board to exactly the correct position and orientation on the bed. After I placed the board correctly (without any tape) where the lines were, I printed the inverted f.mask file with the device.

I had a board with nice solder guard, and it also looked rad.

As the final step of the component process, I soldered the components in place. The Arduino micro was not soldered directly, but instead I used through hole jumper connectors, so that the Arduino could be easily removed from the board if necessary.

The soldering process damaged the painted solder guard a bit, and it ripped apart from the corner. It might have been caused by the heat of the solder, or by improper cleaning before printing, but either way, it came loose.

Assembly

alt text

I screwed every TRRS connector wire to the piece.

  • alt text
  • alt text

Hot glued all opposite TRRS connectors to the buttons.

Then I tested the contraption and noticed that nothing works. So, I started looking around for a problem. After consulting with other people and looking through the ULN2003 data sheet one more time, I noticed that I had inserted the transistor wrong way around. I had tested it before, and figured out how it works, but I had accidentally drawn it the wrong way around in my original draft. And copied that mistake throughout the whole process.

alt text

So I needed to remove the piece with force.

Retest to make sure that what I was doing was correct. The testing revealed that every other pin was mirrored in my board, except for the ground pin which was correct.

  • alt text
  • alt text

So to fix the problem, I had to solder the transistor to the other side of the board. And clip one of the legs of the ULN2003 so that it wont ground the common diode pin.

After that I soldered a jumper cable from the proper ground pin to the intended screw terminal. I used tape during the soldering to keep the jumper cable in place.

The inverted transistor soldered in place.

And now a light turned on, but only for as long as I pressed the button. The code should keep the light on for 5 seconds, so something was wrong. After testing with all the other buttons, which functioned properly, I deemed that the problem was within the yellow button. In there, I had accidentally swapped the wires for light-in and button-out. I’m still not sure why that caused the issue, but the after swapping them, the problem went away.

Then the buttons worked.

Then I made a box for the board and hot glued the TRRS connector to it as well.

Next Steps

There are a couple of steps that need to be done before this thing could be described as first version:

Replace lamps with LEDs. This would remove the need of a separate power source, and all could be powered through the Arduino. I already tested that “super bright” leds are bright enough to be visible from underneath the buttons.

Change the communication code so that the keyboard buttons send to the computer change based on whether or not the button press was blocked or not. This would mean that all presses would send a signal, but the signal would depend on the proper state of the device. This change would probable require some form of debounce protection for the buttons.

Redesigning the PCB

Files for the new PCB

Files for LED adapter

The previous PCB had multiple problems, including horrible soldering, so I decided to make a new one. In the new PCB, I could solve some of the issues mentioned in the Next Steps. I swapped the light bulbs with LEDs, which meant that I could remove the external battery pack. Now I could power them with the 5V VCC pin in Arduino Micro, but it also means that I needed to add a 100Ω resistor to the PCB just before the ground for the LEDs.

There were some problems with the previous symbol files with the Arduino Micro, where the 5V VCC pin was not marked to any of the pads in the footprint. So I swapped the Arduino library for kicad-lib-arduino.

I also moved away from screw terminals by swapping my TRRS female sockets to a components (PJ320E) that could be mounted on a PCB.

The new PCB came out looking good, and did not need any additional wires that jump between pads. It has some splodges of solder outside of the pads, but none of them short any of the pins. I also did not solder all the pins, only adding solder to the pins that are in use and a couple more to keep the components in place.

To make the LEDs fit into the slots meant for small light bulbs, I designed and 3D printed a small adapter piece that I can wrap the legs of the LEDs around, and a small pipe-shaped shell that will keep the LED in place.

The LED fits into the slot for the light bulb perfectly.

The light from the ultra bright LED is not as bright as the 12V light bulb, but it is still clearly visible.

FAQ

People have constantly asked me, how do I take the signal bounciness into account, when the buttons are pressed. And my answer has always been the same: it is not an issue for my code. It is basically handled in code, even though even the code does not have any lines of code dedicated for debouncing. My code just reads the first incoming signal, and after that stops caring about button signals for 5 seconds, which is ample time for the bounces to disappear.