• Hardware design decisions

    Mastro Gippo08/01/2019 at 10:35 0 comments

    This post is part of a series about this badge

    What goes into the design of a board like this? There's a lot of choices to make when designing a circuit board, and I'll try to tell you the story of how I went from the idea to the final design.

    Design considerations

    I thought a lot about how to interface the ESP32 to all the Nokia hardware. I2C IO expanders are a solution, but I would also have to add a USB-serial converter. Where's the fun in that? An STM32 costs about the same and can do a lot more. So I went with it. The programming serial port of the ESP32 is also sending and receiving peripheral data from the STM32. The STM32 holds the reset line to the ESP32 when it's powered off. To boot the ESP32 in bootloader mode, you just have to power the phone on while pressing the "*" key. This solution is still not optimal, as I loaded the STM32duino bootloader on the STM32 so resetting via DTR-RTS only affects the STM32. This way you have to manually put the ESP32 in boot mode and remove the reset process from esp-load.py  as that would reset the STM32 only. But at least it works! :)
    Of course, after testing all the hardware, the first thing to implement was the RTTTL library to play the Nokia Grande Valse Ringtone! I later added a cap and a resistor to filter the input to the mosfet driving the buzzer as the library leaves the pin high and this burns the buzzer.

    [embed][/embed]

    The PCB form factor

    Since this board goes inside an existing enclosure (of which I didn't have any specification or CAD drawing), the form factor is pretty constrained. Luckily, for this project, I stood on the shoulders of... well, me. The design still had to be completed and wasn't tested with a factory-made PCB, so after a bunch of measurements and tests with printed paper I decided that it was time to bite the bullet and invest the ~100$ needed to manufacture the first batch of prototypes. JLCPCB proved reliable, fast and cheap as usual. Interestingly, they seem to post-process your designs: I used an ESP32-PICO footprint I found online and the solder paste mask was as big as the bottom pad of the chip. This would have been a problem as too much solder there would make the QFN "float" on the blob and the other pins wouldn't reflow correctly; I didn't notice this until the PCB assembly partner checked the design, but JLCPCB automatically corrected the problem for me (left chip):

    Left: original footprint found online. Right: corrected one.

    There is also a modification that I had to make to the case. I wanted to fit a big antenna on top of the phone, so I had to remove a plastic alignment pin because the hole to fit it would interfere with the antenna design. I'm really not proud of it, as I would have really preferred to keep it stock, but it's a tiny modification that doesn't interfere with the original board so I went with it.

    Connectors

    I was a bit worried that the PCB was too recessed into the plastic case to have a working USB connector, but luckily the micro USB connectors I'm using leave part of the plug exposed so a standard cable works well. There's also a 9 pin JST connector for programming and expansion. Its pitch is very thin and almost impossible to crimp by hand though, and we couldn't have cables made in time. Sorry - if you want to try to build your own cable, parts will be available at the camp.

    Buttons

    Gold plated buttons seem to work quite well, despite being super-bouncy. The great thing about a mass produced phone is that to save costs they "built" the buttons in the design, so I just had to design a few pads to make use of the 4x4 keypad.

    The power switch is a different, interesting story. I had to use the same exact switch to make sure that it worked well, so I started browsing Aliexpress to find a close match, looking for SMD edge buttons. Luckily enough it seems that these buttons are still in production, and they are made by Panasonic as EVQPUA02K. They're available from Mouser too!...

    Read more »