Electronic Circuits Newbie - piezoelectric transducer control circuit

Hello experts.

Pardon my ignorance. I am a programmer and just getting into electronic circuits. I purchased one of these items - https://www.aliexpress.com/item/33009797446.html?spm=a2g0s.9042311.0.0.74e24c4dy7VDPq - so I could try and make a device that I could control via a sketch.

My project is to:

a. turn on/off power to the device through a sketch
b. use the sketch to control the time duration during which power is supplied to the device
c. later on, add a failsafe to ensure that no power is supplied to the device if there is not enough water available (I imagine a water-level sensor)

Is (a) as straightforward as applying 5VDC power to the device through the barrel connector? Meaning a 5V wire and a ground wire from the Arduino? It seems I would need some additional circuitry to cause 5VDC to flow or not flow from the Arduino to the device. As you see, this is where my electronics ignorance rears its ugly head.

Once I am able to do (a), I figure it would be easy to do (b).

I am able to do basic soldering (I would not attempt to do anything more than soldering a few wires/pins!!!), but the circuit itself is (hopefully at this point) beyond my comprehension).

Any handholding/advice/guidance - "here's where you can learn", "here's what you need to do", "here are some example circuits" would be so very helpful. Hopefully very little of "you're an idiot"!!! :slight_smile:

Thanks!!!!

The most foolproof and uncomplicated way is to use a relay module.

Thanks for the quick response!

After I posted this earlier today (and using my less-than-novice knowledge!) I too thought I would need a relay.

I guess I need a relay that can use either 3.3VDC or 5VDC, and result in a 5VDC to 12VDC output?

At some future point, I assume I would know enough to simply replace that circuit board and replicate it, but right now it's way beyond my capabilities!

Thanks!!

Hello @aarg:

My apologies for being such a newbie.

Is there such a thing as a DC-DC relay? Meaning on the control side it's 5VDC (or 3.3VDC) and on the load side it's 5VDC/6VDC/9VDC/12VDC (one or more of those).

Also, I am hoping there is a power supply that I could use that provides for both in one package, ie, a 3.3/5 VDC to power the Arduino, and a 5/6/9/12 VDC that can power the load.

Any guidance from you would be greatly appreciated.

Regards.

I think you need some basic introduction into electronics , switch circuits , ohms law etc.
Also I’d suggest you google some Arduino circuits and play with the IDE examples a bit more .
The components you suggest can be identified in the same manner z( google low voltage relay , relay circuit etc )

You don't need a relay configured for a particular voltage on the load side. There are limits to the voltage and current they can handle of course.

The typical relay boards used with Arduino tend to have Songle relays on them that you can control with 5V and use loads of any of the DC voltages you were asking about up to 10A.

@hammy:

Thanks! I appreciate the patience shown.

I have some ideas but the devil is always in the implementation details, and my lack of circuit knowledge is clearly hampering me.

As far as voltage supplies/relays etc., I know that could use two separate power supplies - one for the Arduino and another for the load, but I guess that's where my lack of knowledge/nomenclature is a hindrance.

I remember some basic Ohm's Law/Kirchhoff's Theorem stuff form my college days, but never did any practical stuff with it. I will go through the examples and hopefully find something that is close to what I need to do.

Again, I appreciate your suggestions for learning.

Regards.

@wildbill:

Thanks! As a hardware newbie, it confused me when I looked at relay modules - all seemed to be for controlling AC loads. I pride myself on being able to learn new things even at my age, so hopefully I will get through whatever mental blocks I have about this.

It's just recently that I decided to dabble in electronic circuits, and a specific project I have is to use an Arduino to control a peristaltic pump. The pump itself is driven by 5VDC, but rather than connect it directly to an Arduino, I needed to be able to turn the pump motor on/off. Rather than tackle the entire circuit at once, I figured I'd learn how to control a specific piece of the puzzle first, and incrementally build upon that.

Eventually I'd like to be able to use either an Arduino or a Raspberry PI, but I am focused now on Arduino.

Appreciate your patience and guidance.

Regards.

You could use a relay to control your pump but it's overkill unless you want to experiment with relays.

You can simply do it with a logic level mosfet, a few resistors and a snubber diode. Your favorite search engine can find you the circuit.

Hi @wildbill:

The main reason for using a relay is ultimately to cut power to a piezoelectric atomizer disc. I plan on using the pump to deliver the right amount of liquid to a container in which the atomize disc sits. But I don't want the disc to be powered at all times. SO basically I am looking for a way to cut power to the disc as and when needed.

Initially I wanted to check out how well a relay helps me by substituting a pump. Eventually I expect to have the pump and the atomizer disc wired up (in series?) to the load side of the relay. That way when I want the atomizer to be powered, it will be done in conjunction with the pump being powered.

Given my lack of knowledge if circuit design, there are probably a dozen ways to do this, and I am willing to learn about each of those methods!

Hope this makes sense.

Regards.

Hi folks:

An update to what I did circuit-wise. I used the simple blink sketch and wired it up as indicated in the picture. I used a low-voltage DC motor to validate my basic understanding (so far). The motor does in fact behave as I intend, i.e., active for few seconds, then inactive for a few, and repeat.

I assume that there are many safety items for me to consider, but I figure baby steps...

