Go Down

Topic: Inverting 2 outputs (Read 716 times) previous topic - next topic

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.  I have looked at inverting the situation using CMOS logic NAND gate but the voltages are too low.  Can I do this with Arduino?
Barrie Aarons

TomGeorge

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... :)
Everything runs on smoke, let the smoke out, it stops running....

wvmarle

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.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

dave-in-nj

can you connect to an Analog pin ?

dave-in-nj

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

johnwasser

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.

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.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Paul__B

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.

dave-in-nj

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.

johnwasser

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?
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

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?
Barrie Aarons

TomGeorge

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... :)
Everything runs on smoke, let the smoke out, it stops running....

johnwasser

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.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Oracle

#12
Oct 11, 2018, 04:51 pm Last Edit: Oct 11, 2018, 04:52 pm by Oracle
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.

dave-in-nj

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....

DrAzzy

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.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up