-
Log #2: Improvements after field tests
05/12/2023 at 21:33 • 0 commentsAfter some field tests, I have made some changes.
1. The Post-It Whiteboard & System Capacitance
I discovered that the Post-It Whiteboard cover over the copper pads (i.e., over the Touch Electrodes) had a couple of disadvantages:
- Its thickness allows for less than desired capacitance from the touch electrodes, requiring a very high value in charge and time to the capacitive sensors which in turn generates more capacitance noise.
- The idea of just erasing a keyboard layout and drawing a new one sounded (and still does) very good: lots of flexibility depending on each user’s need. The problem is that a touch keyboard means touching erasable ink, which means letters survive very little before requiring redrawing.
Because of these two effects, I decided to, for now at least, go for a single (i.e., fixed) keyboard layout printed in self-adhesive vinyl (which has less thickness and thus allows for better capacitance performance).
It is self-evident that a 2D matrix of copper pads is unnecessary if there is a fixed number of symbols of the touch keyboard (i.e., I could use instead a large copper square per letter instead of a matrix of copper pads). But for now, I´ll continue using the existing matrix until I come up with a way to allow for multiple layouts.
The fixed layout I chose was Large ABC, so the Function Switches also changed: the Phrase ON/OFF Text-to-Speech switch is no longer applicable. Instead, I’m using that switch to turn ON/OFF the Easter Egg songs (see below).
2. Ground Bounce
Because of the ground bounce effect on the Function Switches (mentioned in the previous log entry), using interrupts meant having to trap false positives in code. So, in this iteration, I’m using digital reads instead. The main program loops fast enough to make it unnoticeable.
3. Non-blocking Code in Tunes Playback & Easter Eggs
Playing of short tunes for startup and layout configuration is a direct use of Robson Couto's program, which uses a delay() statement to play each note. This forced me to play only short excerpts of the songs. I also wanted to add Easter Eggs: when the user types the keyword of one of the songs, playback begins. The songs are (keyword in parenthesis):
- Super Mario (mario)
- Darth Vader (galaxia)
- Pink Panther (pantera)
- Happy Birthday (cumple)
- Ode to Joy (alegria)
- The Lion Sleeps Tonight (leon)
- Brahms Lullaby (dormir)
For these two reasons I changed Robson Couto's code to be non-blocking (identifying during the whole program when a note is being played as well as if a tune is in progress).
Now at startup a random short song is played (Super Mario, Darth Vader or Pink Panther) and 7 songs are ready to be played if discovered! Playback can be halted by typing "zz" at any time.
4. Persistent Capacitive Noise
Even with the new self-adhesive vinyl cover and the new config values for the capacitive sensors, there is still noise that can generate false touch positives.
I added a routine to trap this noise (or most of it). There are (rare) cases when these false positive capacitive sensor touch registers enter some kind of loop, in which case after trapping this condition based in a determined number of iterations, I now reset the three cap sensors breakouts.
The origin of this noise remains a mystery to me. Ground bounce? EMI? Voodoo?
5. Bluetooth Reconnect in iOS
iOS has some limitations, perhaps by design, when it comes to Bluetooth reconnect: if the user turns off the BLE radio in the letterboard (by turning off all Function Switches) after it had been connected (paired) to iOS, it won’t reconnect again when turned on.
To fix this, I added an ESP.restart() statement when this happens to force a reconnect, identifying the reason for reboot to avoid regular startup songs and other regular startup functions.
6. Cap Sensors Calibration
I changed the cap sensors configuration values after several calibration exercises with the vinyl cover, getting better response (true positives) and less noise (false positives).
7. Code Optimizations
Several routines saw improvements in readability and performance. As before, the code is generously commented.
All files are included in the files section in the RPM GEN3 ABC.zip file to differentiate them from the original posting. All file names and structure remain the same.
8: New Enclosure
Last but not least: my own 3D printer finally arrived! I couldn't miss the opportunity to make a new enclosure:
-
Log #1: Initial results after first release
05/08/2023 at 23:53 • 0 commentsThis is the third iteration at building a usable tool for RPM communication. They have evolved in functionality and complexity:
And as in every version, there have been lessons to be learned:
- The SPDT switches are affected by ground bounce. When using interrupts, the Interrupt Service Routine (ISR) is triggered continuously when more than 2 pins are LOW. The issue is currently managed in code and could be further mitigated (albeit not eliminated) by not using interrupts. Must read more on decoupling and possibly test using Wokwi.
- The PCB can benefit from using 3 distinct types of ground (for analog, digital, and power circuits) with their respective cap separators.
- The MCU's antenna is placed over the ground plane which can badly detune the antenna and impair the WiFi / Bluetooth performance. Beginner's luck: I placed the MCU over headers, creating a 2mm air gap that mitigated (but not eliminated) the issue.
- Increase Copper Weight of Outer Layers to possibly increase capacitance of the touch pads (albeit nearly double the cost if 2oz copper weight), Look at Trace Resistance Calculator from AllAboutCircuits,
- Use a connector instead of soldering the battery cables directly to holes in the PCB: with a little manipulation, it breaks off.
- The smallest SMT were the caps @ 0805. Consider using bigger components since we don't really have am issue with available real-estate on the PCB.
- ESP32 Usable Flash Memory: the ESP32 development boards from non-Espressif manufacturers usually can't use the full on-board memory because their partition schemes on Espressif's Arduino ESP32 core are limited. A quick (manual) fix is to put a partition.cvs in the sketch: it will be picked up instead of the one in the menu. Adafruit has "...a PR to Espressif to fix the partition scheme for 8MB. It may take a while for them to review and merge...".