Ideas for "panic" alarm indicators

elec_mech

Joined Nov 12, 2008
1,500
Sorry, I'm a bit lost. Can you post an updated schematic of what the circuit looks like now as well as the code you're using? If it is too big to fit the text, then simply save the PICAXE file and add .txt after the .bas and post as an attachment.

How are you coding the reset function in the code? Or are you using my code? If you're trying to reset the program altogether, you'll have to remove power to the PICAXE. Some of the more expensive PICAXE's have a dedicated reset pin, but the one you're using doesn't. You could simply wire a N.C. switch inline with either the 24VDC supply or the 5VDC line. If you do this, put the switch on the + lead, not the GND lead.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Sorry for the confusion. Hope this pathetic diagram and upload come through and are visible.
Basically I have just added the new optocoupler ISP845X with it's 80ma output capability by taking the 3, MP3 output lines and beacon output line from U3 and connecting
them to the 4 input channels of the new device. I used a 150 ohm series resistor to 5vdc for the internal LEDs.
The outputs of each channel connect directly to the 4 device lines. (MP3 leads and beacon black with the beacon red to +24vdc)

I'm sorry I forgot that you would have to write it in the code for the reset button to work... I think? Sooo that is why nothing would happen
when I would press the Reset button.

I have not written any code other than setting all devices to be ON for full time... just to give everything a test with continuous current draw.
I do feel fair amount of heat with finger touch on my new IC and the preceding one. I actually let it be on for about 30 continuous hours and it
did not fail (didn't have the audio on for obvious reasons). Still concerned a bit about the 60 ma of the beacon.

If I were to single it out of the mix of connections on my newest IC, how would I connect that power FET you mentioned (which I ordered)
so that I would know the most likely device to cause trouble would have a better current handling part.

I am quite confused when looking at the code you have written and really don't understand it so when I try installing that, I will need your
help and for any debugging.

Thanks and let me know if you need more clarification.
 

Attachments

Thread Starter

izon

Joined Mar 17, 2013
217
Just a quick update. I really didn't feel like I knew what I was doing but managed to stubble around till I got your
entire program code downloaded to the product!

There may need to be some refinements ... but IT WORKS !!!
Each button LED comes on and the proper channel of audio (so far just sample tones until programmed) plays
upon pressing the "test" button for each of the 3 inputs. And the Reset button works properly as well.

Right now I would like, if you feel it is the best idea, to try and install a power MOSFET to handle the current
of just the beacon light (which draws 60ma).

Also, if you would be so kind, could you redraw the schematic with your professional look (once the MOSFET
is proven to work) so there will be an accurate and complete one for future reference.... YES!

Hope to hear back soon and compliments on your writing of the code!!
 

Thread Starter

izon

Joined Mar 17, 2013
217
I've installed the BS270 MOSFET with source to ground, gate to pin 15 on the PICAXE
and drain to negative of beacon light. So new schematic should show no connection to the
darlington driver from pin 15. Hope that is clear.

After running the beacon steady for half hour or more, the chips are cool to touch as well as the power MOSFET.
So I think all is well to this point so will have to spend some time on the MP 3 player and learn to make some files with sounds and voice messages. Thanks for now.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Finally back with near completion of project ! Everything seems to be working correctly now with my LED Beacon light, the button lights and the audio alarm sound and message from the MP3 player.

One condition needs a bit of attention. When a test button is pressed (or the real alarm button), the lights behave properly and the MP3 message comes through fine. However, the MP3 message does not shut off... it continues to repeat. I am told by the tech rep of the company that the closed circuit that takes place from the programming code for each of the 3 MP3 channels needs to be opened after 2-3 seconds.
That way the message will play through once only and then will stop (as desired).

To say it another way, the "on" signal given to the MP3 channel from U5 needs to be only 2-3 seconds and then turn off. This applies to each of the 3 channels.

The beacon light and pushbutton test switch light will continue to operate until someone presses the Cancel / Reset button. Then everything will be back to idle until another event or use of the test button.

So... If you've followed my description, I would like to have you update the program code to cause the unit to behave as described. Then I would download it and rewrite it into the micro and hopefully that will be the final step. Then I need to install the project and remote panic
buttons and try it out in the real world !

Again, thanks ElectroMech for your awesome help, support and patience....If I get a chance maybe I should try to post a short video of the
finished project.... do I do so on this thread or is it supposed to go elsewhere on the forum?

Best regards
 

Thread Starter

izon

Joined Mar 17, 2013
217
Thanks...
I've haven't tried installing the revised code because I'm not totally clear on what you said are the options. Let me number the sequence of
events and see if that is what you are saying: (after panic button is triggered) (first scenario)

1. Beacon LEDs and switch LED come on immediately
2. MP3 player comes on immediately
3. LEDs have been on for 2.5 seconds at which time MP3 channel is turned off... MP3 continues to play one time through it's message
(message length approx. 27 seconds)
4. LEDs continue until Reset/ Cancel is pressed ... lights are now off and system is ready for another activation
Comment: This is exactly the way I would like it to behave....I may be missing something but on this option I don't see any delays
In glancing at your code (and I don't understand it much at all .. my shortcoming), it almost appears that you are saying the LEDs would be turning off without the reset being pressed which is NOT what I want this to do.

(from code)
LOW LEDM ' Turn off LED module
LOW LED1 ' Turn off LED1
----------------------------------------------------------------------------------------------------------------------------------------------
A simpler method would be to turn on the MP3 channel for a fraction of a second then turn off before starting the LED blinking routine, but I don't know how critical that 2-3 seconds is. (a quote)

I guess I don't know what 2-3 second delay you are referring to in the above statement. Here is the sequence I'm assuming you meant:
(and I don't see why both LEDs and MP3 player can't be turned on simultaneously... ?)

1. Turn on the MP3 for fraction of a second ( Guess I would think one full second would be safer)
2. Turn off MP3 player after fraction of a second (player continues to play through it's message one time)
3. Turn on LEDs and allow them to continue until Reset/Cancel is pressed at which time the routine stops ready for a new activation.

Comment: It appears that you are saying the MP3 would start a fraction of a second prior to the LEDs coming on and sound would play through to it's completion while the LEDs continue on until Reset/Cancel is pressed.

It seems to me the net result would be basically the same in both scenarios.... a fraction of a second is not problem for the sound or lights to
come on but 2-3 delay in the audio would not be desirable.

Sorry to be overly detailed but please straighten me out on the two scenarios and on the code looking as if the LEDs are going to be turned off by the code sequence (should only be when chosen to stop via the Reset/Cancel button.

Again, thank you!
 

elec_mech

Joined Nov 12, 2008
1,500
I've haven't tried installing the revised code because I'm not totally clear on what you said are the options. Let me number the sequence of
events and see if that is what you are saying: (after panic button is triggered) (first scenario)

1. Beacon LEDs and switch LED come on immediately
2. MP3 player comes on immediately
3. LEDs have been on for 2.5 seconds at which time MP3 channel is turned off... MP3 continues to play one time through it's message
(message length approx. 27 seconds)
4. LEDs continue until Reset/ Cancel is pressed ... lights are now off and system is ready for another activation
Comment: This is exactly the way I would like it to behave..
Yes, this is how it should function - normally I like to test this, but I don't have the hardware, so I'll need you to test and report back.

..I may be missing something but on this option I don't see any delays
??? Do you mean the potentiometer to adjust the blink rate? It's in the start of each Sigx_Trip routine.

In glancing at your code (and I don't understand it much at all .. my shortcoming), it almost appears that you are saying the LEDs would be turning off without the reset being pressed which is NOT what I want this to do.

(from code)
LOW LEDM ' Turn off LED module
LOW LED1 ' Turn off LED1
No, as I understood it, you wanted the LEDs to blink on and off to better alert the user. The commands you are referring to turn off the LEDs, wait a spell (based on the position of the potentiometer), turn on the LEDs, wait a spell and repeat until the reset button is pressed.

I guess I don't know what 2-3 second delay you are referring to in the above statement.
You stated:

To say it another way, the "on" signal given to the MP3 channel from U5 needs to be only 2-3 seconds and then turn off. This applies to each of the 3 channels.
I took that to mean 2 seconds minimum, 3 seconds maximum, hence 2.5 seconds.

Comment: It appears that you are saying the MP3 would start a fraction of a second prior to the LEDs coming on and sound would play through to it's completion while the LEDs continue on until Reset/Cancel is pressed.
This would make the code simpler.

It seems to me the net result would be basically the same in both scenarios.... a fraction of a second is not problem for the sound or lights to
come on but 2-3 delay in the audio would not be desirable.
Either way should result in the same outcome.

Sorry to be overly detailed but please straighten me out on the two scenarios and on the code looking as if the LEDs are going to be turned off by the code sequence (should only be when chosen to stop via the Reset/Cancel button.
You're new to code - the only way to learn is to ask questions, so no worries. Again, the off you're seeing is to allow the LEDs to blink. Notice that if the reset button isn't pressed, the code loops and the LEDs are turned on again. If you don't want to blink the LEDs, let me know and I can simplify further.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Thanks very much for the detailed reply. I probably won't be as thorough as you but I now understand what your code meant about LEDs on and off.
Didn't know it pertained to their flashing rate. BTW the pot worked fine to adjust that and I have left it to where the lights blink about twice
a second or so... very noticeable for those that need to be aware.

Sorry if this is repetitious but for the main functions, what I need is for both the LEDs and the MP3 player to come on at the same time (approximately within a second or two of each other if there is to be any delay). Then the player will play it's (approx. 20 seconds) message
one time through and stop while the LEDs continue until Reset is pressed. When doing a test and the player is still playing, reset/cancel should stop everything.

That is how it has been working prior to my trying to "improve" on that... got an idea from the manual on the MP3 player that it has different
modes. The normal is the way it has been used but, say for example, the panic button had been pressed in one room and prior to the message playback being completed, the "activity" has quickly moved to one of the other locations. (same floor only a few doors apart). Then if a second location button is pressed, the first message will be interrupted with the new message so they will know the suspect or suspects may be moving from one room to another. When the second message has finished, then the MP3 player would stop but lights still blinking and newest location's test button light would still be blinking until reset.

Well in talking with the tech fellow from the MP3 player (Patlite USA.. product BSV). He sent me to http://www.patlite.com/product/detail0000000199.html where you download the main manual in PDF and check out pages 15-21. Mainly on
page 21 it shows how to change modes by including a text file in the SD card. Well I've got it rather screwed up now where the cancel button
will only shut off the lights but not the MP3 player !!! I've tried getting it back to default (A) by using MODE-A.txt and then loading the card
into the player but it makes no change... continues to work in the messed up manner of not being able to shut off the MP3 player with the
cancel button.
The way I understand it is to just open MS Word and put nothing on the page but save it as "MODE-A.txt" but as I say it makes no difference.
If I were to get it back to default, I assume it would be a lot of work in code to make it behave this way where a second location pressing their button before the first one is cancelled would start the new message.

Your thoughts please and sorry if I missed a response to one of your questions.
Can you think of any reason the MP3 player will now not shut off after pressing reset?
 

elec_mech

Joined Nov 12, 2008
1,500
I think the missing piece of the puzzle, at least for me, is that now you state the need to trigger an alarm while another is going. This changes things and adds complexity. Not impossible, but more work. Since you didn't say otherwise, I'd assumed that only one alarm would be triggered and going at any one time. If time allows, I'll see what I can do.

Regarding the MP3 module, look at page 24 in the manual. There is a sequence of events on loading files and feedback when the files have be accepted. Since you may need to play a file while another is already playing, I suggest using mode B(Bit/Bit Input/Input Priority Playback Mode). Look at pages 15 & 18. Otherwise, the first file to play will play until the end and ignore other inputs. Mode B does two things. First, it will interrupt whatever is playing and play the newest selected channel (once the code is corrected). Second, it will play a selected channel only once no matter how long the channel is held high.

I haven't looked in detail, but I'm not sure there is a stop or cancel function in the MP3 player. You'll want to look at the manual in detail or contact tech support. As I understand it, if a file is played and the user presses the reset button before the file is finished, the file will continue to play until the end regardless of what we do to the code - unless you can find a dedicated stop input.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Please hold off with any programming or circuit changes. I've been talking with tech support and we are trying to
sort through Mode changes A-D to see exactly how each behaves when I try them with changing the .txt file.
I don't think it will be necessary to have the system acknowledge a second alarm button while playing the first.
I know we never talked about that possibility before but it came up just a few posts back so wanted to see whether
it was practical or even necessary.

I'm reviewing the material on page 24. We are in bit mode from the beginning. As I say, we are going to retry all
4 playback modes to see exactly how they behave and hopefully correspond to the manual description.

Regarding the cancel button. I could swear that in the early steps of all this, it would stop playing the sound when
pressing cancel. I could be wrong... maybe confusing with when first trying it, I only had lights being connected then.

As you say, the MP3 unit is probably designed to always play through once completely regardless of it's trigger status
or that cancel button.

I just tested the unit in the "A" mode and found that upon hitting the "test" button, it will run the lights and the audio
will continue to play over and over unless cancel is pressed. I thought the MP3 would run once and quit.
If you hit cancel during the time lights are on, the lights will go out.

Out of curiosity, I monitored the "trigger" line to Channel 1 of the MP3. When idle, there is about 22-24 volts on that
line (blue wire). When hitting the test button, it drops to near zero as you would expect... except... it continues
playing and playing while the line stays low (ie grounded) so there is a continuing trigger signal present or it
wouldn't continue to stay low, correct?

So how can that go low and stay low ... wouldn't the code have to be incorrect?
Much more to check and verify so please don't go ahead with any rewrite or changes
till we have a better handle on the matter.

BTW...exactly what sequence of events happens with the cancel button being pressed?

Thanks much for your help and time!
 

elec_mech

Joined Nov 12, 2008
1,500
The last code I posted *should* work with mode A. That is, the MP3 line is pulled low for about 2.5 - 5 seconds (timing always takes a little longer in a PICAXE), then it should go high all the while the LED's are flashing. The second to last code keeps the MP3 line pulled low which will cause the file to repeat indefinitely in mode A until reset is pressed (and the file gets to the end). If you change the MP3 module to mode B, the file will play once no matter how long the MP3 line is pulled low.
 

Thread Starter

izon

Joined Mar 17, 2013
217
]
Golly... sure appreciate your taking the time to read that manual and understand some of the things I've found
troublesome... still working on testing modes but in regard to part of your above statements. (apologize for not
getting the hang of the quote function).

The second to last code keeps the MP3 line pulled low which
I assume you mean the second to last "set of code" and not the second to last line of code from one of the sets.
Saying that it would keep the message repeating explains a lot since that is what I've witnessed... one less thing
to ponder about.

Would you mind pinpointing that page where your last code set was sent to me? I have not downloaded it yet.
I assume it is post #107. Will get back after finishing with mode testing and trying to load your latest code set.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Right back... I'm not going to change your code set to the last one just yet. I wanted to tell you in that code set, how each MODE of the mp3 player behaves: (I see why the playback repeats in some modes as you indicated line is being held low via current code)

MODE A (1)
Playback of MP3 repeats over and over if reset is not hit.
Reset kills LEDs immediately but sound continues through current cycle, then stops
Pushing a second button during current alarm has no effect.

MODE B (2)
Playback of MP3 repeats over and over if reset is not hit.
Reset kills LEDs immediately but sound continues through current cycle, then stops
Pushing a second button during current alarm has no effect.

MODE C (3)
Playback of MP3 repeats over and over if reset is not hit.
Reset kills LEDs and sound instantly !! Sound does not continue though current cycle.
Pushing second button during current alarm has no effect.

MODE D (4)
Plays MP3 message ONCE through then stops
Lights LEDs remain on until reset is pressed
Pushing second button during current alarm has no effect.

Sooo you can see that a number of things don't behave according to the manual for each mode
but I'm sure some or all may pertain to what the code is saying.

Guess I'm wondering now whether I should put in your latest code at this point or will it need any
change before installing it. Do the mode results make sense in light of what code is saying?

Thanks again... I was pleased to see that in one mode, the sound will shut off instantly.

"Their" first choice was to have MP3 and LEDs to come on together, reset would cut the sound and a second reset would kill LEDs.

However I guess I would accept the LEDs to come on immediately, the sound to come on immediately and play through once in-spite of hitting reset. And then the lights to go off with reset button.

An alternate would be to have the LEDs to come on immediately with the sound and both shut off with reset (even if message hadn't completed yet)

Let me know what may be possible without greatly complicating things and I will reply.

To summarize:
1 Do you want me to replace the code now with that on reply #107
2. Will that give a lot different result on the MODE behavior I've observed?
3. Will you want me to confirm any MODE behavior with the new code to
see if it will behave as desired (for sure)
4. Check back with suggestions before proceeding so I don't put you through more than necessary.

Thanks !NOTE: MODE A and MODE B seem to behave the same at this point.
 

Thread Starter

izon

Joined Mar 17, 2013
217
I've done endless tests. Tried your code from message 107 and the one from message 116. With each I tried
all four MODEs of the MP3 player. Results varied from the audio playing only a couple seconds to running
continuously. In other cases the sound would continue through one cycle unaffected by reset but then at least
the reset would kill the LEDs in every case.
Finally decided for now to be satisfied with using your 107 code version and Mode D. Gives the sound through
one time regardless of hitting reset and then lights all go out with reset.

Guess that is about all we can get since it's not practical to kill the sound with one RESET and the lights with a
second RESET.... will check back later on...let me know you thoughts.

Thanks so much!
 

elec_mech

Joined Nov 12, 2008
1,500
Hmm, you could control the power to the MP3 module through the ULN2003 (pin 11) and use the PICAXE to turn the MP3 module on and off. We could configure the code to keep the MP3 powered at all times except when reset is pressed - then we cut power to the MP3 module for a second to kill the sound then re-apply power waiting for the next signal. They will be some trial and error, but it's a possibility. You could test this first by removing power when a file is playing then quickly re-applying power to make sure this kills the sound.
 

elec_mech

Joined Nov 12, 2008
1,500
Everything would work as it is now. If we implement my suggestion from post #118 and the MP3 module is in the middle of playing something when reset is pressed, power is cut to the MP3 module turning off the sound with the lights. In other words, the user doesn't have to wait for the music file to finish playing if they hit the reset button quickly.
 
Top