Shop OBEX P1 Docs P2 Docs Learn Events
Infrared Jammer not working — Parallax Forums

Infrared Jammer not working

brandanbrandan Posts: 52
edited 2014-12-19 15:18 in Propeller 1
I wanted to create an IR jammer but for some weird reason it's not working. If I mess with the IR led's pin the IR receiver detects the signal for a half of a second.

My setup:
This is my code for the jammer:
#include "simpletools.h"

int main(){
const int pin =15;
const int hertz= 38000*2;
clkset(0b01101111, hertz*(80000000/hertz));
set_direction(pin,1);
printf("%d",CLKFREQ);
while(1){
waitcnt(CLKFREQ/hertz + CNT);
toggle(pin);
}
}

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-18 18:02
    Not all receivers are 38000Hz, some are centered on 38500Hz an others might be 42000Hz.
    So, reception might degrade when blocking at 38000Hz for a 38500Hz or 42000Hz receiver; but something may get through. It is not easy to identify the frequency response by markings on the unit. Likely you have to test the frequency response.

    And if that isn't enough of a problem, I suspect that the jammer not only has to be the right frequency, but be powerful enough to overwhelm competing good data.

    You might need to drive an array of IR LEDs, not just one. And these LEDs would need to be taIlored to output a wavelength of light similar to what the receiver is designed to receive.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-12-18 22:14
    No need to use clkset -- it's easy to setup a counter to create a specific frequency. You can easily modify that, even while it's running, to sweep through frequencies that you are attempting to jam.

    Here's a method I have in my standards Spin template (I don't program in C) -- this should translate pretty easily. Once you've got it working, your main loop can sweep through the range of frequencies you want to jam (I'd go 30kHz to 60kHz in 1kHz steps; spend a couple milliseconds at each frequency).
    pub set_freq(ctrx, px, fx)
    
    '' Sets ctrx to frequency fx on pin px (NCO/SE mode)
    '' -- fx in hz
    '' -- use fx of 0 to stop counter that is running
    
      if (fx > 0)                             
        fx := ($8000_0000 / (clkfreq / fx)) << 1            ' convert freq for NCO mode    
        case ctrx
          "a", "A":
            ctra := ((%00100) << 26) | px                   ' configure ctra for NCO on pin
            frqa := fx                                      ' set frequency
            dira[px] := 1                                   ' make pin an output
         
          "b", "B":                         
            ctrb := ((%00100) << 26) | px  
            frqb := fx                    
            dira[px] := 1
    
      else
        case ctrx
          "a", "A":
            ctra := 0                                       ' disable counter
            outa[px] := 0                                   ' clear pin/driver 
            dira[px] := 0                                  
         
          "b", "B":                         
            ctrb := 0 
            outa[px] := 0  
            dira[px] := 0
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-18 22:24
    If you load my standard Tachyon binary and hookup a serial terminal to it you can type:

    15 APIN
    38 KHZ

    That's all you need to do for it to be spewing out a 38KHz signal on P15 automatically. Now if you want to change it to 38,500 then just type:

    38,500 HZ

    That's all, but to sweep in 500Hz spacings from 37kHz to 42kHz every 50 ms perhaps try this:

    15 APIN BEGIN 37,000 5,000 ADO I HZ 50 ms 500 +LOOP AGAIN

    To lock that into the system so it does it on startup is straightforward:

    pub JAMMER 15 APIN BEGIN 37000 5000 ADO I HZ 50 ms 500 +LOOP AGAIN ;
    AUTORUN JAMMER

    That's all, clean and mean and as quick to get running as it takes to type a one-liner.

    EDIT: after setting the AUTORUN you will need to run BACKUP to save everything to the EEPROM. For the examples make sure you are in DECIMAL or else force decimal as in #15 APIN #38 KHZ etc.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-12-18 22:48
    Sending out data bursts of high intensity IR might also be effective rather than a continuous bombardment of average IR energy.

    1) Have the jammer "listen" or look rather for the IR traffic and determine the bit timing for the data packet.
    2) Next the jammer could insert random bits into the packet based on the timing from step 1

    This way it would be more difficult to detect the presence of a jammer, and also the jammer could deliver higher intensity pulses that average out over a longer interval.
  • Mark_TMark_T Posts: 1,981
    edited 2014-12-19 15:18
    What about a 40kHz signal frequency modulated +/- 3kHz? Might be quite effective, easy to do with DDS on a timer.
Sign In or Register to comment.