I have this project that works for now using AC-12VDC separate adaptors for the arduino and an Electric strike door lock.
The lock opens by connecting 12V to its terminals of which one is controlled by a relay and is connected when the button is pushed or by RFID match.
I want the arduino and the strike to run on batteries in case of a power outage which is at least 5 minutes and an hour max, so I found this
Create 5 volt and feed to the controller 5 volt pin. Using 12 volts into the barrel jack, Vin, waists energy.
Do You have a kick back diode connected at the lock? If not, You might say god night to the controller at any time.
Applying 12V to an Arduino is usually not considered to be a good idea. You're dropping a lot of voltage across the Uno's regulator, and there's no heat sink. If the relay draws a material current, the regulator could overheat. Does it get hot now?
Can you provide more information about the relay? A link if possible. The same for the lock.
Does the relay have to stay on to keep the lock unlocked, or is it a toggle situation so the relay pulses just briefly to lock or unlock, and current is needed only to change the state?
ShermanP:
Applying 12V to an Arduino is usually not considered to be a good idea. You're dropping a lot of voltage across the Uno's regulator, and there's no heat sink. If the relay draws a material current, the regulator could overheat. Does it get hot now?
Can you provide more information about the relay? A link if possible. The same for the lock.
Does the relay have to stay on to keep the lock unlocked, or is it a toggle situation so the relay pulses just briefly to lock or unlock, and current is needed only to change the state?
This is an old topic now running. It's not a relay, it's a relay module. Note the "In" pin on the module!
Railroader:
Create 5 volt and feed to the controller 5 volt pin. Using 12 volts into the barrel jack, Vin, waists energy.
I understand this would be waste of energy and sort of a bad practice. It wouldn't cause a problem though, right? I can't think of a better way to power both. Maybe use two power converters, one for the lock (set to 12V) and another for the arduino (set to 5V via the USB)? would that be a good idea?
Railroader:
Do You have a kick back diode connected at the lock? If not, You might say god night to the controller at any time.
Yeah, I'm planning on using a 1N4007 diode for the lock.
Yes, dual converters is a much better design. Soo often members think they can use that poor 5 volt onboard converter as a power source for other stuff, and things run for seconds before trouble begins. Using that second converter, connected to the 5 volt pin You will have 5 volt to more devices.
Don't only plan for that diode. Install it before powering that stuff up!
Railroader:
That looks good. Use the 5 volt pin on the controller instead of USB. That's much easier in my opinion.
Alright cool then.
Quick question, why do people keep saying don't power the arduino using 12V DC adaptors when it's recommended to use 7V-12V to power it up? and is it okay to power an arduino using the USB port and a phone charger if it's going to be used 24/7?
That 12 volt capability comes from stone age, the very first versions of those boards. At 12 volt that internal 5 volt converter just handles the controller and has no capacity for other devices. This is often violated by ignorant beginners.
If You try to send out 20 mA on 10 outputs You will likely exceed that converter capacity.
There's another potential problem with this setup, and that involves the minimum current draw by the Arduino and relay/lock. If the total current drawn by the XL6009s does not ever fall below the shutoff current of the charger, charging will never terminate, and the charger will continue to apply 4.2V to a fully charged battery. That's not safe. It's explained in detail in this video:
It's possible it could work if the processor goes into sleep mode, and if the relay only needs to turn on to change the state of the lock. But otherwise you may need a load sharing circuit as described in the video (which, actually, you ought to have anyway).
I understand this would be waste of energy and sort of a bad practice. It wouldn't cause a problem though, right?
yes.
heat.
the barrel jack was a bad idea from day 1. the regulator is barely adequate for the board. you can feed a few modules through it, for test and evaluation purposes. if you try to run all power for the project through the Arduino, you use the scrawny regulator and angel hair board traces as a fuse.
if you build something beyond blinking LEDs, feed a quality power supply into the 5VDC pin, which is the regulator output.
I am greatly heartened to see more and more others take up my vendetta on why the on-board regulator from "Vin" and the "barrel jack" is so useless and counter-productive to use in any serious project.
goldenice:
Quick question, why do people keep saying don't power the Arduino using 12V DC adaptors when it's recommended to use 7V-12V to power it up?
Because the "recommendation" to use "Vin" or the "barrel jack" is an antiquity stuck in the arduino.cc site that cannot be changed because the Arduino authors have no interest in updating the information or are embarrassed to confess that the advice was bad.
goldenice:
and is it okay to power an Arduino using the USB port and a phone charger if it's going to be used 24/7?
Can you think of a reason it might not be? Will the phone charger burn out?
The door lock won't open. I adjusted the power converter to 12V and it's not opening. It's making like a tick noise once it's connected, which it does normally when it opens, but it does not open. What exactly did I do wrong?
I haven't connected the arduino yet to not damage the board in case something is wrong.
Railroader:
No Arduino, no lock operation because of no positive signal to the in pin in the relay.
No, I connected the lock directly to the power converter to test it, without the relay and the arduino.
Does the battery need to be charged even if the charging module is connected to a phone charger or the load gets current directly from input if it's there?
I think it's a current problem.
PS. the arduino works fine.
That ought to work if You used the proper polarity. Else the fly wheel diode might be blown into a short circuit overloading the converter. Then it's up to the converter how it handles a short.
Railroader:
That ought to work if You used the proper polarity. Else the fly wheel diode might be blown into a short circuit overloading the converter. Then it's up to the converter how it handles a short.
Nope, It's not about polarity. I actually tried it in reverse and It doesn't even do the noise.
I tried it without the charging module (TP4056). The DC 12V adaptor plugged into the outlet connected directly to the XL6009 converter input, and it works. I think this has to do with current limit from the charging module? I'm not sure what that is, but it works fine without the TP4056.
Okey. It looks like nothing is toasted.
Disconnect the Arduino and give the charger proper time to charge the battery. Then disconnect the charger, power up the Arduino. This is the UPS situation and the battery should run the whole circus.