The Sanity nullifier

The purpose of this device is a bit evil. Oh well, sue me. I made it as a yoke for the first of april and many more days to come.

A brief description:

The device beeps a short beep of a very annoying frequency in random times. The time between beeps is anywhere within half an hour to nine hours.

Point:
The subject of your devious device has a flat/house. Put the beeper inside the house, and when the first beep occurs, your victim will just wonder about that what was it. When it occurs again and again he will try to locate the source. After checking all cellphones, smokealarms, battery powered devices in general he will be clueless as to what is causing this. The beeping will be a mystery as long as the battery lives. Or it will drive him nuts.

Instruction:
1. Activate the device
2. Hide the device
3. Don't stay around to watch the fun.

It beeps in random. Where the time between beeps can be anything from 30minutes, to 9hours and 30minutes.

Hardware:

The hardware is boringly simple. One piezotransducer, one battery, one AVR. All packed like you choose it. Here's the schematic:

sanity_nullifier_schematic

A sample of how you can make it is here:

sanity_nullifier_photo

 

As you can see my main point is always functionality. Not decoration. But there's a gazilion other ways you can make the device.

Firmware:

I release the firmware under GNU. In the project folder, which you can download on the bottom of the page is a precompiled hex file which worked for me.

/*
 Copyright David Gustafik, 2007

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

 */

 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include <compat/deprecated.h>
 #include <stdlib.h>

 /*
 (to be used on first of april, or whenever in an evil mood (for me 24/7))

 by David 'daqq' Gustafik

 The Beeper of Madness:

 Beeps a short beep of very annoying frequency in random times.
 Beeps occur randomly within half an hour to nine and a half hour.
 Instruction: 
 1. Activate the device
 2. Hide the device
 3. Don't stay around to watch the fun. 

 Point:
 The subject of your devious device has a flat/house. Put the beeper
 inside the house, and when the first beep occurs, your victim will
 just wonder about that what was it. When it occurs again and again
 he will try to locate the source. After checking all cellphones,
 smokealarms, battery powered devices in general he will be clueless
 as to what is causing this. The beeping will be a mystery as long 
 as the battery lives. Or it will drive him nuts. 

 WARNING: This software is provided as is without any waranties at all.
 The author is not responsible for any injuries/material damage that may
 arise from the usage of this software/device

 README:
 The hex file you received with the zip file that contained this file
 is calibrated for a ATTiny2313 running on the internal oscilator @ 4MHz
 and with the CKDIV8 fuse enabled. Therefore the processor is running at 
 500kHz. 
 */

 #define SERIAL_NUMBER 1
 //this is the seed for the random number generator. you may either use my
 //serial number (1) or recompile it (unadvised) with your own. 

 //defs
 #define BUZZER1() {sbi(PORTB,0);cbi(PORTB,1);}
 #define BUZZER0() {cbi(PORTB,0);sbi(PORTB,1);}
 #define BEEP_INTERVAL 0.08
 #define BEEP_LENGTH 2500
 #define nop() asm volatile ("nop;")

 //globals
 volatile unsigned int rand_cond=0;
 volatile unsigned int rand_box=0;

 //functions
 void beep(void);
 void wait(unsigned int a);
 #define _ms(x) x*45

 //timer overflow interrupt. occurs each 0.5seconds. 

 ISR(TIMER0_OVF_vect)
 {
  rand_box++;
  return;
 }

 int main(void)
 {
  DDRD = 0x00;
  DDRB = _BV(1) | _BV(0);

  ACSR=0x80;//disable power to the analog comparator
  TCCR0B=0x05;
  TIMSK = 0x02;

  srand(SERIAL_NUMBER);

  wait(_ms(100));
  beep();
  sei();
  while(1)
  {
   if(rand_box==rand_cond)
   {
    rand_box=0;
    rand_cond=rand()%(0xFFFF-1000)+1000;
    beep();
   }
  }
 }

 void beep()
 {
  unsigned int temp;
  for(temp=0;temp!=BEEP_LENGTH;temp++)//does the beeping on the piezo.
  {
   BUZZER0();
   wait(_ms(BEEP_INTERVAL));
   BUZZER1();
   wait(_ms(BEEP_INTERVAL));
  }
  return;
 }

 void wait(unsigned int a)
 { 
  unsigned int b,c;
  for(b=0;b!= a; b++)for(c=0;c!= 5;c++) nop();
  return;
 }

The code is boringly simple. You'll need an AVR running @ 4MHz with the CKDIV8 fuse enabled. This way, the device eats only 200uA (microamps) and can last long out of a lithium battery, like the one on the pictures.This is the configuration of your fuses to run this:

sanity_nullifier_ponyprog

 

Download:

Download the project folder here:

NOTE: If you make this device I ask nothing in return, just PLEASE take a photo of it and post it into my forum. That's all I ask.

Mods

A number of people built this device. Macsek, a fine guy from Hungary improved my original device by using a smaller AVR (Tiny13) and made smaller version, easier to conceal.

Here's the photo and the source:

sanity_nullifier_macsek

