REED SENSORS WITH RELAY (Weird problem)

Hello everyone i will be quick,im prototyping some home automation for door alarm,what i mean... I got 3 Reed sensors,every time a sensor get LOW; i want a siren to get in,so i coded everythink,its working but....when i pull the one magnet from the reed sensor (NO sensor) the light on my siren relay goes high but the coil is not energized,when i pull the second reed magnet off,the light on the relay indicator goes a little brighter but still the coil wont energyzed,and finaly when im putting all the magnets off the reed sensors,only then the coil is energyzed,seem like a power failure? im useing a breadoboard setup with insta usb power supply from a laptop,remember every time i pull a magnet from a reed sensor the power goes up on the relaybut it seems its not enough to energyze the coil...

Firstly, try writing your post so we do not have to read it 3 times to work out what you are doing. Use capital letters and spaces where normal English requires them. This means we can read it.

Secondly, supply us with a circuit, hand drawn and photographed is ok. Also supply the code and links to parts you are using or a clear photo of the layout.

Once we know what you have, we may be able to assist.

Weedpharma

At last the problem was on the sketch and i donnt know why....my first sketch loop was like this

if (switch1 == LOW) { digitalWrite(siren, HIGH)

} else { digitalWrite(siren, LOW) }

if (switch2 == LOW) { digitalWrite(siren, HIGH)

} else { digitalWrite(siren, LOW) }

if (switch3 == LOW) { digitalWrite(siren, HIGH)

} else { digitalWrite(siren, LOW) }

With this code i had an output voltage on my digital pin set to 4 volts, when the three switches where all low, if i had one switch low and the others where high i had 1 volt output from my digital output...so my relay wont energized...( i have a clean power suply of 5 v. 1,5 amps on my chip)

But then after i tryed literally everythink i thought to use this code.

if (switch1 == LOW || switch2 == LOW || switch3 == LOW) { digitalWrite(siren, HIGH)

} else { digitalWrite(siren, LOW) } Then all worked fine...i had a clean 5 volt signal from all my switches...but i post that with the hope you have an explanation for this...i dont even know how the code might split the voltages......thank you for your time and sorry for my english :D

Please put your code in its own window as seen in other posts. This can be done by placing     [code]  and [/code]  around the code or use the </> icon. This makes it easier for others to read.

How to use this forum

Put ALL of the program in the post, not just parts of it. Please post the original program that was not working.

Weedpharma

You should get some NPN transistors and 1k resistors to use them on the power hungry relays and also add a reverse current protection diode (like 1n4009 or similar) for the arduino protection. Look at the attached image where i posted the schematics i found on the internet.

Cheers, :slight_smile:
Leon

00Akl.jpg