0 Members and 1 Guest are viewing this topic.
Instead of the 2N3904, use a 2N3906 (PNP) and put it above R3 (emitter to 5V, collector to R3) . You will, of course, need a base resistor, maybe 5K to 10K. The 2N3906 will turn on when Vb is low.Also, the two circuits must share a ground.
??A typical Arduino WILL output 5V. I have half a dozen UNO's here an a couple of Megas, and they all work at 5V.What Arduino are you talking about?
This will require a voltage source of at least 4.4-4.5V to keep its base above the Vbe threshold. Arduino will only output 3.3V max which won't be enough to keep the PNP turned off.It can be solved by an additional NPN transistor whose base will be driven by the Arduino (via a resistor), emitter connected to GND, collector pulled up to +5V via a resistor and connected to the base of the PNP via another resistor. This will provide a reliable way of keeping the PNP turned off and turning it on by turning on the NPN by setting an Arduino pin high, which will pull the PNP's base to ground.(to OP: easier drawn than described, just play around in falstad and see how it works)
Will the voltage drop of 0.2V in saturation in the transistor affect the LM335? Since this sensor changes its voltage to measure temperature.
Thank you, I will try it, but I have a question. Will the voltage drop of 0.2V in saturation in the transistor affect the LM335? Since this sensor changes its voltage to measure temperature.
I'd say why not power the sensor from one of the digital pins of the arduino.
This is why your original circuit doesn't work: the voltage drop across the transistor affects Vout, because it is placed between the sensor and ground: Vout = Vsensor + Vce_transistor.With a PNP transistor at the +5V rail, Vout isn't affected by anything. You still need to make sure that current flowing through the sensor stays within the allowed range, this is set by selecting the value of R3 appropriately.I recommend running a falstad or everycircuit or any other simulation to help you understand how the circuit works. It's a perfect (at least for the basic circuits like this) way of trying various ideas without the risk of letting any of the magic smoke out and it's much quicker than it can be done on a breadboard. If there's no model for LM335, no problem, just replace it with a low-value zener (e.g. 2.4V). It will allow you to test if power switching works as intended and current stays within reasonable limits.
Quote from: Eraldo on March 29, 2023, 11:09:17 amI'd say why not power the sensor from one of the digital pins of the arduino.That's actually a great idea. It can certainly handle the 1ma required for the LM335.Voltage is not such a concern as long as you have the required current going through the device.
The ATtiny85 will have no issue either. It has the same drive capability as the ATMega328 in the Arduino. The decision is up to you though.