Hi,
Tried to find good examples but got stuck, please help.
I connected according to attached drawing, and it works fine if I run it with USB power. But when I connect 12V battery board crash or get destroyed... where do I think wrong?
Setup
Board:
Arduino MKR 1400 GSM, plug in from a 12V battery using a converter to 3.3V got destroyed..
replaced with a Arduino Uno Wifi R2 powered with 12V using the 5,5mm plug - got destroyed*
Shield: Arduino 4 relay shield controlling a 12V Solenoid
*) Problem:
With destroyed the board I meant following..
Running without PIR and LED workes without problem.
But once I connect PIR and LED power it from the board MKR 1400GSM board was stopped working after a few minutes. Once I restarted it worked for 3-4 min then stopped running the code and flashing the red led on the board.
When I changed to the Uno Wifi R2 board, it also worked fine until I connected the LED and the PIR, then it did only run setup() loop and refused to run the loop() in the code. And afterwards disconnectiong everyting that specific board still does not run loop() part of the code.
Looks like you are powering the relays from the 5v pin ... that won’t do the internal regulator a lot of good ! You should power the relays via their own power supply . If you kill a board , it’s worth investigating why it failed before going forward .
Power dissipated =(12-5)^2* ( relay current)
You can feed it with 12v , but only if the board is supplying very little current .
Hi;
A proper hand drawn circuit will be better.
Can you post link to the relay board please?
Can you post link to data/specs of the DC-DC converter?
Do you have a DMM to measure circuit parameters?
Can you please post a picture of your project so we can see your component layout.
When you use a 12V battery, you have no control over what current flows when you have a short, as you have found.
If it is a Lipo or SLA then up to tens of amps, or more, will be pushed through your project, not good as you have found as that amount of current DESTROYS projects.
You need to put a fuse in the positive wire at the battery, 500mA in your case or 1A will be enough.
Regarding what happens with the boards:
Running without PIR and LED works fine!
But once I connect PIR and LED power it from the board MKR 1400GSM board was stopped working after a few minutes. Once I restarted it worked for 3-4 min then stopped running the code and flashing the red led on the board.
When I changed to the Uno Wifi R2 board, it also worked fine until I connected the LED and the PIR, then it did only run setup() loop and refused to run the loop() in the code. And afterwards disconnectiong everyting that specific board still does not run loop() part of the code.
A proper hand drawn circuit will be better. - OK will update the original post with a hopefully better one.
Can you post link to the relay board please?- *Arduino 4 Relays Shield — Arduino Official Store *
Do you have a DMM to measure circuit parameters? - Yes, but have not measured current, as it looks like too high current flow might be an issue here.. so better do that.
Can you please post a picture of your project so we can see your component layout. - Will try to do so
When you use a 12V battery, you have no control over what current flows when you have a short, as you have found.
If it is a Lipo or SLA then up to tens of amps, or more, will be pushed through your project, not good as you have found as that amount of current DESTROYS projects.
You need to put a fuse in the positive wire at the battery, 500mA in your case or 1A will be enough. - OK I added a fuse but with 5A so I suppose that way to much so it make no sense
This is a common problem asked about on this forum. A search of the forum would probably have answered your question.
The problem is your choice of relay board. A relay is a switch operated by an electromagnet. An electromagnet needs a high current to operate. Your relays need 5V supply and if the only place to get this is from the Arduino, this will cause the Arduino's on-board regulator to overheat and shut down or even fail.
Because you are using a 12V supply, a 12V relay board would be a better choice. With 12V relay boards, the electromagnet is powered by the 12V supply and so no strain is placed on the Arduino's regulator. These boards also contain transistors or opto-isolators so that they can be triggered by the 5V or 3.3V signal from an Arduino pin.
But a relay is an ancient device, invented not long after the wheel. It is still useful in some circumstances, but your project is not one of those circumstances. A mosfet uses far less power, is far smaller, does not make clicking noises or wear out.
I would suggest stp16nf06l or similar. These are n-channel, so can be placed between the load (door latch) and ground, and have a logic-level gate which means they can be operated correctly by a 5V or 3.3V signal from an Arduino pin.
If you decide to go for a mosfet, connect a 10K pull-down resistor on the Arduino pin, and a "flyback" diode such as 1n4001 across the door latch terminals (cathode to 12V).
Relay coils need a flyback diode - if you have relay modules that's usually in place.
The solenoid coil also needs a flyback diode - if that's not in place this may very well be the source of all your problems. Fair chance your solenoid doesn't have them. The reverse voltage spikes from a coil switching off can be VERY destructive (any self respecting coil will easily give you a couple dozen if not a couple hundred volts if you're not giving it a flyback diode, they really don't like being switched off and left without current path).