I've been dabbling in some simple electronics for a small project of mine and have been running into an issue. I am probably doing something wrong hardware-wise, so I would appreciate some feedback from ppl more electronics-savvy than I am (really not my core business lol). I've attached a small schematic of the setup (it is simplified, there are actually 3 probes and 3 DC motors, + a SD card with a shield but it remains off the main board).
The idea is the following: everything remains unpowered until the main loop triggers the following sequence:
1. probe transistor is switched "on" by a pin_high command.
2. there is an analog read from the probe output (which is 0-5V ofc).
3. value is saved and the transistor is opened by a pin_low signal.
4. DC motor is activated with a pin_high during a time determined by the collected probe value.
My problem is than one of those probe really CANNOT keep it's calibration, the measure is drifting constantly, so i've been measuring voltages here&there to find problems and I did, so to break down the thing into actual points:
1. If i take the voltage around the DC motors while the transistor is "off", i get the expected 0 volt, the 12V being between the collector and emitter, all good on that side.
2. This is where it hurts, if I take the voltage on the probes (which are supposed to be unpowered), i get a whopping 16V, the remainder 8V being at V_CE, whilst the circuit is supposed to be opened at that location. This is weird because the transistor is supposed to be rated for this voltage (2N2222A). There is clearly something that i'm missing here.
I'm guessing there is some amateurish mistakes in the setup which compromise the integrity of my probe's module (no reason to think it's faulty due to it giving correct value right after calibration).
Really appreciate the time for reading me, thanks a lot !
With diode reversed, as on your schematic, you're making short circuit when transistor is on... Also, always use at least 1K base resistor when using them for switching.
@jremington what kind of value would that resistor be ? Is the lack of it harming the arduino or the probe ?
The motor is 5W so nominally it's within range; i'll try to find its datasheet. Apparently I cannot post attachments so I cannot link the probe datasheet, what key information were you looking for ? @both the diode is reversed on the schematic, my mistake, on the board it is correctly plugged.
As I said, there is nothing seemingly wrong with the motor part, only the 24V line that shows weird voltages when the circuit is supposed to be opened.
Is is online anywhere? You should be able to post a web link (URL).
My worry is the output voltage levels. Yeah, you said 0-5V "ofc" but I would be more comfortable seeing that on a spec sheet.
Also, controlling the probe power supply (if I am interpreting the function correctly) with a low side driver means, when it's off, the output voltage could be 24V.
BJT transistors for switching must be fully saturated (lots of base current), otherwise they get hot and pop their tops. That makes most of them unsuitable for current over ~500mA with the limited base current an Arduino pin can provide.
I would use a 220ohm (150-330) resistor for up to a few hundred mA collector current.
Above that you could use a darlington transistor (TIP120) if... you can stand the 1-2volt CE loss.
If not, use a logic level mosfet.
Leo..
Ok I am realizing I'm super behind in electronics so thanks in advance for putting up with me ^^.
Concerning the motor: I could not find the exact model's datasheet but it's a variation of this one http://descargas.cetronic.es/RS-385SH.pdf although probably less powerfull; nevertheless, the stall current (which I forgot existed) is indeed way out of bound. My model has less power/current, so would a good idea be to put a resistor in series with it to make it run at lower power and reduce the current(s) ? One thing I'm not understanding is why nothing seems broken in that particular circuit, the transistor does its job just fine even if it is supposed to be overstrained...
Concerning the base resistor, I've read up a bit so i'll go on a hypothesis here: I need to find my probe's module resistance, which is basically R_collector; I then get the saturation current with I_C = 24V / R_collector, and I then linearly interpolate the needed V_BE from the datasheet excerpt below to get the value of the base resistor. This probably won't work but to what degree is this line of reasonning correct ?
Well, motor performance is not really an issue, and if this saves my switches from a risk of frying...
BJTs is all I have atm so why not use them if they can work ? That also makes for a good exercise... Nevertheless, do you have a specific model in mind that would be appropriate ?