0
\$\begingroup\$

I have 8 different boards that can be triggered via capacitive touch and I need to feed into one input of a microcontroller. Whenever one board goes HIGH, the microcontroller's input should also change state(I don't care if it is HIGH or LOW, as long as it detects the change).

After searching the web I think that CD4078 is what will cover it, but here's the catch:

Inputs can stay HIGH for anything between 1 second and 1 minute.

Every time an input goes HIGH the microcontroller needs to know it, regardless if another input had been HIGH already.

Ideally, the gate's output should change state momentarily regardless of the input's duration, and be able to change state again once another input goes HIGH.

I know that I can accomplish this with an Arduino, but I'm trying to keeps costs down as this circuit will have to be replicated 11 times(11 x 8 inputs).

Does such an OR gate exist, or can I accomplish it with only a few more components?

\$\endgroup\$
3
  • \$\begingroup\$ While any "parity gate" (including CD40101 (9 inputs) & CD4531 (13 inputs)) will change output for each and every input going HIGH on its own, it will change again when any input goes low. A NOR gate ('4078) will stay low unless all inputs are inactive. \$\endgroup\$
    – greybeard
    Feb 12 at 11:08
  • \$\begingroup\$ how soon after an edge does the system need to respond? and what is the shortest input pulse that you need to reliably detect (1 second it seems)? can you do it by using a separate input to the controller for each input, and simply polling? (If shortest pulse is 1s, it seems that you certainly can. \$\endgroup\$
    – danmcb
    Feb 12 at 11:19
  • \$\begingroup\$ I need 11 [groups of 8 touch sensor signals to 11 binary signals to the MCU] If the group a touch is sensed in makes a significant difference, please add that to the question body. \$\endgroup\$
    – greybeard
    Feb 13 at 10:25

3 Answers 3

2
\$\begingroup\$

Each of the XOR gates below, with the RC delay at one of its inputs, will emit a 1ms pulse on each input edge:

schematic

simulate this circuit – Schematic created using CircuitLab

These are some example inputs, A B and C:

enter image description here

This is the output of a single gate G1, at node X:

enter image description here

The OR gate G4 will simply go high whenever any of the edge detector outputs go high. This is overall output F:

enter image description here

That means that even if one of the inputs is stuck either low or high for an extended period, a change "notification" can still appear at F, if any other input event occurs in the meantime.

If you're worried about finding a 3 million input OR gate, you can diode-OR the XOR outputs instead:

schematic

simulate this circuit

\$\endgroup\$
4
  • 1
    \$\begingroup\$ If I understand it correctly, I'd be getting 2 pulses(on rise and fall) instead of 1(which is what I need) on every state change, right? \$\endgroup\$ Feb 13 at 9:43
  • \$\begingroup\$ Afraid it appears you haven't read the question properly, this is any edge detection not the OP's rising edge detection. (Also, you could reduce the huge image sizes, all needs a ton of scrolling to communicate relatively little content.) \$\endgroup\$
    – TonyM
    Feb 13 at 9:56
  • \$\begingroup\$ Rising edge detection could be implemented using "implication gates". Late entry: 74*2G97 - even Schmitt-trigger inputs… \$\endgroup\$
    – greybeard
    Feb 13 at 10:39
  • \$\begingroup\$ @PetrosNousias, yes you understand correctly. \$\endgroup\$ Feb 13 at 10:58
0
\$\begingroup\$

If what you're trying to achieve is a way to interrupt your uController with a event on your keys, consider a PCF8574; page 11, Chapter 8 on the datasheet PCF8574 - Datasheet - TI show a functional block, detailing the sensing operations and how you program it to generate an interrupt on pin change.

Following is an example on the datasheet.

PCF8574 Remote 8-Bit I_O Expander for I2C Bus datasheet (Rev. J)_Pg15

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Adding the diagram to the answer might be a good idea. \$\endgroup\$ Feb 12 at 12:07
0
\$\begingroup\$

Looking at all the options, I think the least complicated way is to use a microcontroller in-between.

Given I need 11x8 outputs -> 11x1 input, I can use 6 Arduino Nano clones(each handling 2 sets of 8 inputs and 2 outputs) that go for about 2,5 euros and have around 20 usable GPIO.I could also go for 1 nano with 5 MCP23017 but the cost and wiring would be the same, with more complicated coding.

\$\endgroup\$
1
  • \$\begingroup\$ cost and wiring you found why Simon Fitch's technically close answer is not economical. And part of the advantages of microcontrollers over speciality hardware (one more big part is adaptability). \$\endgroup\$
    – greybeard
    Feb 13 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.