Greetings all, I just started working on a project with my dad and we would like a smallish device to perform a task. I naturally thought "Arduino!" but I'm not sure if Arduino is the best method, or if something else (low-cost and small like a Raspberry Pi or something) would be better suited. So here's what we're trying to do:
We would like to have an opto switch that shoots across a model railroad train track and when the train passes through the beam (thus triggering the switch) a sound file (we don't need a specific file type here--we can go with whatever is easiest) is played. We could push this sound out to an amp, or simply to a little speaker secreted in the scenery.
We'd need this to be able to be able to run without being hooked up to a computer (so standalone).
I'm doing this to spend more time with my Dad as he's getting along in age and I'm getting enjoyment out of the electronics part of it and I'm looking to bring in some, hopefully, simple but cool methods to it!
Yes, this is possible to do on an arduino. If you're looking for something small, you might want to look into an Arduino Nano, Micro, and/or Mini. You might also want to get one of these modules HERE
There is an enormous topic on this module in the Audio forum, here is a link
To amplify the audio signal, you can get a cheap guitar amp, and make your own cable to plug into it.
Very nice of you to get a project going with your dad. Good for you!
As for hardware, neither arduino nor raspberry pi is required for a simple trigger. You can get this following module and hook the opto output to one of the trigger pins. You may want to add some small caps to smooth the rise of the signal so it doesn't trigger too many times. If you are unsatisfied with the result , get a small arduino clone on ebay, such as arduino nano, and program a debounce code and add a guard so when the sound is triggered, it will not be triggered again for a fixed time. Make sure it's long enough so subsequent cars don't all trigger the sound as they pass, unless that's your intention.
I don't have personal experience with this module but one of my clients vouches for it.
Whoa, this looks promising! Thanks liudr. I'm going to check out their project with it and see if it will fit the bill!
liudr:
Very nice of you to get a project going with your dad. Good for you!
As for hardware, neither arduino nor raspberry pi is required for a simple trigger. You can get this following module and hook the opto output to one of the trigger pins. You may want to add some small caps to smooth the rise of the signal so it doesn't trigger too many times. If you are unsatisfied with the result , get a small arduino clone on ebay, such as arduino nano, and program a debounce code and add a guard so when the sound is triggered, it will not be triggered again for a fixed time. Make sure it's long enough so subsequent cars don't all trigger the sound as they pass, unless that's your intention.
I don't have personal experience with this module but one of my clients vouches for it.
Luidr, you going to have to forgive my ignorance on this one but I've never really worked with a separate "board" like this. I have one on order now but I was just curious how something can work without the Arduino? I mean, I have an Arduino, so do I use the Arduino to "program" the Adafruit board? And then the VS1053 can just run and play the files on certain trigger events? Or do I always have to have it connected to an Arduino of some sort? In the tutorial on their page I don't think they show it in "standalone" mode.
I have used an Arduino to "program" an ATTINY85 chip and made a custom PCB for that (to make an LED-dimmer for a coffee table), so I've "burned" a chip before, but there were coherent instructions and examples for me to follow on that one--just wondering if I need to order something like a nano or mini to put this thing in place permanently?
Ok, I made the wrong assumption. Sorry about it. It does need an arduino. A couple of options here, build a stand alone atmega328 or purchase a cheap arduino nano.