Can we Control DPDT switches by using Arduino/ESP32?

Hello,

In my project, I am using DPDT to switch between two different sources. Can I control the DPDT
Relay switch programmatically using the Arduino? I want to read the battery capacity ( I have designed the circuit for doing this, and Arduino is able to read the battery capacity) and if it is less than a threshold value, I want the Arduino to activate the DPDT switch through the digital output pins so that the switch points to a different source. Can someone give me their feedback/inputs on this? I appreciate your help.
Thanks in advance,
HaG

Welcome to the forum

The answer is no, it cannot control the switch that you have

What you could do is to have the Arduino control a relay with DPDT contacts depending on conditions that you set

Some Arduinos have a hidden little robotic hand that extends out of pin D3 and is able to push the lever of your DPDT switch... but they are hard to find...

:innocent:

1 Like

Here's a DPDT switch. Do you see a control input?
image

Or, are you asking about a relay?
image
There are many, many Arduino relay boards.

Here is one example, that would probably work:

C

1 Like

I meant something like this.

I meant the DPDT relay switch.

Yup.
RLY. Stands for Relay. Common electric/electronic device.
C

so you need to command this part
image

which is doable from the arduino given the right information and requires a bit of extra hardware (you don't want to control a solenoid directly from your pins without protection)

Thank you.

Hello,

As shown in the picture below, I am taking input from an external source and using a charging module to charge the Lithium Ion batteries. One of the batteries would be connected to the charger while the other one powers the microcontroller. When the battery connected to the microcontroller runs below the threshold, I want the switch to switch these two batteries, i.e, Connect the other battery to the microcontroller and the first battery to the charger. I am planning to use DPDT relay for the switching operations. Is this practically possible? If yes, can I use the same microcontroller for the switches or do I need another one?
Thank you so much ( The idea seems complicated, sorry :slight_smile: )
HaG

keep all the discussions related to your issue in one thread please

➜ merged

Okay, I am new to this. Thanks

no worries. A good read then = How to get the best out of this forum

Example:

So, are we activating the switch through the transistor?

By writing a logic HIGH to pin 12.

By the way, the battery wiring, voltage and ID are wrong in my diagram, because I didn't realize your first example was a complete fiction.

So please explain what battery connects to what device, and how, then we can refine it. But the relay transistor drive will remain similar or the same.

Please, stop calling the relay a "switch". It will confuse everyone. Also please tell us which power source the relay is supposed to be powered from.

There is a basic flaw in your design. The MCU will lose power momentarily, when the relay contacts switch over.

You didn't answer my question, but I guess you would power the relay coil from your "Power providing unit".

About MCU losing power, I have read in a discussion that adding a capacitor between the relay and the MCU would supply power during the switchover.

This might be a dumb question, Cant I power the relay from the MCU? Do I need to power it from the Power Providing Unit? I am planning to use the Arduino relay board

I only have the idea on paper and my intention is to switch between the two batteries. Do you think using a relay is a bad idea?