How do I run a a dc relay switch with an ac audio signal?

Thread Starter

Benju

Joined Feb 23, 2019
6
I was inspired by the “ Peachy Printer “ project to use an audio signal to control a switch. The Peachy Printer project used the headphone jack and audio signal to control the angle of a mirror, which aimed a laser for an SLA 3D Printer. To be clear, My goal is to record tones on an mp3 and in turn have those tones flip a switch to control a motor or magnet. I would then be able to use one side of a stereo track for sound and the other side to synchronize lights or motion. I know nothing of electronics but bought some parts on ebay to try to achieve this objective. I understand that the audio signal is alternating current. I bought some little diode that sounded like it could convert alternating to direct ( although, now that I have them they have no label and I cant find the info on it.) I tried to run the signal through this diode to a little relay switch. I also tried amplifying the signal before doing this. I was unable to get any response from the relay switch. Does anyone have any thoughts on how this might be possible, and a recommendations for specific parts and assembly.
Thank you so much,
Benju
 

danadak

Joined Mar 10, 2018
3,682
Is the relay supposed to turn on when the audio exceeds a certain value ? Or is it
the frequency of audio that you want to control relay.

Is the value of audio to be examined to control the relay peak to peak, average, or RMS ?


Regards, Dana.
 

Thread Starter

Benju

Joined Feb 23, 2019
6
Is the relay supposed to turn on when the audio exceeds a certain value ? Or is it
the frequency of audio that you want to control relay.

Is the value of audio to be examined to control the relay peak to peak, average, or RMS ?


Regards, Dana.
Dana,
Thank you so much for your response. I must apologize for my ignorance, but I am not as versed in all of these terms as you might think. I am less concerned with how it works, and more with finding a way to make it work. I am therefor quite open to your guidance. Ideally I had hoped to achieve the following goals.

1. Be able to produce these for a product relatively inexpensively and simply with simple electronics I add to a cheep mp3 player, amplifying speaker, relay and electric magnet or motor, with its own battery.

2.Create an audio track, that remains an audio track and is placed on one side of the stereo track in the mp3 player. This would then run through the speaker for the device’s “sound track”

3. Be able to listen to the above audio track while recording a tone for the other stereo track. For example, by hitting a key on an electronic keyboard with whatever note or instrument that works best selected. My desire is to be able to have that tone flip on the relay, and keep it on for the duration of the tone, and then allow the relay to flip back off when the tone ends.

4. The end result is a product with sound that has actions created with the magnet or motor synchronized to the audio.

Does this answer your question? Is there a relatively simple way to achieve this?

Again Tha
 

danadak

Joined Mar 10, 2018
3,682
Yes, essentially when a tone is input to track a comparator "sees" the audio now
present, in terms of its amplitude, and flips the relay. Like the "clapper" light that
turns on/off a light at the presence of sound. In that case the detection has to eliminate,
filter, the audio to reject other room noise that is not clapping noise.

Google "sound activated relay circuit", quite a few hits.


Regards, Dana.
 

Yaakov

Joined Jan 27, 2019
1,610
Dana,

1. Be able to produce these for a product relatively inexpensively and simply with simple electronics I add to a cheep mp3 player, amplifying speaker, relay and electric magnet or motor, with its own battery.
Hello.

It's great that you are trying to build something but you've made a novice error by choosing a solution before properly defining the problem. What is going to happen now is that your solution will become the problem. When designing something, the first thing to do is to describe the desired result, not the way to get it.

If you start out with a method, you will inevitably compromise the result, or even fail to achieve it. So, always begin with a little story about what it would be like to use the product, what the user would experience, and then begin to engineer the solution.

Factors like cost, size, durability, longevity, and other things will all need consideration once you start considering different ways to get it done.

In this case, if you really want a product, your proposed method seems quite unsuitable. Various elements of it might be sensible, but the overall idea will almost certainly not work as a way of creating a product.

As a way to learn something, it would be OK, but you seem to be focused on the results not the method in your mind while reversing that in your efforts. It is a common mistake to imagine that knowing how things work is non-essential while in fact it is the most important thing in design. If you don't want to learn how it works, collaborate with someone who does. That person won't have your vision for the completed project but will be able to help you make it practical.

Your current approach really doesn't strike me as ending up useful. There are too many loose ends, and without a more systematic approach even if you manage to get something it is likely to be unstable and have poor performance in various ways that you don't currently understand.

Please don't take this as negative criticism or an attempt to discourage you, I am trying to save you a lot of trouble. Many years of designing and building many different sorts of systems taught me some lessons the hard way and if you want more than experience from this project you can't do it alone. You really need a very good specification, that is, a careful description of that you expect it to do, and how it will appear (things like power supply, you mentioned batteries; and physical appearance and size). If you are not familiar with formal spec writing, a very good way to do it is write a story, that is, write about what it is like for the user to see, handle, use, and maintain it.

Then, even if you don't get a collaborator, you will be focused on a specific outcome, not a vague one—and if you do collaborate, the designer will understand what you want, and be able to explain the inevitable cost, size, performance tradeoffs as the design comes together.

Good luck!
 

Thread Starter

Benju

Joined Feb 23, 2019
6
Yes, essentially when a tone is input to track a comparator "sees" the audio now
present, in terms of its amplitude, and flips the relay. Like the "clapper" light that
turns on/off a light at the presence of sound. In that case the detection has to eliminate,
filter, the audio to reject other room noise that is not clapping noise.

Google "sound activated relay circuit", quite a few hits.


