Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:14 16 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Workshop siren

Author Message
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5118
Posted: 03:34pm 22 Nov 2015
Copy link to clipboard 
Print this post

This is a project I put together for a customer. They needed a workshop siren, something that could be programmed, to sound a siren for a few seconds at preset times.

I based it on a Colour Maximite from Circuit Gizmos ( thanks CG ), because it had the build in real time clock and the "sea of holes" for the extra circuitry. The board was fitted into a plastic case from Jaycar, with the VGA, PS2 and Power connectors on one side, and access to the SD card on the other.

The actual siren device the customer wanted to use was a unknown, so to make it easier, I used a Arlec wireless power outlet, from Bunnings, about $13. See this thread that goes into it in more detail. This way the customer could just plug a 240v powered siren, light, etc, into the power outlet, and not need a electrician to wire it up for them. Plus it means I dont need to touch any 240v wiring myself, with is illegal unless you have a license. While this sort of 240 circuitry is easy to do, the implications of a mistake could lead to jail time, its just not worth the risk.

The Arlec remote power board came with a wireless remote control unit. The remote control runs off 3v, and has proper push button switches, which means I could use the Maximites 3v supply to power it, and simple opto couplers to act as the swtches. The remote draws about 9ma when transmitting, well within the Maximites 3v supply capabilities. The opto-couplers inputs are driven by 220r resistors from Maximite outputs 1 and 2, and the opto's output directly across the switch terminals on the remote control circuit board. Needed to check the polarity across each switch, as the outocouplers I used were transistor output so would only pass current in one direction.

The remote control circuit board fits over the Maximite, held up with a few short lengths of copper wire. The opto-couplers are hidden underneath.





The remote has a ON switch, and a OFF switch. So to sound the siren for a few seconds, the code operates the ON switch ( optocoupler ) for half a second, waits a couple of seconds, then operates the other switch to turn off the siren.

The software is not well written, bit old school, but it works. The main screen displays the time and date. Hitting any key brings up a menu, where you can set the current time and date, time offset, siren times, holidays and a test function. If any of the screens are left open for too long, the watchdog resets the chip and the program restarts.

Setting the current time and date is obvious. You can also set up a few dates that you dont want the siren to sound. Used for public holidays.

There are 20 siren time slots per day, and you can have different times for different days. The siren duration can be set from 1 to 5 seconds.

The time offset screen lets you change a value from -999 to 999, in milliseconds, that is applied to the clock just after midnight. This happens 15 seconds after midnight, as at midnight on the dot the siren needs to sound, so didn't want to clash with that event. At 10 seconds after midnight the software reloads the main screen to update the displayed date, etc.

There are 3 software functions. One is to get the week day, which I found posted on the forum here somewhere ( thanks ). There is also a CheckTime function, to make sure a valid time was entered by the user. And a CheckDate function, again to check for a valid date entry. Its a bit simple, and wont understand leap years, so if you enter the date on Feb 29 on a leap year, its going to reject the date. One chance in 1461 that's going to happen.







As I speak the unit is on its way to the customer, fingers crossed it behaves itself. I did make the SD card easy to access, so updates wont be a problem.

Glenn

Edit. Oops, forgot to include the code.
2015-11-23_013740_Siren.zip Edited by Gizmo 2015-11-24
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2934
Posted: 04:03pm 22 Nov 2015
Copy link to clipboard 
Print this post

Hi Glenn,

A nicely written overview of a project you have mentioned in several posts along the way.

Out of interest, is that an ABS enclosure or a metal enclosure? The reason for asking is to highlight that a metal enclosure will have an impact on RF range. Guess you probably know that anyway, but just in case. . . . .

Hope your customer is happy! Let us know how it goes assuming you get feedback from them!

WW

EDIT - just re-read your post and saw your mentioned a plastic case Edited by WhiteWizzard 2015-11-24
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 04:38pm 22 Nov 2015
Copy link to clipboard 
Print this post

That's a very neat job Glenn. I noticed that Rockby here in Melbourne have a similar remote control but with three remote mains outlets available on their specials this week for $27.

