Some gereral application concepts needed
T Chap
Posts: 4,223
While waiting on my first chips to get in, I have been digging through looking for ideas on implementing the code needed for my project.
Regarding timing issues, I couldn't find a clear answer on what is the best method to use for timing an input, and if it reaches (in my case) 4 seconds, do X. There was a simple example of RC use but that requires extra parts which are no big deal, but the idea of adding the micro is to lose as many parts as possible avoid part failures. Is there a preferred method to time an input and give an output over RC methods?
Secondly, lets say I have a device that is in 500 hundred hotel rooms, and I want to monitor such things as heat and smoke for example, and have the main system downstairs make decisions should there be heat and smoke: is there a typical method that the stamp can perform to monitor that many outputs at a time and subsequently identify the source?
Thanks
Regarding timing issues, I couldn't find a clear answer on what is the best method to use for timing an input, and if it reaches (in my case) 4 seconds, do X. There was a simple example of RC use but that requires extra parts which are no big deal, but the idea of adding the micro is to lose as many parts as possible avoid part failures. Is there a preferred method to time an input and give an output over RC methods?
Secondly, lets say I have a device that is in 500 hundred hotel rooms, and I want to monitor such things as heat and smoke for example, and have the main system downstairs make decisions should there be heat and smoke: is there a typical method that the stamp can perform to monitor that many outputs at a time and subsequently identify the source?
Thanks
Comments
2) Heat and smoke are dangerous and liability for system failure may be very high. You are going to need something simple and reliable (and inexpensive). Questions you need to answer first are: a) What kind of signalling is possible? Can you use existing wiring? If so, what? b) For reliability, you need something simple. Burglar alarms use a current loop and interruption signals that something has occurred. It's a pretty reliable method, but you can't easily tell where the problem is. It's also failsafe in that, if the current is interrupted, there's a problem. c) Another way to handle reliability is to have devices that are on a simple network and are actively polled. Although there are all kinds of potential noise problems, you might look into 1-Wire signalling. It's commonly used for thermostats in large office buildings, you can divide up the network into branches with "repeaters" and there are serial devices that do a lot of the protocols already for you.
(you may need a DS2480b interface chip to do this as I don't think the 1-Wire commands built into the BS2p/pe/px models are capable enough)
Combine this with a sweeping scan of all modules at a regular interval, and you should be all set.
(Just send the serial number of a unit, wait for the response, then do the next one. The limit here is really how many serial numbers you can store in your BS2 model, as each one takes 8Bytes)
Say, check 50 units, check for alarm condition, check another 50 units, check for alarm and so on...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Since the Master is constantly polling units, it may be difficult to use the same wire for response, because in the event of a real alram bit/word being sent back, there could be miscommunication unless using some duplex system(AC based sually right?). With two wires, one is always polling, the other is for response and real alarms only. In my reading so far I haven't seen applications for this many 1-wire hook ups, but it may be possible as you say with the right interface on each stamp.
For clarification, I am not in the business of installing fire or smoke alarms, but I am building those features into a product as another layer of redundancy for safety, as my product will certainly be scrutinized for safety issues in a hotel setting. I am clueless on implimenting a 1-wire or similar, although with the right consultant it should come together easily I suppose. I will however build the oem parts myself into the existing system, then probably hire someone to help with the programming to speed it up and experience a quicker curve.
**Side note related to micro use:
Does the program simply loop itself over and over top to bottom unless there is an event to deal with? In other words, if a code at the top of the program has to stop and deal with something (ie button pressed which requires it to stop and count, then act), is the code ay the bottom ignored until the top issue has been dealt with? If so then this affects other buttons pressed right? Just trying to grasp the concept f how it works internally.
Thanks
Is condition X true? If so, go do something
Is condition Y true? If so, go do something else
...
Go back to beginning to start checking again
Something:
Make something work
Go back to beginning to start checking again
Something else:
Make something different work
Go back to beginning to start checking again
...
You can make this much more complicated, keep the information about what to check and what to do in tables, build in timing stuff (like once something triggers, keep track of how long it's been triggered, and do something if its more than Z minutes), but this is the basic scheme. Understand this and you can move to more sophisticated versions as you get experience.
Regarding programming and embedded parts, if I am using all surface mounts parts, what is the best method for programming (and reprogramming after installing) the stamp? I may be wrong but I assume the eeprom is the only thing that gets programmed by the PC, and if it is surface mounted what methods (headers/connecdtors?) are there to program the surface chip, then update it after it is soldered in the system? If the system is installed, can it be reprogrammed via the internet with Pink?
BTW is there a forum or protocol for hiring help with programming stamps for my project?
Thanks again for the support
So, you might have a dedicated control processor for each floor monitoring the sensors for that floor, and a base processor that monitors the control processors.
For anything dealing with something as critical as fire and smoke, It might not be a bad idea to build redundancy into the system. For instance, you could have 2 control processors per floor, so that if one failed, the second would still be active.
Remote reprogramming in this situation might not be a good idea for safety reasons. If you need to change the program, have a technician swap a circuit board. Or, at a minimum, progam it on-site, so it can be verified, etc.
Parallax has a list of consultants on their website, if you are looking to hire somebody. If that doesn't work out, you can probably post in the Sandbox, or here.
If you are new to Stamps & programming, I suggest downloading the "What's a Microcontroller" manual, and the Basic Stamp Tutorial PowerPoint file. The PowerPoint goes into very good depth on programming concepts. The WaM book is on the WaM kit page, and the BS2 tutorial is on the Educational Downloads page. You can download a PowerPoint viewer from Microsoft.
Also, if you want to get some hands-on with the BS2, check out the Summer Special Kit on the Parallax site. It is the WaM kit with a HomeWork board. It's an excellent bargain.
Lastly, I haven't used this company's products, but might purchase a few for a proof-of-concept, but they manufacture gas sensors, such as CO. It might be useful for your project. Here's the link:
www.figarosensor.com/
In creating your own system, you·spend more·for extra wires and sensors.· Also, central fire systems are UL rated and fire code approved, something you may not be able to obtain for your product.· Since this is a life safety issue, I would tend to leave the fire monitoring to an approved, properly installed system.
·Trying to help!