Hi all,
I've never touched Arduino but am looking for a fridge door alarm.
Have found a possible solution online which is in the attached pdf.
However before I jump in and get all the components I have a question:
-Is it possible to connect multiple door sensors to 1 arduino?
I have 4 double door fridges, so hopefully I don't need 8 systems?
Thanks for your help.
Regards,
Hein
edit: I get error messages when trying to attach pdf file. The instructions I found are here Fridge Door Alarm | Jaycar Electronics
The project appears to use a reed switch to detect the door opening. Each such switch only requires 1 Arduino digital pin so, yes, you could connect as many as you have digital pins on the Arduino, but beware of long cable runs to the Arduino. How far apart are the fridges ?
2 fridges are next to each other, another one is about 4-5 meters away.
The last one is a lot further in another room so will probably required it's own system?
The last one is a lot further in another room so will probably required it's own system?
That would seem to be sensible
Do you really need an LCD screen ?
The buzzer could work very well in alerting you to a fridge door that had been open longer than reasonable
I don't think I need a LCD screen, but as I have no experience this seemed like a straight up solution to follow 
Just not sure how connecting more reed switches would change the programming?
more reed switches + more programing = a change in programing, no?
This is a beginners level project.
off/on switches are simple to use and straight forward.
indicator LED's buzzers, a local display, Even a local display of temperature for each fridge.
Get the first ones working, then test the wire length. an LED uses current, not voltage and current signals can go pretty far. once you get to that point, you might be comfortabel enough to add an opto-isolator to the board for that signal. a bit more sensitivity than the other pins.
The IDE has some switch examples. get the sensors you want, connect to your choice of micro-controller and you will find it is rather simple.
I would suggest the DS18B20 with a little can and wire on it. there are lots of holes in the fridge, ice maker, water, wires, etc that you can use. just use the low temperature putty to seal them.
Just not sure how connecting more reed switches would change the programming?
The obvious, but dumb way to do it, is to duplicate the same code for each pin read and reaction
A better way is to put the common code in a function and to call that with a pin number parameter so that the code is not duplicated in the sketch
An extension of that is to put the sensor pin numbers in an array and to iterate through the array calling the function
Thanks for all the help so far, I've ordered the parts and will see how it goes.
If you need more help then please add to this topic so that it can be seen in context
Please follow the advice on posting a programming question given in Read this before posting a programming question
In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless
You could go the easy way, and connect the 8 door switches in serial.
Switching to 0V with a decent pull-up will probably avoid issues with length & noise.
If any door is open for longer than the preset time, a single alarm buzzer will go off.
Yes you could monitor all the doors separately, but is there really a need ?
I built a commercial version of what you want a few years ago, monitoring four cool rooms with a stack of extra features - including thermistors for temp monitoring... (put them on the compressors to warn if they’re running too hot).
Heartbeat monitoring, temp thresholds, alarm delays and other features were set with one LED and two push buttons). If the need arose, they could be stacked for more than 4 inputs. [PIC16F84]
lastchancename:
You could go the easy way, and connect the 8 door switches in serial.
Switching to 0V with a decent pull-up will probably avoid issues with length & noise.
The easy way sounds good and easier for me, as it doesn't matter which door is open.
What does 'Switching to 0V with a decent pull-up' mean?
It means you should wire your switches in series, with the pinmode set to INPUT_PULLUP with (around 15k) internal pull-up, but you could need to add maybe another 10k outside the chip to provide a stronger +V pull-up voltage/current.
The farthest switch in the string of switches is tied to the common 0V, so that when all the switches are ‘closed’ the input pin will read LOW, but if any switch in the chain of switches goes ‘open’, the input pin will be ‘pulled-up’ to +V by that resistor .
Thanks, I hope all this makes more sense to me when I get started!
In an intruder alarm system, The switch loop is pulled high. The switches are set to normally closed (NC), thereby passing the signal to the next switch in line. Upon any break in the circuit, a cut wire, or a switch opening, etc, The alarm goes off.
I personally like to know which thing failed. Not just that there was a failure. The so called idiot light in a car tells you of a problem, but not THE problem.
with 4 devices, any Arduino can monitor each on one pin. 4 pins.
As a first project, you will have fun learning and doing.
Certainly agree, in this case with the limited previous experience, the OP may be better off starting simple. The N/C chain of switches as described will work as intended, and in a damp/corrosive environment like refrigeration can help with the corrosion.
They should be decent IP-rated or perhaps N/C magnetic reed switches for reliability.
These fridge doors are nearby each other, but as you say, extra wiring could be added if needed to alarm each door separately.
In my earlier system mentioned, the individual pull-ups at each door wire were augmented by LED bulkhead indicators (a ring as the local pull-ups) in the hallway to identify which N/O door switch was left open - without any special extra wiring - but of course I had multiple inputs, and a single remote buzzer to alert for any wiring/switch problem or any door being ajar.
since this is a first project, my thoughts are to get a proto board and some duPont wires.
you can get switches or use the wires as a means to make or break a circuit.
some 1k resistors. and some LEDs.
[you can use use some wires without all the fancy aids]
using the example in the IDE of 2. digital/button
wire from 5v to a resistor, then to another wire or to a any type of switch (button) to pin 2 as in the example
when you lift the wire, or press the button, a change will occur and the on-board LED will change state.
playing with the Arduino will give you some experience and you will find it becomes easier as you play with it.
as a comment, I think I can speak for the vast majority of the people on here in this regard. Once you get one thing to work, you want to add something to it. some sort of change, improvement, refinement or something. Some us take that to extreems, others to get the result 'just right'
There is an old saying that if it is working, you have not added enough features.
dave-in-nj:
(...)
as a comment, I think I can speak for the vast majority of the people on here in this regard. Once you get one thing to work, you want to add something to it. some sort of change, improvement, refinement or something. Some us take that to extreems, others to get the result 'just right'
There is an old saying that if it is working, you have not added enough features.
Spot on. Thanks for the laugh over that last line.
I'll give the Arduino a try. If it works well and I can find my way around the system it would be great to add temperature monitoring/alarm to it later on.
Very doable. Get one thing working, add the next. Have fun!