Inverting 2 outputs

I have a device which has 2 5v outputs and under certain conditions one falls to 0. I wish to detect this situation and take further action. I have looked at inverting the situation using CMOS logic NAND gate but the voltages are too low. Can I do this with Arduino?

Hi,
How do you mean the voltages are too low.

Logic CMOS works at 5V and you have 5V output you want to invert.

Do you know how to configure a NAND gate to be an INVERTER?
What NAND gate CMOS IC are you using?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

It's easier to connect that signal to an Arduino pin and test for its value: if below 1.3V or so it'll read as LOW, if above 2.5V or so it'll read as HIGH.

Otherwise an inverter (or NAND indeed) would do the job.

can you connect to an Analog pin ?

it might be easier to do this with some transistors and not bother with software.

bazzlance:
I have a device which has 2 5v outputs and under certain conditions one falls to 0. I wish to detect this situation and take further action. Can I do this with Arduino?

It depends on what the "take further action" is. The Arduino can certainly detect when an input signal has gone from 5V to 0V.

bazzlance:
I have looked at inverting the situation using CMOS logic NAND gate but the voltages are too low.

It doesn't matter to the Arduino if the input is going from 5V to 0V or 0V to 5V. It can detect either transition easily. No need to invert the signal for the Arduino's sake.

Everything depends on what the Arduino is supposed to do once it detects the change.

dave-in-nj:
it might be easier to do this with some transistors and not bother with software.

Strange concept.

If you do not want to bother with software, you do not use a microcontroller such as an Arduino.

Paul__B:
Strange concept.

If you do not want to bother with software, you do not use a microcontroller such as an Arduino.

OP said the voltages were too low for CMOS $0.02.... to sense. (Darn voice to text) if it's too low for CMOS to sense it's going to be too low for an Arduino to sense.
Increasing the signal would be in Hardware before it gets into a microcontroller.

dave-in-nj:
OP said the voltages were too low for CMOS to sense. If it's too low for CMOS to sense it's going to be too low for an Arduino to sense.

The OP also said "I have a device which has 2 5v outputs and under certain conditions one falls to 0. I wish to detect this situation and take further action." Who are you going to believe: The OP, or the OP?

I have managed to invert the signal using 2 transistors and now have an output of 5v but not enough current to operate a 5v relay. Any suggestions?

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

So we can see how you have configure the transistors.
What are the specs/data for the relay?
What are you using to supply the relay coils.

Thanks.. Tom... :slight_smile:

bazzlance:
I have managed to invert the signal using 2 transistors and now have an output of 5v but not enough current to operate a 5v relay. Any suggestions?

Find out how much current your relay requires. Divide that by the Beta (Current Gain) of your transistor. That is how much current you need at the Base to turn on the relay. Assuming your transistor's Base is driven by a pull-up resistor, subtract the Base-Emitter voltage drop from the supply voltage and divide that by the desired current to get the maximum pull-up value that will work.
Or you could just buy a 5V relay module that is already Active Low (most are) and has a built-in transistor driver. You can get them for about $1 from China.

bazzlance:
I have managed to invert the signal using 2 transistors and now have an output of 5v but not enough current to operate a 5v relay. Any suggestions?

This is your first mention of a relay. Why are you asking such small things in dribs and drabs? This is almost certainly an XY problem and all you will do is frustrate a lot of good and helpful people as you lead yourself down the wrong path in tiny little steps.

If you want to drive a relay, use a MOSFET, or use a solid state relay that the Arduino can drive directly, or use a prebuilt module with a relay and driver circuit. Maybe none of these will work for you, there are many other methods too. You haven't provided any information to base an answer on.

if you can amplify the signal that is too low for CMOS to sense and take the other signal that you inverted,
you can bring them in to an FET.

as for the motor that runs at 230 volts and the PIR that is connected to the Sun follower, you might want to use a current limier on the solar panels that charge the LiPo batteries that feed the Joule Thief, that then charges the niCad batteries that you use to power the servos of the line follower that you forgot to mention.....

you can put all that into the 5mm thick walls of your large project box that is not metal like laptops, and is not hand made and is not made by a cnc milling machine, not store bought and not made with a #D printer.

let me know if I am getting close....

If I wanted to trigger a relay when the output of something was 0 or 5v - if I wanted to turn it on when that output went high, if connect it to the gate of an n-channel mosfet switching low side of relay. If I wanted it to activate the relay when the signal was low, if relay wAs 5v, straight to gate of p- channel mosfet switching high side, if it was more, I'd probably invert signal with small p-channel fet driving n-channel fet on low side. If the signals were analog and I wanted a fixed threshold, I'd use a 339 comparator, or use a microcontroller if I needed more complex behavior.

But yeah,you should tell us what you're trying to do, as I think were probably in x-y problem territory.

dave-in-nj:
let me know if I am getting close....

LOL you made my head spin. Too much of XY there!

I am trying to turn on an AC circuit with a 5v relay starting with a sensor input of 0 - 5 volts. I want to activate the relay when the sensor input goes low. I have therefor inverted the low from the sensor to a high (5v) using the 2 transistors but need more current to drive the relay which needs 60 mA. I had thought of doing this using a third transistor but maybe a FET would be better as suggested.

A single transistor (PNP, high side switch) should be enough for this. Maybe two, if your sensor can't supply even 1 mA.

And I'm assuming your still undisclosed sensor produces a digital output of either 0V or 5V.

Hi,
Please read post #10.

Thanks.. Tom.. :slight_smile:

TomGeorge:
Please read post #10.

Yes, start providing real answers.

Show us your circuit, but first tell us what the sensor is - a Web link or datasheet.

What is the AC circuit you need to control?

What is the relay? Web link or datasheet please. Why are you using this particular relay?

All of this information was supposed to be in your original posting.