Hi!!!
I'll cut the chase and explain my problem.
This is my goal.
Audio signal from headphone jack will trigger the relay for about 30seconds.
When i call the phone, the audio signal will trigger the relay. Laptop cooler fan will be triggered by relay.
i wanted that even if i cancel the call the relay will stay on for 30seconds, then shuts down.
I have limited resources, i only have arduino, relay shield, audio jack and a phone.
What i accomplish:
Connect audio jack to phone.
Then i connect the wire going to gnd and analog input pin 0.
AnalogRead shows 0 when there is no music played then it shows 0-58 range when a song is played.
For the mean time, i use led pin13 on the board. It works, it only lights up if the audiosignal is > 0. So No light when no song is played, then it blinks when i played a song.
Main issue, led doesnt stay on for 5seconds, when i add delay, what changes is the frequency of time it reads, not the time led stays on.
If i use this configuration, the relay will go crazy turning on and off.
I wanted it to activate my laptop fan cooler for 30 seconds when i call.
I hope you could help me.
Thanks!!!!