Would somebody be willing to check my work?

Hi! I'm putting together a little project to control a 6V, 110mA solenoid air valve. My aim is just to open and close the valve, without frying any electronics. I'd also like to ideally run it off the 5V provided by the board. Would anybody be willing to check my work? This is the first time I've done this, and I'm pretty new to electronics design. Thanks in advance!

The circuit is based on this:
Solenoid Driver Circuit

I don't use the same components as what the schematic calls for, since the schematic is for a 12-24V solenoid, and I'm using a 6V @ 110mA solenoid. I only used the schematic to figure out what type of component I needed, and where to place it in the circuit (ie: resistor goes here, transistor goes there, etc.). I chose my specific components based on what I've read about the function of each component, and how to source the correct specs of each component.

I'm using:
6V, 110mA Solenoid Valve
270-Ohm Resistor
2N3904 NPN Transistor
IN4001 Diode
Arduino Uno R3

And, here is a link to my circuit:
Circuit Attempt

I started from the device I wanted to control and worked backwards, when sourcing my parts. I'm not sure if this is the best way to design a circuit.

Anyways, I knew it needed 6V and drew a current of 110mA. The way I understand this, the transistor sourced in the diagram I am working off of would have amplified the 40mA from the board too much, so I went with a transistor which only amplifies the current to 200mA. Not even sure if this is the correct way to think, but it's how I understand this based on what I've read.

I sourced the resistor based off Ohm's law: V/I=R. 6V/.11A = 55-ohms. I picked the 270-ohm resistor since it's what I had on hand, and is above the 55-ohm, so it works.

Not sure about the diode. I only picked that one because 1) I had it on hand, and 2) it was similar to what is in that schematic, but with lower values in its specs. To be honest, I don't really understand how to source a diode yet. Could somebody be willing to explain it in simple terms?

Again, thank you for reading this long post. Cheers!

I'm not too sure about that 2N3904 transistor, in the schematic you provided, it says you should use a TIP102 that can withstand about 4 amps. Perhaps if you get a second 2N3904, you can make a darlington pair (which is basically the TIP102 :grinning: )and possibly prevent the transistor from burning out (2 more resistors and another diode is needed though).

The diode prevents feedback current generated from the solenoid from going back to the Arduino. (It protects the Arduino)

I didn't use the same components in my circuit as what's in the schematic because the schematic is for a 12-24V solenoid, with a higher current draw as well. Was this a logical decision? Basically, I chose a smaller transistor because of, well, the smaller voltage requirement and smaller current draw.

Your first link shows a circuit that would work. If this is what you're following you have something wrong.

Check the solenoid in the first link. Neither side of it is connected directly to GND.

KenF:
Check the solenoid in the first link. Neither side of it is connected directly to GND.

Do you mean the solenoid in the schematic is not connected directly to GND, in the schematic? Or are you referring to my breadboard?

Thanks for all of the responses people, this is helping a lot :slight_smile:

In the schematic there's no direct connection between GND and the solenoid. On your breadboard there is.

KenF:
In the schematic there's no direct connection between GND and the solenoid. On your breadboard there is.

Okay, great. Thanks. I connected the GND to the solenoid because I thought that it should be that way. In the sense of this system working, am I correct, or is the schematic correct?

The schematic looks correct to me. If you're not going to stick to it, you should draw another schematic that has it "that way".

KenF:
The schematic looks correct to me. If you're not going to stick to it, you should draw another schematic that has it "that way".

Yes, you're right. Could you explain the difference between what I have wired, and what is on the schematic, as far as the ground is concerned? How are the two different, functionally?

Which one works?

How do I wire the breadboard so that it matches the schematic?

If you have followed the original schematic, with the transistor changed to 2N3904, the resistor changed to 270 ohms and the diode changed to 1N4001, that should work just fine with a 6V 110mA solenoid. The 2N3904 would not be my choice (I would use BC337) because it works best at currents well below 110mA; but it should still be OK. However, I can't easily tell from your photos whether you have implemented the schematic correctly.

Don't forget that you need a common ground between the 6V solenoid power supply and the Arduino supply.

ds7202:
Yes, you're right. Could you explain the difference between what I have wired, and what is on the schematic, as far as the ground is concerned? How are the two different, functionally?

The fact that one side of your solenoid is going to ground was easy enough to discern and sufficient to tell me that your circuit does not follow the original schematic.

