I want to setup my UNO with a wave shield to play audio files and a thermocouple shield to read k type thermocouples (temp sensors). The UNO will get sensor data from the engine and temperature data from the thermocouple shield for things like transmission temp, exhaust temp, ect. Then if the sensor data goes out of range it will trigger the wave shield to play the appropriate wave file. Think Batmobile Tumbler and its talking computer.... Im also wondering about if I will need an external timer. If per say two sensors go out of range around the same time, I want the arduino to play both messages back to back, not interrupt itself mid speech. Would I need a timer for that or is there another way to set the arduino up so it doesnt stop a wave file mid play....
Here are the links to the Adafruit wave shield and the Thermocouple shield
So i have a decent idea how to setup the hardware but Im really green at coding, Ive just started arduino but am not new to electronics... I built the ECU for my car (Megasquirt II)...
I have a nice text to voice converter for the audio messages i need so that is handled. So far im just reading through tutorials while at work and seeing what kinds of projects are similar.
Here is a talking clock that has some same goals:
I am local to Austin TX and if anyone here is also, or wants to tutor me through this some time I am willing to pay some for the help and if i get stuck.
asv4k8:
.... Im also wondering about if I will need an external timer. If per say two sensors go out of range around the same time, I want the arduino to play both messages back to back, not interrupt itself mid speech. Would I need a timer for that or is there another way to set the arduino up so it doesnt stop a wave file mid play....
... So i have a decent idea how to setup the hardware but Im really green at coding, Ive just started arduino but am not new to electronics...
I'm an Arduino newb - in fact, got mine today for Christmas I've been wanting to learn electronics for a long time and I'm really excited. My background is software development.
So, I can offer my opinion on how I would handle multiple sensors firing at once. My thought would be to set up an interrupt handler so when a sensor is triggered, the handler would get control where it would add the event to a queue. In the main loop, look to see if there are any events in the queue and work each one off serially (first-in, first-out style).
If you have a waveshield, why use the text to voice converter?
I dont want to use my own voice, I want it to be a synthetic, human sound. Not too cheesy but enough that you know its not recorded. So the wave shield will hold all those messages I record from the text to voice converter... (i wasnt going to use a text to voice converter in real time, it is just to pre record the messages.)
fwerginz:
My thought would be to set up an interrupt handler so when a sensor is triggered, the handler would get control where it would add the event to a queue. In the main loop, look to see if there are any events in the queue and work each one off serially (first-in, first-out style).
I like the idea of coding in an interrupt handler... do you have any examples of code like this? Im not an electronics n00b but I am a coding n00b with only rusty C+ experience so maybe we can help each other out here.
If either of you want to email me feel free asv4k8 at gmail dot com
Interrupts are the last thing, the very last thing of relevance here. They may be a way of driving the WAV shield, but that will be provided for you in the respective library - unless you really want to make things complex.
In fact, the very description you gave precludes interrupts. You poll the various inputs one by one. If any given one is out of range, you issue the corresponding message, after which you take care to poll all the other cases before returning to the first and determining whether it is appropriate to repeat it. You may provide a means for polling in order of priority so that having issued your warning, it will not be reviewed until all higher priority events are polled and then those of lower priority - this is an interesting consideration.
You may also wish to consider early termination of the message if the condition is cleared whilst the message is being issued. That is an interesting point, again handled by polling. Scrolling the message out is in fact, part of the polling process as well.
This is not a multi-processing environment. We are talking about a microcontroller.
Again, the "n00b" shows.
Interrupts are the last thing, the very last thing of relevance here. They may be a way of driving the WAV shield, but that will be provided for you in the respective library - unless you really want to make things complex.
In fact, the very description you gave precludes interrupts. You poll the various inputs one by one. If any given one is out of range, you issue the corresponding message, after which you take care to poll all the other cases before returning to the first and determining whether it is appropriate to repeat it. You may provide a means for polling in order of priority so that having issued your warning, it will not be reviewed until all higher priority events are polled and then those of lower priority - this is an interesting consideration.
You may also wish to consider early termination of the message if the condition is cleared whilst the message is being issued. That is an interesting point, again handled by polling. Scrolling the message out is in fact, part of the polling process as well.
I see what you are saying and read up a little more, my original thought was to use the Uno and the wav shield but I read more and found this;
From my understanding its programmable the same as the arduino but has a smaller form factor... 32 digital inputs, 8 analog inputs... still plenty for my needs and this kit has the audio and sd card in mind already.... what are your thoughts?
OK, the fact is that I have absolutely no familiarity with the Microduino - I have not even heard of it prior to your reference here. :o
The point is that the Arduino is quite unsuited to manipulating audio data - let alone video - so you need a module of some sort to perform this in hardware. I really do not know how the wav shield handles this either, but presumably both it and the system to which you refer do this in hardware. I cannot advise on their pros and cons and am not in a position to research either just now.
The general advice is as always - get the necessary parts and work on one aspect of the project at a time. As familiarity is gained, you can put different things together.
The nub of my comment was to quash the suggestion that interrupts are some magical thing that makes it possible to do many things at once, as pursuing this would really be a gross waste of time.
fwerginz:
Well excuse me for not being as smart as you! My first post and I get called out. Friendly forum.
It is not a matter of being friendly or not, or being "smart". This is a technical forum. If someone gives patently inappropriate and misguided advice, it needs to be corrected.
I explained the point - we are dealing with 16 MHz microcontrollers, not Intel I5s. It may put your nose out of joint, but hopefully you can accept correction. If I am proved wrong, I will apologise.