/*
 Copyright David Gustafik, 2007

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

 date modified by change
 ---------- -------------------------- ----------------------------
 2007.03.27 Macsek mmx233@gmail.com Added Tiny13 support

 */

 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include <compat/deprecated.h>
 #include <stdlib.h>

 /*
 (to be used on first of april, or whenever in an evil mood (for me 24/7))

 by David 'daqq' Gustafik

 The Beeper of Madness:

 Beeps a short beep of very annoying frequency in random times.
 Beeps occur randomly within half an hour to nine and a half hour.
 Instruction:
 1. Activate the device
 2. Hide the device
 3. Don't stay around to watch the fun.

 Point:
 The subject of your devious device has a flat/house. Put the beeper
 inside the house, and when the first beep occurs, your victim will
 just wonder about that what was it. When it occurs again and again
 he will try to locate the source. After checking all cellphones,
 smokealarms, battery powered devices in general he will be clueless
 as to what is causing this. The beeping will be a mystery as long
 as the battery lives. Or it will drive him nuts.

 WARNING: This software is provided as is without any waranties at all.
 The author is not responsible for any injuries/material damage that may
 arise from the usage of this software/device

 README:
 The hex file you received with the zip file that contained this file
 is calibrated for a ATTiny2313 running on the internal oscilator @ 4MHz
 and with the CKDIV8 fuse enabled. Therefore the processor is running at
 500kHz.
 */

 //#define DEBUG
 #ifdef DEBUG
 // can be enabled only if DEBUG is set
 #define DEBUG_ONSCREEN
 #endif

 #define SERIAL_NUMBER 1
 //this is the seed for the random number generator. you may either use my
 //serial number (1) or recompile it (unadvised) with your own.

 //defs

 #ifdef __AVR_ATtiny13__
 #define BUZZER1() {sbi(PORTB,3);cbi(PORTB,4);}
 #define BUZZER0() {cbi(PORTB,3);sbi(PORTB,4);}
 #elif defined __AVR_ATtiny2313__
 #define BUZZER1() {sbi(PORTB,0);cbi(PORTB,1);}
 #define BUZZER0() {cbi(PORTB,0);sbi(PORTB,1);}
 #endif
 #define BEEP_INTERVAL 0.08
 #define BEEP_LENGTH 2500
 #define nop() asm volatile ("nop;")

 //globals
 volatile unsigned int rand_cond=0;
 volatile unsigned int rand_box=0;

 //function prototypes
 void beep(void);
 void wait(unsigned int);
 void tone(unsigned int, unsigned int);

 #define _ms(x) x*45

 //timer overflow interrupt. occurs each 0.5seconds.

 #ifdef __AVR_ATtiny13__
 ISR(TIM0_OVF_vect)
 #elif defined __AVR_ATtiny2313__
 ISR(TIMER0_OVF_vect)
 #endif
 {
 rand_box++;
 #ifdef __AVR_ATtiny13__
 // alive flashing led on timerIT
 if(rand_box&1) sbi(PORTB,0); else cbi(PORTB,0);
 #endif
 return;
 }

 int main(void)
 {

 #ifdef __AVR_ATtiny13__
 DDRB = _BV(3) | _BV(4)|_BV(0); // output on pin 2&3 so no interaction w/SPI nor RESET

 ACSR = _BV(ACD); //disable power to the analog comparator
 TCCR0B=_BV(CS02) | _BV(CS00); // CLK_IO/1024
 TIMSK0 = _BV(TOIE0); // Timer 0 Overflow Interrupt Enable

 #elif defined __AVR_ATtiny2313__
 DDRD = 0x00;
 DDRB = _BV(1) | _BV(0);

 ACSR=0x80;//disable power to the analog comparator
 TCCR0B=0x05;
 TIMSK = 0x02;
 #else
 // other types could be tested here
 DDRD = 0x00;
 DDRB = _BV(1) | _BV(0);

 ACSR = _BV(ACD); //disable power to the analog comparator
 TCCR0B=_BV(CS02) | _BV(CS00); // CLK_IO/1024
 TIMSK = _BV(TOIE0); // Timer 0 Overflow Interrupt Enable
 #endif

 srand(SERIAL_NUMBER);

 // wait(_ms(100));
 beep();
 wait(_ms(1000U));

 int i,j;
 //for(i=)

 BEEP_INTERVAL 0.08
 #define BEEP_LENGTH 2500

 sei();
 while(1)
 {
 if(rand_box==rand_cond)
 {
 rand_box=0;
 #ifdef DEBUG
 rand_cond=rand_box+60; //30sec
 #else
 rand_cond=rand()%(0xFFFF-1000)+1000;
 #endif
 beep();
 }
 }
 }

 void beep()
 {
 unsigned int temp;
 for(temp=0;temp!=BEEP_LENGTH;temp++)//does the beeping on the piezo.
 {
 BUZZER0();
 wait(_ms(BEEP_INTERVAL));
 BUZZER1();
 wait(_ms(BEEP_INTERVAL));
 }
 return;
 }

 void tone(unsigned int freq, unsigned int len)
 {

 while(len--)
 {
 BUZZER0();
 wait(_ms(len));
 BUZZER1();
 wait(_ms(len));
 }
 }

 void wait(unsigned int a)
 {
 unsigned int b,c;

 #ifndef DEBUG_ONSCREEN
 for(b=0;b!= a; b++)
 for(c=0;c!= 5;c++)
 nop();
 #endif

 return;
 }
This entry was posted in Projects, Simple MCU stuff and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.