Kevin
Accomplishments
- This week I finished the PCB design for revision 0. I completed the routing for power, trying to use wide traces and keep them short to reduce noise. These design features were suggested in datasheets for parts we will be using as well as many online tutorials. I routed the data lines and bus lines for our two microphones. I added a few resistors and capacitors on the I2S bus to improve signal reliability. I did my best to avoid sharp turns with the analog signal from the Vesper mic to avoid filtering the data in ways that are undesirable.
- I also fixed some small issues with part footprints in Eagle. I double checked the footprints for other parts as well, especially the charging circuit ICs since they are small QFN packages. Lastly, I standardized all of the capacitors and resistors, of the type, to have the same package and library in Eagle.
- By the end of the week, the PCB was ordered. We ordered 5 for 1$ each, plus shipping, approximately $17. In the best case scenario, we may be able to get them before the end of next week. If not they should arrive during the following week.
- I also helped out Ronit and James with collecting audio signals from the ESP32. We were able to collect recognizable voice clips, but are not able to set the correct sampling frequency.
Upcoming Work
- Once the PCB arrives, we can begin testing. We will test the board itself first, making sure the traces are connected properly. After this is complete we can begin assembly. If the boards arrive next week, I should be able to test them before the end of the week.
- We also need to order the parts for the PCB. We currently have the LM1117 and the ESP32, but are lacking the power management circuits and microphones. I will be purchasing those early next week.
- The largest risk with the PCB is that they do not work once assembled. I expect debugging to be challenging. Finding the issues as quickly as possible will be critical so we can get another revision of boards ordered. If problems do arise, we will look for help in debugging, likely from the post-doc we spoke with last week.
- Considering it is very likely we will not have the PCBs back next week, I will also be working on signal processing. Keystroke detection has already begun, but by the end of this week I am aiming to have the system automated.
Ronit
Accomplishments
- Getting I2S working on the ESP32 was particularly challenging. Even though the mems microphone is a 24bit device, the clock has to be driven for 32 clock ticks.
- The I2S bus also expects two I2S devices, so instead I set it up to double sample the one device.
- Set up the I2S device to use DMA to increase sample throughput.
- Set up port forwarding within the cmu network to connect the ESP32 to the laptop over CMU’s wireless network.
- Transferred the I2S data from the MEMS microphone to the laptop over TCP
- Although we were getting data on the laptop, it was extremely noisy, to overcome this we first lowered the sample rate until we could debug the sounds more easily. By listening carefully to the sound, I realised that the sounds were being scrambled. I.e- the samples were not playing in the correct order. I was querying only single values from the DMA buffers instead of the whole buffer and under the covers the ESP32 was swapping the buffers and the sounds were playing out of order. I set it to read the entire buffer and increased the number of DMA buffers.
The image below is the sound of human speech that was recorded on the ESP32 and sent over wifi being plotted on Matlab.
Changes to schedule description
- Right now we are able to play back sound on the laptop that has been sampled on the i2s device. However, we are not able to increase the sampling rate to the desired 44.1KHz. At a mere 10kHz, we will not be able to pick up any desired features. This is a problem we did not anticipate would happen and do not have time budgeted in the schedule and as such must move things around. Since we are ahead on the PCB, Kevin will be helping me with the i2s sampling as he has some slack.
Upcoming work
- Not being able to sample at the desired frequency is currently the biggest problem we have. The strange thing is that, the device clock is set to the right rate, and we are able to observe this on the oscilloscope, but for some reason, the device simply does not give us the values we need. I anticipate that this will take no more than 4 days to fix. After which, most of the embedded software stack will be complete and I will move to signal processing.
- Per Professor Mai’s advice, we will be using multiple microphones, this required a slight modification in the network code, but was easily manageable.
James
Accomplishments
- Began work on the TDoA algorithm for multiple microphones. Because we plan on having 2 microphones per board, one high quality and one low power for waking the processor up, we can apply TDoA to a single board as well as to multiple devices. I was able to achieve accuracy on the order of centimeters by using recorded samples of gunshots. The output time difference will simply be used as an additional variable toward the feature-to-cluster algorithm.
- Attempted to build TensorFlow from source in order to enable AVX instructions. Unfortunately, I was not able to get TensorFlow with AVX up and running. I will continue to work on installing the missing dependencies in the following weeks. In the meantime, I will continue to refine the machine learning algorithms using the pre-built PIP TensorFlow package. Although this will result in slower training, we can still proceed with the rest of the project unhindered.
- Helped Ronit get recorded sound transmitted over wifi from the ESP32. This past week, we were struggling to get recorded data transmitted correctly from the ESP32. Because the rest of the signal processing depends on this data, I helped Ronit get back on schedule. We ultimately fixed the issues regarding the clock and data protocols between the ESP32 and I2S microphone, and reading from buffers in the wrong order. We will still need to debug the sampling rate of the microphone, as we are finding that it seems to be stuck at around 8kHz, despite a correct frequency on the I2S clock line.
Upcoming work
- Currently, we are still working on collecting good data from the ESP32 module with the I2S microphone. Once this is complete, Kevin and I can make further headway into extracting features from recorded keystrokes (FFT, cepstral, and TDoA).
- Again, I plan to continue working on getting TensorFlow built from source in the upcoming weeks.
- Next week, I will work with Kevin to refine the keystroke separation algorithm.
- Currently, one of the biggest challenges and risks we face is the fact that we are still unable to obtain good data from the ESP32 over wifi. As a contingency plan, we will move forward with cell-phone data if necessary, until we explore more microphone and data transmission options.
Changes to schedule description
- I am currently a little behind schedule in terms of getting building TensorFlow from source. Fortunately, this is not critical for the other components of the project, so I will work on this in parallel with other work in the upcoming weeks.
Team Status
Accomplishments
- The PCB design was finalized and vetted by Sam.
- We made some last minute changes like adding additional debug headers just to make the debugging process a little easier. Currently the PCB has lots of jumpers and debug gpio ports that will be removed in future iterations, but as this is our first foray into PCB design we deemed it necessary to build in as much fail safe into the PCB as possible.
- Even if the processor on the PCB does not work, we have set it up so that it can still act as a breakout board for all our components.
- A little bit of work was needed to get the network connectivity working exactly how we wanted it to. From our previous blogpost you would know that we were having some trouble sending data from the ESP32 to the laptop but that issue has been resolved.
- We are able to obtain I2S data from the microphone, however there are still some issues in that area.
- We are in the process of creating a means of using time of delay arrival as another data point. Since we already have two microphones, a low power wakeup mic and a good quality MEMs mic, we are attempting to use them to determine the delay in the sound arrival to the two mics. The are spaced 2 inches apart and therefore, the time delay in arrival between the two of them is in the order of tens of milliseconds ,which we will be able to discern once we reach our desired sampling frequency. If we find that using two mics on the same board do not give us the desired results, we will move to using two sensor packages on two PCBs. The network stack has been written so that additional devices can be trivially added.
Upcoming work
- Next week, Ronit will be working on fixing the I2S sampling frequency.
- Kevin and James will be working on separating keystrokes.
Changes to schedule description
- Not being able to sample i2s data and have real data is a setback, however, we are have reordered the schedule so that things dependent on real data have been pushed back.
High-level Project Changes
- The only update to the project at a high level is the inclusion of a second microphone. We have seen some literature (https://www.sigmobile.org/mobicom/2015/papers/p142-liuA.pdf?fbclid=IwAR2ZJi4b4LWak6W2l5iZk5fF9sDwKGeZHDAlDtUJiNDDYE62bAhzhfUjmZE) regarding using two microphones positioned at known locations relative to a keyboard to obtain millimeter-level localization accuracy using TDoA. Because our project’s aim is to create a practical device that an adversary can quickly and discreetly place, we will be able to determine and utilize the exact locations of the microphones in relation to the keyboard, as was done in the research. However, we will incorporate TDoA into our project as an extra data point in the feature-to-cluster machine learning algorithm.