Pages: [1]   Go Down
Author Topic: 4017 problem driving me nuts!  (Read 797 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I've been trying to build a clap detector which switches a relay on and off when a clap is detected. I ended up with this schematic (modified from some website) . As far as I can tell, it amplifies whatever the microphone puts out, triggers the 555 which sends out a pulse to the clock pin of the 4017, making Q1 go high. When another clap is detected Q2 goes high, resetting the 4017 back to 0. If I disconnect Q1 from the resistor and check the state of Q1 with an led to ground then things work as expected, it turns on when I clap once and turns off when I clap again. However, if I attach Q1 back to the resistor - enabling the relay -, then whenever I clap Q1 goes high and within a few milliseconds it goes low again as if it had reset itself! I've messed around with the resistor value and adding a diode across the relay without success. Does anyone know what could be wrong?
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Relay drawing too much current from the power supply?  What are you powering it from?
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That was one of my initial thoughts as I'm only powering it from a 200 mA wall wart. however I disproved this by manually pulling transistors base high and seeing if the Q1 goes low when previously high, which it didn't.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you try powering the relay directly too? Maybe not enough voltage?
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yep, relay works fine with this power supply.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How much does the relay draw? Maybe you could try a 1k resistor or even lower like 480 to more saturate the transistor
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It draws about 50 mA, so ~1mA to the transistors base should saturate it, but just in case I've tried it with as low as 470 ohms with the same results. The problem just seems to be that the 4017 resets itself for some reason.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, problem(s) solved. It turns out that the relay was clicking in so loudly that it triggered itself! so I moved the microphone to a seperate board and increased the RC time constant of the 555 timer so that it wouldn't trigger so fast and now it works most of the time. It's not sensitive enough though; I need to clap so hard that it hurts my hands. Oh well, I'll fix that later.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lol that's a funny one,
maybe make it need a double clap to turn on?
Logged

Pages: [1]   Go Up
Jump to: