Kronos Robotics and Electronics
Site Map
 
Home Zeus Projects App Notes Downloads Dios Athena Forums
 

Build a Remote Control Clap Interface

By Michael Simpson

My daughter has been bugging me for one of those clapper devices you see advertised on TV.  I decided to see if I could build my own.   Using a small speaker as a microphone we can amplify the signal enough to register on the Athena microcontroller.

 

Hookup

To pick up the sound we used a 130 mini speaker in series with a .1uf capacitor.  The sounds that the speaker picks up need to be amplified so we use a MC24119P low power amp.   The output of the amp is fed directly to the Athena.  When the speaker picks up a sound beyond a certain threshold they will register as 1 on port 0.

The Athena will use some timing loops to detect two threshold breaches (Claps).  Once detected port 4 is toggled.   Port 4 drives a NPN transistor which in turn drives a 12v relay.   The Relay is used to switch the lamp or appliance of your choice.

You can use just about any relay for this project.  I recommend that you check out my relay application note.

 

I used PCB8 available from the online store as the basis for my circuit.

I mounted the speaker on the outside of my case.  I connected the AC-IN to a AC Plug and the Switched AC out to the end of a extension cord.

 

 

Program (download it here)

'Clapper

   output 4
   low 4
   dim counts,counts2,hits,claps
   clearall

loop:
   onportgoto 0,itslow,itshigh

itslow:
   counts = counts + 1
   if counts > 250 then
     counts = 0
     counts2 = counts2 + 1
     if counts2 < 2 then
        goto loop
     endif
   else
     goto loop
   endif

   if hits = 0 then
     print claps
     if claps = 2 then
        toggle 4
     endif
     claps = 0
   else
     claps = claps + 1
   endif

   counts = 0
   counts2 = 0
   hits = 0
   goto loop


itshigh:
   hits = hits + 1
   counts = 0
   goto loop

 

Going further

You are not limited to toggling an IO port.  You can also use the IRout to control any Sony device.  With this you could use the project to turn a TV on or Off by clapping your hands.

You can also use the TW523 commands to send X10 control codes to turn any X10 Device on or off.

 

Parts

Easy RS232 Driver  

Athena

Mini PIC Chip PCB

Breadboard Pot

2N2222 Transistor

130 Ohm Speaker

Low Power Amp

7805

 

7.5V AC Adapter

9 Pin Cable

Breadboard and Wire Kit

 

 

Copyright © 2001 - 2007 Kronos Robotics