Hi I am a university student and I want to know if the following is possible through Arduino before i attempt it.
The device works in the following steps
- 1 fire sensor: checks to detect a flame, 10 secodn delay, then redetect
- 1 heat sensor detects a heat at specific temperature for 10 seconds
- if one of these sensors detects then a siren and lights go off
- it sends message to use that it has detected fire. Whether this is WiFi (esp8266- this seems good) or SMS
5, then it swithes on servo motor to do action
And finally to find out if such a setup could run on batteries?
Since you don't say how many of what battery or how long it must run, the battery answer is yes.
Put up constraints and maybe no. Part of engineering is arranging constraints away to get a yes.
To get the code running all the sensors "at the same time" and have outputs able to act at any time takes writing non-blocking code.
Once you learn to write that way (like an RTS as opposed to a turn-based game) and to NOT integrate the input code with the processing code and/or output code, life will get easier as you write, debug and keep code modules to put in loop().
In my signature space below are addresses to 3 Nick Gammon blogs that give exceptionally (please; that adjective is not just thrown in for cheap "effect") complete and clear tutorials that show to get you well started. Do I need to say that unless you mess with the code you won't really get it?
Background: Arduino is insanely fast compared to human and has no OS slowing it down. It's up to your code to NOT make it wait and then you can literally run hundreds of inputs and outputs so close to simultaneous you can only see "smooth".
Thanks for this help, I am new to arduino and I want to feel reassured that my idea can work.
So the arduino can deal with multiple sensors in and multiple out. So you use the non-blocking code to allow each sensor to run with diffferent commands or does this prevent the sensor from throttling the device. Currently the design has fire sensor and heat sensor as sensory inputs with led and servo as output with data logging and iot as tertiary level
For many-many inputs/outputs you may need to add components like shift registers to "multiply pins" using the Arduino SPI bus port to feed them (4 pins lets you add 100's.. literally), you may set up a 1-wire or 2-wire bus to use sensors available for those (lot of gas and fire sensors there) and still there's more ways to add-on.
You don't need 100's of I/O's. You can likely get by on just the pins you have but know that the chip is fast enough to drive 100x what you want at speeds your eyes can't possibly see the grain of.
So the arduino can deal with multiple sensors in and multiple out. So you use the non-blocking code ...
Have a look at Several Things at a Time and at Planning and Implementing a Program