Go Down

Topic: Use a High pin to bring a pin low (Read 4326 times) previous topic - next topic

freddyk

Hi

I have a capacitive touch sensor that brings its output pin HIGH when it's sensor is touched.  My device requires a pin to be brought low (74HC165 shift register) in order to activate.  Can anyone offer any advice on how I could bring a pin to ground with a HIGH pin input?

Any tips on where I should look for a solution would be helpful.

Thanks

JimboZA

#1
Aug 21, 2014, 07:48 am Last Edit: Aug 21, 2014, 08:03 am by JimboZA Reason: 1
You could put that output into the base of an npn transistor. Emitter to ground, collector to Vin through a pullup resistor, and take your output from the collector.

edit.... v2 of schematic, shows current limiting resistor into base, and pulldown from base to make sure the transistor is open when your sensor isn't high.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Paul__B


You could put that output into the base of an NPN transistor.

You could, but you need to do it through a 10k (or 47k or 100k) resistor.

Alternatively you can use one gate in a CMOS inverter chip, such as a 74HC14, especially if you already have one, or a use for the other gates.  Very useful for oscillators to flash LEDs and such or make noise.  On the other hand, if your device was controlled by a microcontroller such as an Arduino, you would not need to invert the input as you would do that is software.

JimboZA



You could put that output into the base of an NPN transistor.

You could, but you need to do it through a 10k (or 47k or 100k) resistor.


Yep I had fixed that just before you posted....

Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

freddyk

Thanks Guys!


JimboZA I had an idea that a transistor may work but I did not know how to actually wire it up.  Your diagram looks perfect.  Thanks so much!

freddyk



You could put that output into the base of an NPN transistor.

On the other hand, if your device was controlled by a microcontroller such as an Arduino, you would not need to invert the input as you would do that is software.



My board is a DIY Arduino.  Are you saying that there is a way in software to make the 74hc165 look for high values rather than low? 

The inverter chip looks interesting as well.  I might even have one handy.  I will have to investigate that.

Thanks again for your input.

JimboZA

Quote
Are you saying that there is a way in software to make the 74hc165 look for high values rather than low? 


He more likely means that you could read the sensor on an Arduino pin and put its inverse out on another, and put the '165 on there.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

JimboZA


JimboZA ....  Your diagram looks perfect.  Thanks so much!


Usual disclaimers apply.... YMMV, E&OE etc.  8)

Heed Paul__B on the size of R3
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

freddyk


Quote
Are you saying that there is a way in software to make the 74hc165 look for high values rather than low? 


He more likely means that you could read the sensor on an Arduino pin and put its inverse out on another, and put the '165 on there.


Ok.  I get that.  I am trying to avoid using new pins.  I had this nice elegant shift register setup to read buttons then I had to go and find this touch sensor...

Paul__B


Ok.  I get that.  I am trying to avoid using new pins.  I had this nice elegant shift register setup to read buttons then I had to go and find this touch sensor...

I cannot figure out exactly what you are doing with the HC165 that requires you to invert the pin.  If it is a data pin and you are shifting data into a microcontroller, then you perform the inversion in logic in the sketch after you have read the data into the microcontroller.  If you want it to look right as a byte, you simply perform an XOR with whichever (number of) bits you need to swap.


Heed Paul__B on the size of R3

However the resistor from the base to ground (R2) - if you use it - must also be no less than half the value of R3.

freddyk

Thanks Paul__B

Sorry that my explanations are not so clear.  I have figured enough of this stuff out to be dangerous but that does not mean I know what I am doing.

I am going to investigate if I can do this in logic.  That would be really nice.  Currently if I connect the output of the touch sensor to one of the input pins on the 74hc165 I can see that some power is coming from the 74hc165 so I assume it is high and waiting to be pulled low.  So what you are saying is that I can use logic to make the default state of the 74hc165 pins low and wait for high? 

If I can't figure that out I may go with the Schmidt Triggers that were mentioned earlier.  I have some of those.

Thanks again for being so helpful.

Paul__B


I have figured enough of this stuff out to be dangerous but that does not mean I know what I am doing.

That may be the case!


I am going to investigate if I can do this in logic.  That would be really nice.  Currently if I connect the output of the touch sensor to one of the input pins on the 74hc165 I can see that some power is coming from the 74hc165 so I assume it is high and waiting to be pulled low.  So what you are saying is that I can use logic to make the default state of the 74hc165 pins low and wait for high? 

It begins to sound as if you have a serious misunderstanding of the situation, confusing "pull-ups" with logic states.  A 74HC165 is a CMOS device with extremely high impedance inputs; there should be no "power coming from the 74hc165" at all; that is not the point.

I think you had better provide us with a diagram of your circuit and a web reference to the "touch sensor".  Otherwise we have no idea what you are really trying to do and are clearly not talking on the same level.

freddyk

Thanks Paul__B.   Yea.  Me and miss-understanding go way back.

I am going to try a few ideas based on your input. 

In case you are curious this is the breakout I am using: https://www.adafruit.com/product/1982  and I have attached my Eagle schematic.  The board has already been built so I wan to work with as much of it as I can.

In my signature you can see pictures of the assembled board.






JimboZA

Quote
and I have attached my Eagle schematic


Not everyone has Eagle: better probably to export as an image and post that.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

freddyk


better probably to export as an image and post that.


Good idea.  The area indicated in red is the focus.  I have some terminal blocks that I have been used to connect switches.  I want to connect the output from the touch breakout board.

Go Up