I Want to Make a Clap On PC

izaak_

Commendable
Nov 20, 2016
2
0
1,510
I want to make a clap on computer and i was wondering if you think its a good idea or not and if anyone has done it or if you have any tips.Thank you
 

Ne0Wolf7

Reputable
Jun 23, 2016
1,262
5
5,960
You need to make the circut compleat between the two turn on wires, this is what happens when you press the power button. Now, you'll obviosly need a microcontroler for this, and I think the bes way to go about it is to have some sort of switch that something moves phisicaly breaking and closing the circut, becauste this is what the power button does.
You my even be able to do it without playing with any wires inside of your case if you can maybe get a super tiny actuater or even potentiomiter or DC moter sucured to a fixed position on your case.
You'll also need a sound impact sensors like this: http://www.robotshop.com/en/parallax-sound-impact-sensor.html?gclid=CjwKEAiAsMXBBRD71KWOh6fcjRwSJAC5CNE1ZR0VUqLmWQI1ZF9qBLalnPro2vl28om5dSpteY_KlhoCo0Lw_wcB
I like this one because it easaily interfaces with praticaly amything.
SO waht microcontroler will you use? I like arduino, which I'm more familiar with, but I can help you ceck out rasperry pi too,
 

Ne0Wolf7

Reputable
Jun 23, 2016
1,262
5
5,960
You'll need to do the normaly expecter wiring (power, ground) and have the signal wire from the sound sensor being a digital read, because the sound sensor gives high/low outputs based off of the sensitivity you choose with it onboard changer. Another digital pin will be an output, this one will control the relay. Your code will be something along the lines of:
C++:
int clap = 6 // Pin 6 is our sound sensor
int relay = 7 // Pin 7 is our relay module

     voidsetup()
pinMode (clap, INPUT)
pnmode (relay, OUTPUT)
 
     voidloop()
if ( clap = LOW) {
     digitalWrite(relay, LOW) //When there is not clap detected, leave the circut open, thus don't affect the PCs state
     delay(500) //Wait half a second (about how long we'd hold the power button for)
     }
if (clap = HIGH) {
     digitalWrite(relay, HIGH) // WHen a clap is dectected, clsoe the circut untill it is not dectaced anymnore, thereby either turning the PC on or off
     delay(500) //Wait half a second
}