Regards, Dana.
Dana,
Thank you. I did some googling and not only found many sound activated relay circuits but just the phrase "sound activated circuit" turned up endless tutorials, circuit diagrams, and information. Many of these look much like the clapper idea where the input is a sound collected with a mic and the switch remains on for a timed period. I am wanting an inline input and the switch to open and close quickly with the tones. Like a simplified Billy Bob Bass
. Perhaps there is simple off the shelf solution that is already available. I'm looking at switches on ebay, but they seem to function like the clapper. Are you aware of any that would be able to work in line and open and close like a puppet?
 

Thread Starter

Benju

Joined Feb 23, 2019
6
Hello.

It's great that you are trying to build something but you've made a novice error by choosing a solution before properly defining the problem. What is going to happen now is that your solution will become the problem. When designing something, the first thing to do is to describe the desired result, not the way to get it.

If you start out with a method, you will inevitably compromise the result, or even fail to achieve it. So, always begin with a little story about what it would be like to use the product, what the user would experience, and then begin to engineer the solution.

Factors like cost, size, durability, longevity, and other things will all need consideration once you start considering different ways to get it done.

In this case, if you really want a product, your proposed method seems quite unsuitable. Various elements of it might be sensible, but the overall idea will almost certainly not work as a way of creating a product.

As a way to learn something, it would be OK, but you seem to be focused on the results not the method in your mind while reversing that in your efforts. It is a common mistake to imagine that knowing how things work is non-essential while in fact it is the most important thing in design. If you don't want to learn how it works, collaborate with someone who does. That person won't have your vision for the completed project but will be able to help you make it practical.

Your current approach really doesn't strike me as ending up useful. There are too many loose ends, and without a more systematic approach even if you manage to get something it is likely to be unstable and have poor performance in various ways that you don't currently understand.

Please don't take this as negative criticism or an attempt to discourage you, I am trying to save you a lot of trouble. Many years of designing and building many different sorts of systems taught me some lessons the hard way and if you want more than experience from this project you can't do it alone. You really need a very good specification, that is, a careful description of that you expect it to do, and how it will appear (things like power supply, you mentioned batteries; and physical appearance and size). If you are not familiar with formal spec writing, a very good way to do it is write a story, that is, write about what it is like for the user to see, handle, use, and maintain it.

Then, even if you don't get a collaborator, you will be focused on a specific outcome, not a vague one—and if you do collaborate, the designer will understand what you want, and be able to explain the inevitable cost, size, performance tradeoffs as the design comes together.

Good luck!
Yaakov,
Thank you for your reply. I think you are right on track in terms of my approach. Your description of the "Story" was particularly helpful in that I can then communicate the desired result in spite of my electronics ignorance. Perhaps a good illustration of an end result is a wanjangled version of Billy Bob's Bass
. Something that could be home made with out a tone of techinal knowledge or equipment.
 

MrChips

Joined Oct 2, 2009
19,729
@Yaakov has provided you with sound advice.

Here is a similar approach.
If you want to design, engineer, and market a product, work backwards.

Start by writing the User's Manual.
Next, build a mockup of what the device or app is going to look like.
Next, write out the specifications on what the device will achieve and how the user will interact with the device.

If your intention is to bring your device to market, you will then advertise in appropriate places in order to introduce your device and receive feedback from potential customers.

You do all of this before you even start the design, building, and testing.
 

djsfantasi

Joined Apr 11, 2010
5,833
I made a circuit which may be similar to what you are looking for. It is an op amp circuit that takes an audio input and amplifies the signal to a range useful for input to a μP ADC. It’s an extension to a circuit by “Scary Terry” for controlling Halloween monsters/props.

The μP expected a signal in the range of 0-5VDC. The audio signal is ±1V. The op amp circuit has an adjustable gain to adjust for various audio sources. The output is run through an RC filter to get a DC envelope corresponding to the audio signal. While I used the original audio signal, it will also work with pure tones and I believe I allude to that in this article.

Note that due to delays inherent in the filter, I delay the original signal by 300mS. Audacity was used to pre-process the input. You can use this program to add your tones to an existing audio track. It will let you play and mark the times where you want to add your control tones.
 

Thread Starter

Benju

Joined Feb 23, 2019
6
I made a circuit which may be similar to what you are looking for. It is an op amp circuit that takes an audio input and amplifies the signal to a range useful for input to a μP ADC. It’s an extension to a circuit by “Scary Terry” for controlling Halloween monsters/props.

The μP expected a signal in the range of 0-5VDC. The audio signal is ±1V. The op amp circuit has an adjustable gain to adjust for various audio sources. The output is run through an RC filter to get a DC envelope corresponding to the audio signal. While I used the original audio signal, it will also work with pure tones and I believe I allude to that in this article.

Note that due to delays inherent in the filter, I delay the original signal by 300mS. Audacity was used to pre-process the input. You can use this program to add your tones to an existing audio track. It will let you play and mark the times where you want to add your control tones.

Wow Djsfantasi,
This is incredibly generous, and really helpful. I think I'm realizing this may be a bit more over my head than I thought, and that is fine. it is sending me in the right direction. Awesome job with the animetronic!
 

Thread Starter

Benju

Joined Feb 23, 2019
6
Here is a sound activated module that will work directly with a MP3 input. Duration of tone keeps relay energized.
SG
http://www.simplecircuitboards.com/Spec Sheets/Sound Activated Relay.pdf
Yahtzee!
I think this may be just what I'm looking for, and its already made and available. It sounds like this guy was motivated bu wanting the same kind of thing I want. The only problem is I cant find the board described in your link on his site. I will contact him. Thank you very much!
 
Top