To reverse engineer the rest of your circuit would be too much like hard work.

My first thought is why are you resorting to photos of your circuit instead of hand drawing a schematic
and posting a photo of it. You seem to know how to READ schematics. Why aren't you DRAWING one ?
Do you realize how much more time consuming it is to look at your photos compared to the 10 seconds
it would take to look at a photo of a hand drawn schematic on a sheet of printer paper ?

Also, do you know how to attach a photo to your post ?

FYI, when posting photos of breadboarded circuits, the required format is a photo taken about 12" DIRECTLY ABOVE the circuit, as in DEAD CENTER . so we can see everything.

raschemmel:
FYI, when posting photos of breadboarded circuits, the required format is a photo taken about 12" DIRECTLY ABOVE the circuit, as in DEAD CENTER . so we can see everything.

And no bigger than 1000 pixels horizontally and vertically so it all fits on our screens without getting RSI from scrolling.

dc42:
If you have followed the original schematic, with the transistor changed to 2N3904, the resistor changed to 270 ohms and the diode changed to 1N4001, that should work just fine with a 6V 110mA solenoid. The 2N3904 would not be my choice (I would use BC337) because it works best at currents well below 110mA; but it should still be OK. However, I can't easily tell from your photos whether you have implemented the schematic correctly.

Don't forget that you need a common ground between the 6V solenoid power supply and the Arduino supply.

Thanks for the reply, dc42! I'm pretty sure I have a common ground in this breadboard, but I'm not 100% sure.

Here's a drawing of my breadboard layout. Did I wire it correctly?

KenF:
The fact that one side of your solenoid is going to ground was easy enough to discern and sufficient to tell me that your circuit does not follow the original schematic.

To reverse engineer the rest of your circuit would be too much like hard work.

Thank you for your help! I must be misreading the schematic then. The solenoid has two posts. I thought one was for the supply, the other is for the return. Am I correct here? Where should said side of my solenoid point to beside the ground?

I appreciate everybody's help. This is the first time I've tried to use Arduino to control a solenoid, and I want to make sure I have everything right. I grasp the concepts. I've used Arduino to control motors, LED's, and servos, but I'm still not fully confident that I won't fry anything.

The transistor pin labels are incorrect. The pins are E,B,C (from LEFT to RIGHT) facing the flat front of the
plastic TO-92 package. 2N3904

(the BASE is the MIDDLE pin so your base resistor is in the wrong place.)

You realize that what you drew is not a schematic I assume. You are just asking us to check your breadboard layout , right ?

What is that thing that looks like an arrow ? (I hope that's not a diode without the band. )

Why is it wired that way. It is supposed to be ACROSS the solenoid coil. (from one coil terminal to the other, with the cathode end (the point of the arrow end) connected to the + voltage and the ANODE end
to the - voltage end of the solenoid)

The + terminal of the solenoid should be connected to the + power bus rail.
The - terminal of the collector of the transistor
The emitter should be connected to GND.
The base resistor should be connected to the MIDDLE pin of the transistor because that's the BASE.

PLEASE draw a schematic and post a photo of it.

Your latest "schematic" bears no resemblance to the original schematic. Fortunately it's getting no power, which is a good thing for now.

ds7202:
I must be misreading the schematic then. The solenoid has two posts. I thought one was for the supply, the other is for the return. Am I correct here? Where should said side of my solenoid point to beside the ground?

Where should said side of my solenoid point to beside the ground?

Oh dear.
It doesn't go to ground because you are using a transistor . Do you not get that ?

If you are driving the solenoid with a transistor , the "return" terminal (as you call it) should be
connected to the collector of the transistor. How else are you going to control it ?

raschemmel:
You realize that what you drew is not a schematic I assume. You are just asking us to check your breadboard layout , right ?

Yes, that's correct.

raschemmel:
Why is it wired that way. It is supposed to be ACROSS the solenoid coil. (from one coil terminal to the other, with the cathode end (the point of the arrow end) connected to the + voltage and the ANODE end
to the - voltage end of the solenoid)

The schematic confused me. Thanks for your help!

Silly question but do you know WHY you are doing what you are doing ?

1- Why emitter must be grounded.
2- Why solenoid must be connected to collector
3- why diode must be across solenoid.

BTW,
Did you correct the transistor pin connections that were swapped for Emitter & Base ?