There's download to the Tech Manual for these which also has the matrix info on the DOSS website.



3 Mains Outlet Remote Controller
Stock No:38318
Remotely switch your mains on or off. The package comes with three outlets allow you to control up to three different devices.
Maximum range: 30m in open area
Radio frequency: 433.92 MHz
Max Power: 2500W (10A)
Manufacturer:DOSS


GregEdited by paceman 2015-11-24
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 05:10am 23 Nov 2015
Copy link to clipboard 
Print this post

That looks great!

Nice to see the MAXImite used and specifically my CGCOLORMAX. I think that as a controller that needs to display information on a large screen it is still great to have the Maximites. I have one that has been put to work displaying information on a 30" TV so that the information can be seen across a room.

Thanks for this write up!

Micromites and Maximites! - Beginning Maximite
 
skylight
Newbie

Joined: 10/01/2016
Location: United Kingdom
Posts: 23
Posted: 12:50am 10 Jan 2016
Copy link to clipboard 
Print this post

Being new to the wonderful world of micromites I tried running this code on a CGCOLORMAX2 MMBasic ver 4.5 but after partially writing the screen with the time I get an out of memory error on line 140.
I copied all the files to an SD card in drive b and ran the autorun.bas file from there, would running this program from drive b instead of the internal drive be causing this problem?
Being away from the COLORMAX since, I've not had a chance to test.
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 01:14am 10 Jan 2016
Copy link to clipboard 
Print this post

skylight,

From a previous post, check that line 140 is not more than 255 characters long - that can cause an out of memory error display. From the command line, enter the command "memory". If that looks OK, check for a long line.

panky

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
skylight
Newbie

Joined: 10/01/2016
Location: United Kingdom
Posts: 23
Posted: 01:24am 10 Jan 2016
Copy link to clipboard 
Print this post

cheers i'll try that
 
skylight
Newbie

Joined: 10/01/2016
Location: United Kingdom
Posts: 23
Posted: 02:15am 08 Feb 2016
Copy link to clipboard 
Print this post

After a long break I'm back at the maximite and am still having memory problems
one edit to my above post is that its a colour maximite running MM version 4.4 not 4.5 as I put earlier.

I checked the offending line 40 and it is well within 255 characters

typing memory I get

9kb (30%) Program (372 lines)
18kb (50%) 19 Variables
3kb (10%) General
1 kb (2%) free

The thing is these are Gizmos files from his zip above and I am using the exact same CG colour maximite he is so am a bit confused as to why the program works on his but not mine?

After issuing a new command and then memory again I get:

0kb (0%) Program (0 lines)
0 kb (0%) 0 Variables
0kb (0%) General
31 kb (100%) Free

Is this the standard mmemory available?Edited by skylight 2016-02-09
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 02:36am 08 Feb 2016
Copy link to clipboard 
Print this post

At the least post the line but better the whole program.

You can split pretty much any line but it's a lot simpler for people to suggest where/how if you post the code.

John
 
skylight
Newbie

Joined: 10/01/2016
Location: United Kingdom
Posts: 23
Posted: 02:44am 08 Feb 2016
Copy link to clipboard 
Print this post

Hi John,
Reason I havn't posted the code is its quite big but also it is exactly what Gizmo put in his zip file above so its might be better if someone with the same setup tried the above zip?
Maybe he posted a previous work in progress file and not the completed working file?

Its either that or I might have a faulty Maximite?Edited by skylight 2016-02-09
 
skylight
Newbie

Joined: 10/01/2016
Location: United Kingdom
Posts: 23
Posted: 03:24am 08 Feb 2016
Copy link to clipboard 
Print this post

I think i've got it working, it was using mode 3 I changed the mode from 3 to 1 in the listing to conserve memory and it seems to work well in monochrome mode.

This still doesn't answer why Gizmo can run his in mode 3 in colour but I cant?
unless he added extra memory?

Just found I can get a limited colour running in mode 2 ok without memory problems.Edited by skylight 2016-02-09
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025