Beginer : Transistor NOT gate? (Solved)

Hi all, just bought arduino starter kit and started a projet to autonomously water my plants.

i thought of a way to do it, but to be efficient, I would need to turn a switch OFF when the input is Hi. I have seen a few turorial on how to do that by causing a shunt, but in my circuit there would be a lot of that, and i'm worry about taking to much of current juste to switch on off a few thing.

So here is my question... is there is any transistor that switch off when imput is hi? witout needing to shorting anything and without using an inverter???

Any help would be apreciated as I've been googling about this for a few hour now!

thanks!

François

Since you're talking about using an Arduino, by far the easiest way to get things working one way or the other is in your code's logic.

It's trivially simple to read a sensor and output a high on another pin if the sensor's low. It's just as simple to output a low if the sensor's low. You can even change your mind next week if you like, and flip the logic in your code without needing to mess with the hardware.

You could also achieve this with a relay module.

What is the voltage on the sw? How much current through the sw? Can you post a diagram?
HowToPost

kenwood120s:
It's trivially simple to read a sensor and output a high on another pin if the sensor's low. It's just as simple to output a low if the sensor's low. You can even change your mind next week if you like, and flip the logic in your code without needing to mess with the hardware.

Yes that is thrue, the probleme with that is that since i'm planing to controle quite a few servo motor, I think i'm going to lack of output. so insted of two pin for each iteration (see graph) i would only need one with a "off" transistor...

Noobian:
You could also achieve this with a relay module.

I'll google that right away! thanks for the advice!

edgemoron:
What is the voltage on the sw? How much current through the sw? Can you post a diagram?
HowToPost

O__o i guess i'm really newb.... but i don't understant the question, what is sw?

Basicly, i will have to control like 16 servo motor (but only one at once), and i'm planning to had input from moisture sensor (like 16 of teem) so the number of pin used is limited.

So i was planing to make a iteration of switch to have only one motor powered at a specific time. wich imply using quite a few transistor. For each "iteration" i need some switch on and some switch off. If i take kenwwood advice, for 12 motor, i'll need 10 pin instead of 5. But i'f i use inverter or other trick to make a Transistor NOT gate, with like more then 20 transistor i'm afrain to draw to much current...
the only source of power is the arduino itself

i did the schema with only 8 servo motor, for 12 i will have to had an "iteration". every transistor with reverse sign are the one i would like to turn off when at HI

thanks all for your time!

empereuri:
Hi all, just bought arduino starter kit and started a projet to autonomously water my plants.

i thought of a way to do it, but to be efficient, I would need to turn a switch OFF when the input is Hi. I have seen a few turorial on how to do that by causing a shunt, but in my circuit there would be a lot of that, and i'm worry about taking to much of current juste to switch on off a few thing.

So here is my question... is there is any transistor that switch off when imput is hi? witout needing to shorting anything and without using an inverter???

Any help would be apreciated as I've been googling about this for a few hour now!

thanks!

François

High side switch with a PNP BJT or p-channel FET will do this.

Noobian:
You could also achieve this with a relay module.

Ok just googled that and yes, that's exactly what i need... I guess the realy really acte as a "transistor" but with the possibility to have it normaly on or off.... Thanks a lot! really helpfull

MarkT:
High side switch with a PNP BJT or p-channel FET will do this.

I'll will take a look at that, but i think i already look at that (not totally sure if it's the same terminologie)
but i think that of each signal i turn to off, i will have to pass a bit un diverted current and with like 20 of those, i don't think the arduino uno can take it (I can be totally wrong!)

empereuri:
Ok just googled that and yes, that's exactly what i need... I guess the realy really acte as a "transistor" but with the possibility to have it normaly on or off.... Thanks a lot! really helpfull

What is the load you are switching?

Why do you need HIGH to mean off?

MarkT:
What is the load you are switching?

Why do you need HIGH to mean off?

The load i need to switch is the power to the servo-motor (5V) (only one will be powered at one given time), sorry the schema did not load up, i redid it and it should be avalaible on my last post (but i'll had it here juste in case)

I need HIGH to mean off to avoid using more pin on the arduino. i do a serie of on/off, to be able to controle multiple servo with minimal pin use...

I won't reply for a few hour, as it's 5h30 am, i think it's time to sleep a bit! thanks all for your input/comment

Please describe the component in the green box. :slight_smile:
circuit2.png

edgemoron:
Please describe the component in the green box. :slight_smile:

It's like the scene from one of the Rambo movies:

What's this?
A blue light.
What's it do?
Turns blue.

Or the rare bipolar bump :grin:

edgemoron:
Please describe the component in the green box. :slight_smile:
circuit2.png

haha! well, i think we can all conclude that this is not the best drawing! It's just a normal transistor (but i draw the wire first O__o)

I sleep on that... I think, in then end, the best thing would be to have a 10 pin inverter... But if it invert the singnal of 5 pine at the same time... will it draw to much power from the arduino to the point to prevent a servo motor to do is job?

empereuri:
It's just a normal transistor

Then you are both drawing too much current from the Arduino and overdriving the transistor.

aarg:
Then you are both drawing too much current from the Arduino and overdriving the transistor.

should a transistor be able to handle one servo motor? (as i said, the on/off gate kind off give coordinate to each servo so that only one is open at time) they are small 5V servo

Why do you need to switch the servos' power anyway?

Just servo.detach() and the servo library will stop commanding it. I've never measured the current draw of a servo.detach()'d servo: I suppose there may be some current drawn by the electronics, but negligible compared to the current drawn while it's moving and even when it's idle but servo.attach()'d.

(I'd measure it for you but my best dmm is out on loan and the cheap one I have at hand doesn't measure current.)

Hi,

Basicly, i will have to control like 16 servo motor (but only one at once), and i'm planning to had input from moisture sensor (like 16 of teem) so the number of pin used is limited.

What do the servos control?
Servos might not be the appropriate control to use.
What is your project?

Tom... :slight_smile:

It's the classique auto-watering for plants... but i want all my indoor plante (like 12-14) to be watered independently.

Instead of pump, i use a syphon syteme with on-off valve, the valve are actionned by servo motor (really diy, i bought cheap valve and glued teem to cheap servo motor). I did the set-up for on plant (with one diode to turn on-off the power to the servo-motor) wich is working fine...

I am working in parallele to do capacitive moister probe to automatise everything. Once it will be working for one plante, I would like to do all of teem but on the same arduino bord (Why can't I take two or three board? I don't know, I like to give me some hardtime?) So to mesure and water 12 different plant independently, i'll need a way to rationalise my arduino pin... (hence the "array" of on off switch, to be able to tell the programme to speak to a single servo or read a single probe at a time.)

I'm all open to suggestion/advice or warning about dumb thing i'm about to do!

kenwood120s:
Why do you need to switch the servos' power anyway?

Just servo.detach() and the servo library will stop commanding it. I've never measured the current draw of a servo.detach()'d servo: I suppose there may be some current drawn by the electronics, but negligible compared to the current drawn while it's moving and even when it's idle but servo.attach()'d.

(I'd measure it for you but my best dmm is out on loan and the cheap one I have at hand doesn't measure current.)

Sorry! I missed your anser. I will use only one pin to commend ALL the servo motor, so the only way that they don't all move at the same time is to have only one servo powered at once.

But thanks for the servo.detach command! My cheap servo do move the valve, but they can't get exactly where the code tell teem, so they move to aproximate location and then they "rush", I was cuting the power with a transistor after 1 sec, but with servo detach, it's going to be way easyer!