Using single 12v DC power source for project

Hi there,

I am creating an escape room for my daughters birthday which is a lot of fun. I'm completely new to Arduinos and electronics in general so expect the newbie question.

I have created a puzzle involving four potentiometers and a maglock door release. It works great, however I'd like to power the entire thing from a single 12v 2A power source. Currently I power the Maglock (12v 300mAh) in a separate circuit to the Arduino as it has a higher current demand. The arduino Nano is powered by a USB C cable.

I know the Nano can take an unregularted power supply on the VIN pin so it should theoretically be ok to just connect this up to the same DC power supply as the Maglock, however, I'm not sure if this is safe? or if I should be putting other components in the circuit for protection, e.g. Diodes or Capacitors, I see this done from others online but unsure of the logic around the use, so asking the community for some advice! Ideally I don't want to try it and risk frying my Nano

Thanks in advance!

Current circuit is wired up like this:

What I'd like to do is something like this:

Bonus points.. If anyone has a maglock fritzing part that would be awesome!

EDIT: Updated Maglock details

After reducing 12V to 5V, the puny voltage regulator on the Nano can only source about 150mA without overheating and shutting down or failing, The relay coil draws 72mA, you need a "buck" converter that can drop the 12V to 5V and supply at least 800mA @ 5V, connected to the Nano's 5V pin.

12 - 5V buck

More bucks

2 Likes

If the 12V has a little excess capacity you can use a 7805 regulator to provide the 5V

1 Like

Here's one I've used often.

OKI 78SR-5

1 Like

When you interrupt the current to an inductor, which is what a maglock is, the inductor tries to maintain the current. If the terminals of the inductor are open circuit the inductor has to produce a high voltage to have any chance of maintaining the current, possibly several hundred or 1000V. You don't want 1000V near a microcontroller.
See:

For what to do about it.

2 Likes

That is not exactly true, without filtering it will cause problems. Post a link or tell us what the rating of the power supply the maglock uses.

1 Like

Thanks @JCA34F , I have a few bucks that can support this, so will look to add into the circuit to ensure 5V to the Nano. These are the bucks I have

Thank you @PerryBebbington , I'm glad I asked the question before trying it out! I'll read your post tonight and look to integrate the diode into my circuit also.

1 Like

Thanks for replying, I've used a 12v 2A power supply for the Maglock, link to maglock is updated in my original post.

As per the other comments, I'm going to step down the voltage to 5V as opposed to giving it the full 12

Nano is not power hungry, so if you want simpler solution, you could use 1W zener diode in series with Arduino Vin, to get the desirable voltage drop. For example if you use 5V6 zener you will get 12 - 5.6 = 6.4V on the Vin pin.
Just be careful, if you reverse polarity of the zener, you will get only 0.6V voltage drop, instead of 5.6V.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.