y-x-c / wearable-microphone-jamming

Repository for our paper Wearable Microphone Jamming
http://sandlab.cs.uchicago.edu/jammer/
MIT License
842 stars 114 forks source link

Materials and wiring all it up #6

Open digilander98 opened 4 years ago

digilander98 commented 4 years ago

Hi, is possible to have needed materials list and wiring schematics?

Thank you so much!

T-vK commented 4 years ago

I've spent a lot of time on trying to figure out the exact hardware that was used and here is what i got so far:

I think there's also a charging circuit and a charging port that hasn't been mentioned. At least it looks like there is something like a micro USB port in the video. The charging circuit could be something like this. But I'd probably ditch the step up converter for a 2 in 1 board like this that does both charging and stepping up to 5V. To save even more space you could desolder the USB A port. Then I would try to replace the Amplifier board with something cheaper like this and maybe the signal generator could also be replaced by something cheaper like this. Finally I would consider swapping the very pricey Adafruit Trinket for an Arduino Micro clone. Well, maybe one more thing: You might be able to use a nicer looking button with a 5V LED integrated instead of the aforementioned LED+resistor+button combo.

It would be great to have input from @y-x-c on all this because if we don't get the exact same components, they may not fit into the 3D printed enclosure. Thanks a lot for this awesome work btw!

digilander98 commented 4 years ago

Thank you sir

pracdaske commented 4 years ago

@T-vK thanks a lot, I managed to get some modules that you listed as alternatives.

If you can could you provide some wiring schematics insights please

T-vK commented 4 years ago

Once my parts arrive, I'll figure out how to wire them up and post my results here. But looking at the current situation in China, it may take more than a month until I receive my orders...

digilander98 commented 4 years ago

Why don t use an arduino nano clone?

digilander98 commented 4 years ago

And what about this: https://a.aliexpress.com/_BOV2vj

SCWhite commented 4 years ago

@T-vK HI, I have a little question about

I've spent a lot of time on trying to figure out the exact hardware that was used and here is what i got so far:

