Go Down

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

Paul__B

OK, now the Adafruit touch sensor you cite requires an I2C interface, so you would need to connect it directly to the appropriate (and in fact, specific) pins on the Mega328 and include the necessary libraries to use it.

You may have imagined that you could use the "interrupt" output from the touch sensor breakout to indicate a touch.  You cannot, as you must have the I2C interface in order to control the touch sensor to initialise it ("turn it on") and then when it does indicate a "touch" on the "interrupt" pin, you have to acknowledge the touch using the I2C interface or else the interrupt will simply stay permanently activated.

OK?

freddyk

Well that is to bad.  Thanks for your help.

freddyk


breakout I am using: https://www.adafruit.com/product/1982 


Duh!  the link to the breakout board I posted was wron.  this is the board I have:
https://www.adafruit.com/products/1362?gclid=CO6Ckb63pcACFURgfgodA5UAGg

I think this board has more straight forward outputs than the previously posted board.

Paul__B

I suspected that just might be the case.

OK, this should be no problem as unlike the other breakout, this one runs with 5V logic.  The outputs are open-drain (same as "open-collector") so you need to pull them up to 5V Vcc with a 10k resistor.  Other than that, they can be connected directly to your 74HC165 inputs.

In fact, as I recall from your board pattern, you already have the pullups on the board and nothing further need be done - just connect them   :D

freddyk

Thanks Paul__B!

I will have to try that again.  It would be amazing/lucky/fortunate if that was the case.  I will let you know.


freddyk


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. 


I just wanted to thank you Paul for this tip on the Schmitt triggers.  It turned out that the breakout boards I had did not fit my needs.  I ended up going with these: https://www.adafruit.com/products/1374

The problem was that my board needed low signals.  As it turned out I happened to have some 74HC14s in my kit and they fit the bill perfectly.  I never would have thought of that on my own. 

I am busy redesigning my board so they may not be nessessary in the future but considering how my installation was already live in a major Portland Oregon mall I needed a quick fix and you helped me find it.

Thanks!

Here is a quick description of the project you helped me save:
It is a touch screen quiz. If the user gets a quiz question wrong they have to take a 'physical challenge' that consists of LED rings that light up indicating a button that needs to be pressed. If the user hits the buttons as they light up fast enough they can move on to the next question. My problem was that the buttons I fabricated (http://www.fredknack.com/jumpwall/) were just to hard to press. And it was live in a major Portland Oregon Mall!  Capacitive touch saved the day big time. 

Paul__B

All details noted.  For public interactive displays you generally do want a touch screen/ panel/ sensor.  And trackballs instead of mice (though they still need regular cleaning and disinfection).


The problem was that my board needed low signals.


Now that puzzles me.  Low or high is something you deal with in software, not hardware.  I don't see what the problem is there?

freddyk

I wish I would have figured out how to do it with software.

On the buttons that go to the 74hc165 I have pull-up resistors.  So reprograming the 74hc165 to detect the high signals from the touch sensors would have been a problem.  In the next version of the board I will use pull-down resistors and then I will be able to do it in software and skip the schmitt triggers.

If this assumption is still incorrect I would welcome tips.

I really appreciate your input.




Paul__B

Remove or do not fit the pull-up resistors on the PCB, wire them across the sensors instead.  You are after all, going to have to solder wires to the sensors.  Much easier than adding extra chips.

Note that if you are using SMD ("chip") resistors, you can simply solder them between the "GND" and "OUT" pads on the sensor board itself as you solder the wires to them.  Inspection of the datasheet is interesting - you probably do not need a pull-down at all because wiring capacitance will filter out the "heartbeat" tri-state events, but 100k pull-down resistors just in case sound reasonable.

And one final thought - just leave the pull-ups in place on the PCB.  If your code scans the inputs half a dozen times in a row, it should be able to ignore the occasional "heartbeat" pulse anyway especially if you are running the sensors is "slow" mode and you scan at least twice as fast as the 80 ms sampling intervals.

freddyk


Remove or do not fit the pull-up resistors on the PCB


I have another copy of the PCB.  I am going to assemble it without the resistors to test this.  That would be a great solution. 

Thanks so much!

Fred

Go Up