Im building a pirate display with sound for Halloween and hoping I can trigger my MP3 sound card with the IDE as a dry contact switch.
Instead of having a manual push button to activate the sound card, Im hoping to program the IDE to be the trigger switch.
Is that possible without an isolation relay?
The sound card is the way to inject analog values into the PC and there are may oscilloscope software packages that allow you to use the sound card as an input.
I have never tried to use it as a digital input, but if you have the ability to get deep into the workings, you might have a go.
If you think a manual pushbutton can trigger your sound card, then the Arduino certainly can act as a pushbutton.
I would offer that Railroader did offer a common way to connect an Arduino to a PC to send data.
typically we ask for more details of the project so the chat about theory is not wasted because of something else.
Thanks for your input.
I do have some micro electronic relays that I used on a different project that closed its contacts with 5VDC. I would think if I can light up an LED with my micro board then I should be able to program the IDE to energize the relay and close the N/O contacts for just a second which would trigger the MP3 player.
Does that seem workable?
Keep in mind that a relay typically draws more current than a LED.
You may need a transistor between the output pin and the relay. (and a snubber diode).
Sorry but Your reply tells me nothing. You think of something, a way to do things, that I don't catch.
"Telling the IDE" is done by the Pc keyboard as I think and the IDE outputs the Pc strikes to the controller that's reading using Serial.read.
The controller can send text to the IDE using its serial monitor and it can be viewed on the Pc screen.
Just do what You think of and show how to do it.
Not really. But maybe his terminology is a bit mixed up.
Kirwin, what you describe is not possible. The IDE is how you program the Arduino.
What "MP3 sound card"? My props are using a DFRobot MP3 player and we have a keypad to control which MP3 file is playing. I may add a Wemos D1 Mini to control the MP3 player remotely, but I have other props that I am working on now.
break it down
halloween prank of some sort.
Pirate display, with sound for Haloween.
wants some sort of trigger.
Sound card has micrphone input and can accept external signals. Think of turning your PC into a really expensive Arduino with a single input jack.
replace "IDE" with Arduino and the thing starts to make sense.
what is missing is the Arduino input sensor that starts the Pirate shanty....
Maybe I have been talking to customers too much and understand the needs behind the really horrible description.
or maybe the Pirate Farmer down the street is wearing off on me.
really, peg leg, hook, eye-patch (if you ask you'll be sorry) but turned to a farmer selling corn.
Physically you sit at the PC and type in the program into the IDE.
You program the IDE.
You then have the IDE transfer the program to your arduino.
Yes it is all semantics.
In review the OP might have a sound module or sound shield.
Copy your pirate shanty to the SD card. Put the SD card in the sound module.
Connect the sound module to the arduino.
Program the IDE with the code to accept a signal from the unspecified sensor.
Transfer the sketch to the arduino.
When the signal comes from the unknown source.
The arduino tells the Sound module to play :
track 3.yo ho blow the man down
Thanks guys. I apologize for not communicating clearly on what I'm trying to do. I really appreciate all your help.
What I have is the MP3-TF-16P audio module. Ive already wired it up and transferred the audio to the micro SD card and it works perfectly.
So rather than having to push the buttons to activate it, all I want is for my arduino micro controller to be the push button switch. Hoping to install the code to trigger the audio card for lets say every 20 seconds.
I know there is a MP3 audio sketch available to use in the library and maybe Ill use it but for now just thought id try it this way.
Thats all I need to do.
I hope this clears things up.
No, no, no. You don't program the IDE. You use the IDE to receive keyboard button pressings and store them as a text file used for later adventures like compiling and downloading.
Any word handling program could be used in that first stage. The IDE is just a text editor. Suppose I use Word when typing the sketch. Am I "programming" Word? Certainly not.
I've seen question where people want to "program" just anything, programing relays, motors......
There is an old and well used terminology. Use that. Don't use home brewed terms, words.... It's like hiding the target in clouds of smoke.
Check with people working in the space or military field if precision in communication has any point! Have a look into aviation, how they communicate. Misunderstandings have no place there.
Here in forum a clear terminology leads to the solution much, much faster with less number of useless guesses passed to the OP.
a programmer, noun, one who programs
program, noun, is a collection of instructions that can be executed to perform a specific task
to program, verb
programming, verb
When a person says they want to program their Arduino. we don't correct them and say, no, what your really mean is that you want to press the keys on the keyboard in a sequence as to have the interpeter in your PC accept the signals from the key press and then have representations of the button presses form words in to a piece of software such as a 'word handling program' and then later when you want, have the computer complie those words and transfer them to the Arduino.
I would like to put it this way: Programming has been done in the moment the code is downloaded into the target. Then the target is programmed. Not before. The target is the controller, not the IDE.
Quoting:
When a person says they want to program their Arduino. we don't correct them and say, no.
That's fully in line with my opinion.
Quoting....
We know what they mean.
Sometimes guesses about the OPs intention goes wrong and OP feels like considered an idiot and gets very insulted. That was my guideline in this topic. Let's find out what the guy really wants. Maybe his idea is unusual, different from the usual questions. Therefore my "slow" approach.
One purpose of forum is to help new members make sketches for the controllers and have fun. An other, as I see it, good skill, is to use a good language, proper terminology and be understood every ware. Home made terms, language leads to misunderstandings.
"Programming is done with the keyboard into the IDE. "
Yes, the IDE is a tool on the way...
But still You are not programming the IDE!
You can ** setup** the IDE to work in different ways but I would not call that "programming the IDE" even if it's close.
The programming process involves getting the code brought together somewhere. The typing, the keyboard, the editor (IDE) are tools on the way.
The real programming has been done when the target performs the actions described in "a lot of text" in some editor, but the editor itself is not programmed.
This topic likely need the work of moderator, splitting it into 2 topics...
Poor OP has not received much assistance.
@OP
Start by making test code to make the controller handle only one of the peripherals. When that works widen the code to handle the next peripheral.
Don't throw all of it into the pan and try to make it work.
since the exact same question was on a new thread this morning, I think the OP started a new post, with schematic and all the details asked on this thread.
if that is the case, then it was a PIR and sound module.