Voice recorder with Arduino , probs with End of Message signal, subroutines.

I am trying to build a BMX start gate using a voice recorder to play the Random Start sequence.

I am having trouble getting the program to run each subroutine separately. It seems that the program is not waiting at the appropriate time therefore it executes two routines concurrently.
As soon as I press the button, the beeps ( tone) starts as well as the voice recorder. The beeps should not start until the End of Message signal has been received back from the voice recorder. Im sure I have a fault in my WHILE statement.

Program as a BMX start gate.

Push Start Button
(Detect button push)
(Ensure only one button push)

Send signal to voice recorder to initiate recorded message.

Wait for End Of Message signal.

When EOM signal received, start random delay.

When random delay has ended,
Play tones.
At end of tones,
Operate relay.

I am using
Arduino Uno
Relay module ( no ID number on it)
Nuvoton ISD 1800 Series
Single Chip, Single message, voice record/playback device.

Data sheets here. (Sorry it doesn't seem to want to make a hyperlink, have to cut and paste)
(If link doesnt work please let me know.)

I have connected the Play L pin on the voice recorder to pin 4 of the Arduino and
LED pin ( EOM ) of recorder to pin A1 of the Arduino
To my understanding, the EOM signal should be a low so using an Analog input of Arduino to detect it.

I have included a bmp pic of the circuit. As attachment or link

Dropbox - File Deleted - Simplify your life BMX Start Gate1.png?dl=0

I have also included a short video showing that both events happen at the same time, when one event should proceed the other.

Dropbox - File Deleted Arduino.mp4?dl=0

Sketch is in the attachment

Below is the result for when it plays the beeps and voice together. It appears to follow the program but somehow it is ignoring the WHILE statement or getting it too early.

Starting new Random Number Sequence
debounce val1_
0debounce val2_
0waiting for button press
waiting for button press
waiting for button press
waiting for button press
just testing here
00button pushed
playl high
led on
returned from debounce routine
move to subroutine get eom
just testing EOM here
eomState is 1023
voltage b4 is 5.00
waiting for low signal EOM
voltage aft is 15
eom sent. eom sent.eom sent.
random start subroutine getting delay time
The Random Number is = 2255
Back from random delay, now go play beeps
start beeps
finish beeps go back
debounce val1_
0debounce val2_
0waiting for button press
waiting for button press
waiting for button press
waiting for button press
waiting for button press

When I put this line in,
"while(analogRead(eomPin) !=0);"
this is the result below.
The voice recorder does its bit but that is all.

waiting for button press
waiting for button press
waiting for button press
just testing here
00button pushed
playl high
led on
returned from debounce routine
move to subroutine get eom
just testing EOM here
eomState is 1023
voltage b4 is 5.00

stops at this point.

The result if the line reads " while(analogRead(eomPin) ==1);"

waiting for button press
waiting for button press
waiting for button press
just testing here
00button pushed
playl high
led on
returned from debounce routine
move to subroutine get eom
just testing EOM here
eomState is 1023
voltage b4 is 5.00
waiting for low signal EOM
voltage aft is 15
eom sent. eom sent.eom sent.
random start subroutine getting delay time
The Random Number is = 1958
Back from random delay, now go play beeps
start beeps
finish beeps go back
debounce val1_
0debounce val2_
0waiting for button press
waiting for button press
waiting for button press
waiting for button press
waiting for button press

Seems like it does roughly the same thing no matter how I phrase the statement, so Im definitely doing something wrong for it to ignore it all the time.

I also get random firings of the voice recorder. Every now and then it will go through the "ok riders ...." recording. But nothing else happens, it just plays the recording, like there has been a trigger on the Playl pin.

Any help would be greatly appreciated,
Thank you for your time.

BMX Sketch.txt (6.16 KB)

userpicture
Buy
Download
Products
Learning
Forum
Support
Blog

userpicture

Arduino Forum

Using Arduino
Project Guidance
Preview - Re: Voice recorder with Arduino , probs with End of Message signal, subroutines. ( Re: Voice recorder with Arduino , probs with End of Message signal, subroutines. )
Unread Posts Updated Topics

Re: Voice recorder with Arduino , probs with End of Message signal, subroutines.

Preview - Re: Voice recorder with Arduino , probs with End of Message signal, subroutines.

The message has the following error or errors that must be corrected before continuing:
The message body was left empty.

Subject:
Message icon:

Attachments and other options

Topic Summary
Posted by RustyDemon9

  • Today at 12:07 pm

Quote

I am trying to build a BMX start gate using a voice recorder to play the Random Start sequence.

I am having trouble getting the program to run each subroutine separately. It seems that the program is not waiting at the appropriate time therefore it executes two routines concurrently.
As soon as I press the button, the beeps ( tone) starts as well as the voice recorder. The beeps should not start until the End of Message signal has been received back from the voice recorder. Im sure I have a fault in my WHILE statement.

Program as a BMX start gate.

Push Start Button
(Detect button push)
(Ensure only one button push)

Send signal to voice recorder to initiate recorded message.

Wait for End Of Message signal.

When EOM signal received, start random delay.

When random delay has ended,
Play tones.
At end of tones,
Operate relay.

I am using
Arduino Uno
Relay module ( no ID number on it)
Nuvoton ISD 1800 Series
Single Chip, Single message, voice record/playback device.

Data sheets here. (Sorry it doesn't seem to want to make a hyperlink, have to cut and paste)
(If link doesnt work please let me know.)

I have connected the Play L pin on the voice recorder to pin 4 of the Arduino and
LED pin ( EOM ) of recorder to pin A1 of the Arduino
To my understanding, the EOM signal should be a low so using an Analog input of Arduino to detect it.

I have included a bmp pic of the circuit. As attachment or link

Dropbox - File Deleted - Simplify your life BMX Start Gate1.png?dl=0

I have also included a short video showing that both events happen at the same time, when one event should proceed the other.

Dropbox - File Deleted - Simplify your life Arduino.mp4?dl=0

Sketch is in the attachment

Below is the result for when it plays the beeps and voice together. It appears to follow the program but somehow it is ignoring the WHILE statement or getting it too early.

Starting new Random Number Sequence
debounce val1_
0debounce val2_
0waiting for button press
waiting for button press
waiting for button press
waiting for button press
just testing here
00button pushed
playl high
led on
returned from debounce routine
move to subroutine get eom
just testing EOM here
eomState is 1023
voltage b4 is 5.00
waiting for low signal EOM
voltage aft is 15
eom sent. eom sent.eom sent.
random start subroutine getting delay time
The Random Number is = 2255
Back from random delay, now go play beeps
start beeps
finish beeps go back
debounce val1_
0debounce val2_
0waiting for button press
waiting for button press
waiting for button press
waiting for button press
waiting for button press

When I put this line in,
"while(analogRead(eomPin) !=0);"
this is the result below.
The voice recorder does its bit but that is all.

waiting for button press
waiting for button press
waiting for button press
just testing here
00button pushed
playl high
led on
returned from debounce routine
move to subroutine get eom
just testing EOM here
eomState is 1023
voltage b4 is 5.00

stops at this point.

The result if the line reads " while(analogRead(eomPin) ==1);"

waiting for button press
waiting for button press
waiting for button press
just testing here
00button pushed
playl high
led on
returned from debounce routine
move to subroutine get eom
just testing EOM here
eomState is 1023
voltage b4 is 5.00
waiting for low signal EOM
voltage aft is 15
eom sent. eom sent.eom sent.
random start subroutine getting delay time
The Random Number is = 1958
Back from random delay, now go play beeps
start beeps
finish beeps go back
debounce val1_
0debounce val2_
0waiting for button press
waiting for button press
waiting for button press
waiting for button press
waiting for button press

Seems like it does roughly the same thing no matter how I phrase the statement, so Im definitely doing something wrong for it to ignore it all the time.

I also get random firings of the voice recorder. Every now and then it will go through the "ok riders ...." recording. But nothing else happens, it just plays the recording, like there has been a trigger on the Playl pin.

Any help would be greatly appreciated,
Thank you for your time.

  • If this is all repeated, sorry, document didnt attach and had to do it again.

How did you achieve such garbled messages? Use Preview and correct your message until it contains just the wanted text. Keep your text short, in order to increase the chance that anybody will ever read it,

Dr,
It told me my docx didnt attach so I reattached the txt file instead. But it wouldnt let me upload until I had put a message in the message section. I could see that the main body of the post was there already, but I couldnt see anyway to upload the new attachment with out putting something in the message section.
My apologies to all for the duplication.

Been struggling with this problem for months now, held off posting for months too , trying to cover all the bases in regards to info supplied as per the sticky.

If you cannot describe your problem in a few words, I cannot help you :frowning:

Ok, no worries, thanks Dr,
Trying to get subroutines to operate consecutively.
At the moment two subroutines activate concurrently. Im not sure where the problem lies. Is it in my WHILE statement or elsewhere?
I am trying to use a WHILE statement to wait until a low analog signal comes back from the voice recorder ( End OF Message signal) to then trigger the next subroutine. But that subroutine is activated before I even get to the WHILE statement.

I have tried various ways to write the WHILE statement but none seem to make a difference.

I have monitor output for a couple of different WHILE statements, Sketch, Data sheet for voice recorder, and circuit diagram for my project should any of this be required.
Thanks