Now, what would you believe is necessary for me to do better? In other words I am not looking for spoon-feeding, but nudges in the proper direction, things I ought to learn about next, etc.

Any guidance is greatly appreciated.

Regards.

void setup() {
  // initialize digital pin 5 as an output.
  pinMode(5, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);                       // wait for 3 seconds
  digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

One thing you should do is start giving pins names:

const int ledPin = 5;

void setup() {
  // initialize digital ledPin as an output.
  pinMode(ledPin, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(ledPin, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);                       // wait for 3 seconds
  digitalWrite(ledPin, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Thanks, @aarg! Good point.

Hi Folks!

Can you please help me clarify my current understanding of relays?

In my earlier circuit, I connected the load to the Arduino 3.3VDC and GND pins. Since a relay is basically nothing more than a switch triggered by a control wire, I should be able to replace the Arduino 3.3VDC/GND pins with an external power supply, as long as it is wired up in an equivalent manner. And the relay should allow that external power supply to complete the load-side circuit based on the control wire. It seems to me that this is equivalent to connecting the load-side terminal to 110VAC from my house electric supply.

Just want confirmation/clarification that my understanding is accurate.

Regards.

lanewsa:
I should be able to replace the Arduino 3.3VDC/GND pins with an external power supply, as long as it is wired up in an equivalent manner. And the relay should allow that external power supply to complete the load-side circuit based on the control wire.

Yes. You should do that sooner than later too - the Arduino cannot provide enough power to run a motor and in doing so you may have damaged it.

With some relay modules, you can also avoid powering the relay coils from the Arduino and have it do nothing except activate the opto isolator.

Hi @wildbill:

I've tested the Arduino several times now between a small DC motor (3.3V) and a slightly larger one that runs at 5VDC. I can successfully get the 3.3VDC motor to run per the sketch (i.e., wired up through the Arduino 3.3vDC pin). But the 5VDC will not run if I simply replace the 3.3VDC motor with the 5VDC one (and I guess I could understand that if it's not getting enough power).

I have an external DC power supply that I've used to directly power each motor (no Arduino/relay involved) and each works fine.

When I connect the 3.3VDC motor per the picture shown previously, it works fine.

Now, I disconnected the 3.3VDC motor from the Arduino 3.3VDC pin/GND, and connected instead into the external DC power source (so all I'm doing is replacing the power source). The motor does not run when the relay "engages".

I've re-connected the 3.3vDC motor back through the Arduino 3.3VDC/GND pins, and the sketch works fine as before.

So leaving aside the question about the 5VDC motor, I'm confused why the motor works fine when hooked up directly to the external power source independent of the relay/Arduino, but hooked up through the relay it doesn't. This doesn't make any logical sense to me, so clearly I am not seeing something I ought to be doing differently.

As far as I can tell, the Arduino does not appear to have been damaged in any discernible way, and apparently neither has the relay.

Any suggestions gratefully acknowledged!

Regards.

As described I would expect it to work. Perhaps provide a picture of the setup. You could use a meter to check that the motor side contacts on the relay are connected when your code activates the relay.

Update: I changed the relay module, and now the external power source drives the DC motor as expected.

Although I am noticing another odd behavior when I replace the 3.3VDC motor with the 5VDC motor - the motor starts up but will not stop, so it seems like the relay is not "dis-engaging".

Putting the 3.3VDC motor back instead of the 5VDC motor works as before.

Not sure what is causing this behavior.

I did check with a meter earlier, but I guess to some degree this is obviated at least for the 3.3V motor. Checking voltages with the 5VDC motor is warranted, even though I am unclear what is causing the relay to not break the connection as expected. I have manually broken and re-made the connection to the 5VDC motor several times through a sketch cycle, and each time, when pin 9 is low, the motor is not active, but as soon as pin 9 goes high, the motor starts, and then does not stop through multiple iterations of the sketch loop; that is, until I manually break the connection.

BTW, the motor rating says 6VDC at 5W. So the current through the relay is quite substantial (1A at 5V). Not sure if that has anything to do with the issue I am seeing. This specific motor is Kamoer NKP-DE-S10D (unfortunately I have so far ben unable to get any specs on it)

I have a spaghetti-wire mess right now (I did that to simplify life for me as I kept replacing the motors), but I will clean that up and send a picture of the setup in a bit (but it is exactly the same as described in the picture except that I am not using (anymore) the Arduino 3.3VDC/GND pins but am using an external DC power source (a cheapo Belkin).

Regards.

If you pass a high enough current through a relay you can "weld" the contacts together. Since the problem doesn't persist after power down that's not it though and I note that all of my relay modules can handle a lot more Amps than that.

What is your relay module (and relay)?

Is there a breadboard in the mix anywhere?

Hi @wildbill:

The relay is a "G3MB-202P 5V DC 1 Channel Solid-State Relay Board Module For Arduino" purchased on AliExpress (see image attached).

I did not use breadboard since I don't have any components attached other than the relay and the motor (neither of which are designed to fit into a breadboard).

I've tested it a few more times, and I state that the 3.3V motor works fine and responds to the signals from Arduino, whereas the 5V motor responds on the very first high control signal and then doesn't respond to the low signal.

Thanks again for helping me solve this odd behavior! Greatly appreciated.

Regards.