* 23x [NU25C16T-1 aka TCT40-16T](https://www.aliexpress.com/item/32258563531.html)

TCT40-16T have center frequency at 40kHz (on data sheet) NU25C16T have center frequency at 25kHz

I doubt this two can be replace from each other (?)

I'm not a electronics expert, but I make some test on 40kHz transducer from a ultrasonic sensor and it works fine to jam the microphone (with limit range about 10cm)

may be 40kHz doesn't have the same effect with 25kHz or may need to change the code from the project.

T-vK commented 4 years ago

@digilander98 I think the Arduino Micro clone is closer to the Trinket and I prefer micro USB over mini USB. Besides that, according to the paper the code was written for the ATMEGA32U, so it may not work on the nano. What do you mean by "what about this"? It's the same board I linked to in my post, just a few cents cheaper.

@SCWhite I'm assuming they are the same because of offers like this: https://www.ebay.com/itm/272708217220

But I could be wrong, that's why I was asking @y-x-c for input.

At what volume did you get a 10cm range btw? I think in the paper it was mentioned that it was running at almost 100 decibels.

digilander98 commented 4 years ago

For the arduino i think that the code is small and get right ports if different from the trinket will not be a huge problem. Differences from one arduino version to another are in size, clock mhz, memory space and ports capabilities. It seem to me that the nano can also do the job, i was wondering if you agree with that. For the board, in view i do not know more about that kind of chip but it seems little and without antenna plug, my question was intended to ask if it can be the same as per specs or not....Hope you can answer to my questions Thank you so much for your efforts

T-vK commented 4 years ago

Well, I just tried to compile and upload the code for the Arduino Nano and that sure worked fine. But I can't say if it works before I get my parts. Now that I see the Nano next to the Micro, the Nano might not fit into the wristband though. It's like twice as thick due to the PCB being double sided and due to the mini USB port being bigger and in addition to that, the board is like 1cm longer. The specs of the cheaper signal generator seem very similar and the SMT connector is not necessary.

digilander98 commented 4 years ago

Waiting for parts me too

pracdaske commented 4 years ago

Some colleagues and me managed to get the circuit going and disrupt the microphone of my phone while recording. We tested it with one transducer and I think we burned it because we put 5V across the circuit. The wiring went something like this, nothing was welded just wired: USB to Arduino Pro Micro, Arduino to cheap signal generator (both power and instructions), cheap signal generator to amplifier (L input and goes to L+ output), amplifier to transducer HC-SR04 (We used a transducer that had transmitter and receiver, so we used the Trigger input only ). The amplifier and transducer were powered by a regulated outlet adapter through the 3.7 to 5V regulator. From this last pieces one was burn out and the other one runs hot, we will try to power everything through the Arduino.

This was in today's morning. Sadly we couldn't replicate it again 2 hours ago, we will weld pins to the holes of the modules and see if the problems was a the poor wiring connections.

Any insights on this would be appreciated. As you could tell we're a complete noobs at electronics so, yeah.

T-vK commented 4 years ago

If I had to guess, I'd probably try something like this. But I'd check the outputs of the signal generator and the amplifier with an oscilloscope and multimeter first. mic-jammer1

T-vK commented 4 years ago

@pracdaske Just so you know, the HC-SR04 already has a signal generator and amplifier built in and the pinout doesn't give you access to its TCT40-16T or TCT40-16R. By specification you set the trigger pin high for 10 microseconds, then you set it low and then it sends eight short 40khz bursts in a row, which are then picked up by the TCT40-16R and converted into a high signal on the echo pin. If you attach a 40khz signal generator amplified to 5v to the trigger, you're very close to the theoretical maximum where you almost don't trigger it anymore because the trigger pin needs to be high for at least 10μs. My guess is the HC-SR04 is not designed to deal with such a crazy high amount of trigger pulses and it just overheated. Also be aware that the module doesn't ever generate a continuous 40khz soundwave no matter what you do to the trigger pin. It will always only send 8 short bursts. That might be enough to interfere with a microphone, but it's not ideal. Also, be aware that you probably shouldn't "power everything through the Arduino" because it can only provide very little current (e.g. 20mA on a digital pin and maybe 100mA or so on vcc+gnd). Drawing too much current will probably cause unexpected behavior, cause overheating, shutdowns or maybe even fry it.

digilander98 commented 4 years ago

Ok, think everyone will try to power from battery/usb recharge circuit the components at this point, once materials arrive.... Thank you so much guys!

pracdaske commented 4 years ago

@T-vK I managed to get it work consistenly plugging in the Amplifier's output pin to the trigger pin of the HC-SR04 board. The phone's mic catches the ultrasound but the range is really poor. I tried desoldering the transducers from the boards and make a paralel setup with the output of the Amplifier (like in the picture you shared) but nothing comes out.

Then I tried this:

image

I desolder the TCT40-16 R and T and welded them to the T terminals on the board, first in serial (like ne the picture) but only the first one worked at poor range and then in parallel in which 3 out of 5 worked, again at poor range.

Edit: Also I stopped powering everything through the Arduino, I'm using a 3.7V Li-Ion Battery

Edit2: Parallel transducers are something like this: image

SCWhite commented 4 years ago

@pracdaske HI, my package arrive last week, and I manage to make it work.

IMG_20200316_104336

I don't think you need the HC-SR04 board, just use AD9833 & 8403A, with 8 parallel TCT25-16 T, it can affect microphone to 2m.

will test 40kHz for performance next.

pracdaske commented 4 years ago

@SCWhite Sadly only TCT40 are available in my country and only as Hc-sr04. I tried this way too: IMG_20200316_125334 But nothing comes out the transmiter. My guess is it only work in 25Khz rated transmitters.

T-vK commented 4 years ago

Well, the Code might need adjustments to use frequencies closer to 40khz because at 25khz it probably resonates pretty poorly, meaning it is very quiet. More amplicifation might also work, but it's hard to say as there are no proper datasheets on the TCT40-16T that show a max voltage rating or anything useful like that.

// Mic jammer code adjusted for 40khz

#include "AD9833.h"

#define FNC_PIN A0
#define SEL_PIN A1

int gen_freq = 40000;

int RXLED = 17;  // The RX LED has a defined Arduino pin

//--------------- Create an AD9833 object ----------------
// Note, SCK and MOSI must be connected to CLK and DAT pins on the AD9833 for SPI
AD9833 gen(FNC_PIN);       // Defaults to 25MHz internal reference frequency

void setup() {
  //start gen
  gen.Begin();
  pinMode(SEL_PIN, OUTPUT);
  //set gen to SINE
  gen.ApplySignal(SINE_WAVE, REG0, gen_freq);
  //start gens
  gen.EnableOutput(true);
  //put both PGAs at max output
  MCP41010Write(255, SEL_PIN);
  SPI.setDataMode(SPI_MODE2);
}

void loop() {
  gen.ApplySignal(SINE_WAVE, REG0, random(39000, 41000));
  MCP41010Write(255, SEL_PIN);
}

//  function below adapted from http://henrysbench.capnfatz.com/henrys-bench/arduino-output-devices/mcp41010-digital-potentiometer-arduino-user-manual/
//  8bit value to write --> 256 levels --> value 0 to 255
void MCP41010Write(byte value, int CS)
{
  SPI.setDataMode(SPI_MODE0);
  // Note that the integer vale passed to this subroutine
  // is cast to a byte
  digitalWrite(CS, LOW);
  SPI.transfer(B00010001); // This tells the chip to set the pot
  SPI.transfer(value);     // This tells it the pot position
  digitalWrite(CS, HIGH);
}
pracdaske commented 4 years ago

Tried with the frequency at 40000, didn't work without board and I could hear like taps in the recordings I made. @SCWhite I notice you don't plug A1 to anything along with other stuff from the Arduino to the signal generator. Could you tell me how you made the connections, I would really appreciate that. What I did with this AD9833 variant (that doesn't have analogic ground) was: DAT --> pin 16 (MOSI in Pro Micro) CLK --> pin 15 (SCK " ") FNC --> pin A0 REF --> pin A1 OUT --> R INPUT on Amplifier

T-vK commented 4 years ago

It would be very interesting in general, which frequency would perform best for mic jamming. I think I'm gonna order a bunch of different transmitters that can cover more than just one frequency. Maybe something like this: 2.5khz-60khz and 55hz-30khz. These probably won't fit on a wrist, but for a stationary jammer or a pocket jammer this could be useful.

I also found this offer for 25khz transmitters. In case the TCT40-16T ones really don't cut it.

T-vK commented 4 years ago

Just got some of the parts I ordered a few weeks ago. I only have a single TCT40-16T at the moment. It works using the 40khz code provided above, but the range is very poor. Not even 1 meter. IMG_20200318_213910

Using an Arduino Pro Micro.

SCWhite commented 4 years ago

Tried with the frequency at 40000, didn't work without board and I could hear like taps in the recordings I made. @SCWhite I notice you don't plug A1 to anything along with other stuff from the Arduino to the signal generator. Could you tell me how you made the connections, I would really appreciate that. What I did with this AD9833 variant (that doesn't have analogic ground) was: DAT --> pin 16 (MOSI in Pro Micro) CLK --> pin 15 (SCK " ") FNC --> pin A0 REF --> pin A1 OUT --> R INPUT on Amplifier

HI @pracdaske , my AD9833 doesn't have a MCP41010 on it, so there is no need for CS pin to connect.

just using AD9833 & AD8051 have a good performance at 2m, I'm trying to use multiple generator to get a better(or further) performance.

For your reference, this picture should be clear enough here, my AD9833 doesn't come with MCP41010 & AD8051, so I did some modification with the code and wiring .

I think @T-vK really do a good job up there, but it think the transducer have + - on different pin the ping with black ring should be + (maybe?)

T-vK commented 4 years ago

Good news! I managed to get it to work without a signal generator. Turns out you can generate the signals using the Arduino directly! test

I'll keep my progress on that up to date in this repository.

The transducer performed equally for me, no matter how I connect + and -. Not sure if you're supposed to use it a specific way.

Edit: If you just want to play around, you can even run it at 5v directly through the Arduino without an amplifier. Range is pretty low though.

Just using an Arduino Pro Micro, a 1k resistor and an ultrasonic transducer (using the simple code from the repo linked above): IMG_20200319_205037 With a 40khz transducer I get like 15cm of effective range. But it's a nice, simple and cheap setup to just play around with.

T-vK commented 4 years ago

I can't recommend this 55hz-30khz one as it produces a lot of audible noise even when run anywhere between 20-30khz. Because of that I also wasn't successful in finding the perfect jamming frequency yet.

I have tested this cheap amplifier now though and so far it seems to work just as well as the other one.

digilander98 commented 4 years ago

Hi, can someone put schematics and code with amplifier without analogic knob and cheap signal generator without sma interface?

digilander98 commented 4 years ago

This https://www.ebay.it/itm/262072330180

digilander98 commented 4 years ago

And this https://a.aliexpress.com/_BPy33R

digilander98 commented 4 years ago

Can you put schematics? Maybe converted for micro?

Thank you so much!

T-vK commented 4 years ago

Sure, but be aware that you can't change how many decibels the output will be. It it's too high it may cause permanent hearing damage.

image

If you want to use an Arduino Pro Micro instead of the trinket, you have to use pin 16 and pin 15 instead of pin 11 and pin 13: 11 -> 16 13 -> 15

digilander98 commented 4 years ago

What do you mean by changing decibel? Max volume allowed by the amplifier i think is presetted in the module and the only thing we can change is connecting with another powerful amplifier that gies, for example, at 12v max, scaling down to 10v to accomplish tech specs of the transmitters, that are giver for 100db at 10v....am i right?

T-vK commented 4 years ago

If you can find a proper spec sheet for both the amplifier board and your transducers, then you could check what the decibel ouput should be. But I had a really hard time finding any data sheets for my transducers, let alone a proper one with graphs showing voltage/frequency/sound level correlations.

digilander98 commented 4 years ago

I have found the specs on aliexpress where i bought transducers...

Said that, how many decibels can be dangerous for hearing damage in your opinion?

digilander98 commented 4 years ago

And what is the preset volume for the amplifier without physical volume knob ?

I do not want to lift up volume, only be sure that transducer are emitting something, using the smallest component available that are the two i have linked below....anyone knows something about or we are all experimenting until blood drops out fron our hears? 😅

T-vK commented 4 years ago

In the paper it said:

The U.S. Occupa-tional Safety and Health Administration (OSHA) warns that audible subharmonics can be harmful at intense sound pressures of 105 decibels or above.

https://people.cs.uchicago.edu/~ravenben/publications/pdf/ultra-chi20.pdf

The safest way to do this would probably be to use the amplifier board with the volume know (which is just a 50k double potentiometer) and use a proper sound level meter (cheap one like this one can't handle ultra sonic) to figure out how far you have to turn the know to reach a safe sound pressure. For the sound level meter ask nicely at your local university, they tend to be really nice about this kind of stuff. Or try to make one yourself. Once you figured it out, use a multimeter to determine the resistance between the pins of the potentiometer and write it down. Then unsolder the potentiometer and connect the 1,2,3 pins with appropriate resistors. Between pin S1 and pin S2 you can just solder a wire so that it automatically turns on when it has power.

image

digilander98 commented 4 years ago

Thank you so much sir!

digilander98 commented 4 years ago

@pracdaske HI, my package arrive last week, and I manage to make it work.

IMG_20200316_104336

I don't think you need the HC-SR04 board, just use AD9833 & 8403A, with 8 parallel TCT25-16 T, it can affect microphone to 2m.

will test 40kHz for performance next.

Hi, have you tested with 40T? I have tried but range is 1cm in the best case and not covering voice.

CS not used because missing on the DSS board and also the code for digital potentiometer commented out...

So only A1 used.

Still waiting for 25T to come...

digilander98 commented 4 years ago

@pracdaske HI, my package arrive last week, and I manage to make it work.

IMG_20200316_104336

I don't think you need the HC-SR04 board, just use AD9833 & 8403A, with 8 parallel TCT25-16 T, it can affect microphone to 2m.

will test 40kHz for performance next.

So you can get 2mt with those components, all arduino powered?

digilander98 commented 4 years ago

Hi, can you post your code modifications?

Thank you

digilander98 commented 4 years ago

Can you post schematics and code that can be able to reach 2mt distance?

Just for everyone to understand how can you do it.

Thank you so much!!!

T-vK commented 4 years ago

I have a small update. I've tested a couple of different speakers/transducers. here are my results so far:

I cranked the 3W amplifier up to 100% for this test, wearing hearing protection. I'm not sure what 100% of a 3W amplifier would equate to in terms of decibels.

bitsoft-maax commented 4 years ago

@T-vK How did you cranked amplifier?

T-vK commented 4 years ago

@bagana89 By turning the volume knob.

bitsoft-maax commented 4 years ago

@T-v thank for ur respond. It seems depends on amplifier and transducers. we have tested T25(25khz) but cheap one, it reaches about 1m. but when improve amplifier output /using Yamaha mixer/ it reaches 3~5 m. now we are testing different transducers and make custom amplifier /with TIP122/ Unfortunately no luck on Iphone X. There is no effect. did u test on that

SCWhite commented 4 years ago

@bagana89 HI, can you share a little more about "Yamaha mixer" you use ? I'm using the 3W PAM8403 amplifier, have a distance about 2m (with 24 transducer) want to change to 10W pam8610 to get better performance.

T-vK commented 4 years ago

@bagana89 What do you mean by "improve amplifier output"? It sounds like you are operating the transducer beyond spec. My understanding is that the amplifier I linked in combination with the 25khz transducers produce a sound level of about 100dB. If you're using a more powerful amplifier you may get better results in terms of jamming range, but you most likely also produce a sound level that exceeds 100dB, which can cause permanent hearing-loss. If you have a good spec sheet for the amplifier and transducer you might be able to calculate your sound level. I tested against a OnePlus 5T.

digilander98 commented 4 years ago

25k transducers seems tonreach max potential of 100db of inaudible sound when at 10V. So this is the reason why pam8610 seems to be the right choice...

Still waiting to understand how is possbile to reach 2mt with previously posted modules and codes....

Please who had reached that perfomance post schematics, correct code and parts....

It is unuseful to post photos in prospective were no all connections can be clearly seen or where the referred code is for other components/modules....

T-vK commented 4 years ago

Technically I guess you could argue that I got 2m of range with the 25khz transducers, but at 2m the generated noise wasn't enough to make the recordings completely unusable. But then, I was only using one transducer. Had I used 10 or 20, I'm sure I would have gotten better results.

I also think that that some devices are more susceptible to this kind of jamming than others. So maybe you would actually get 2m against the right device.

It's better to have a bad photo than nothing at all, right?

T-vK commented 4 years ago

I just received that cheap AD9833 signal generator. Although the price has gone up by quite a bit.

I just tested it with a 25khz transducer and I'm pretty disappointed. The performance was very bad. Maybe 10cm of range. This could however very well be an issue with my code which is mostly copy pasted.

Anyway I thought I'd share this.

This is how wired everything up: new-signal-jammer

And this is my code:

/**
 * Some of this code is copy pasted from the example provided at
 * https://www.thaieasyelec.com/gy-9833-dds-signal-generator-module.html
 * by Pete Dokter, 9/2/12
 * 
 */

#define FSYNC 10
#define SDATA 16
#define SCLK 15

#define FREQUENCY_MIN 24000
#define FREQUENCY_MAX 26000

// Use this is you have 40khz transducers
//#define FREQUENCY_MIN 39000 
//#define FREQUENCY_MAX 41000

#define WAVE_TYPE "SINE" // Available SINE, TRIANGLE, SQUARE

void setup() {
  pinMode(FSYNC, OUTPUT); 
  pinMode(SDATA, OUTPUT); 
  pinMode(SCLK, OUTPUT);
  Serial.begin(9600); 
  digitalWrite(FSYNC, HIGH);
  digitalWrite(SDATA, HIGH);
  digitalWrite(SCLK, HIGH);
  while (!Serial);
  Serial.println("Ready");
}

void loop() {
  if (WAVE_TYPE == "SINE") {
    set_freq(random(FREQUENCY_MIN, FREQUENCY_MAX), 0);
  } else if (WAVE_TYPE == "SQUARE") {
    set_freq(random(FREQUENCY_MIN, FREQUENCY_MAX), 1);
  } else if (WAVE_TYPE == "TRIANGLE") {
    set_freq(random(FREQUENCY_MIN, FREQUENCY_MAX), 2);
  }
}

void set_freq(long frequency, unsigned char flag_type) {
  int MSB;
  int LSB;
  int phase = 0;
  long calculated_freq_word;
  float AD9837Val = 0.00000000;
  AD9837Val = (((float)(frequency))/25000000);
  calculated_freq_word = AD9837Val*0x10000000;
  MSB = (int)((calculated_freq_word & 0xFFFC000)>>14); //14 bits
  LSB = (int)(calculated_freq_word & 0x3FFF);
  LSB |= 0x4000;
  MSB |= 0x4000;
  phase &= 0xC000;
  AD9837Write(0x2100);
  delay(100);
  AD9837Write(LSB);  //lower 14 bits
  AD9837Write(MSB);  //upper 14 bits
  AD9837Write(phase);  //mid-low
  delay(10);
  switch(flag_type) {
    case 0:
      AD9837Write(0x2000); //sin
    break;
    case 1:
      AD9837Write(0x2020); //square
    break;
    case 2:
      AD9837Write(0x2002); //triangle
    break;  
  }
}

void AD9837Write(int dat) {
  int x;
  digitalWrite(FSYNC, LOW);  //Set FSYNC low
  for (x = 0; x < 16; x++) {
    if (dat & 0x8000)
      digitalWrite(SDATA, HIGH);   //Set SDATA according to MSB in cmd
    else
      digitalWrite(SDATA, LOW);
    digitalWrite(SCLK, LOW);  //CLK transistion to latch the bit into the AD9835
    digitalWrite(SCLK, HIGH);   
    dat <<= 1;  //Shift to next bit in cmd
  }
  digitalWrite(FSYNC, HIGH);  //Set FSYNC high
}
gtaglia commented 3 years ago

Hello does someone want to sell one working prototype? My email is gtaglia2012@yahoo.com