Please bear with me here. I haven't had to do much circuit design since my MechE days in college, so I'm very rusty.

I'm working on a project where I need to be able to take a grid of conductive squares (say a piece of perfboard) and create alternating lines of continuity. In one moment there would be horizontal continuity, and in the next moment there would be vertical continuity, as shown:

enter image description hereenter image description hereenter image description here

I'm getting stuck on figuring out how to make this work. I've been going back and reviewing simple transistor switches, but those seem to be concerned with switching current across a load, whereas what I need to do is switch the high (+5V) signal continuity, without necessarily causing any current unless there happens to be a component touching one of the "high lines" and "ground lines" at a given moment.

One of the main challenges, as you can see, is that it's not enough to simply change where the voltage is applied at the edges. Continuity between individual grid squares has to be broken and created each time the lines switch from horizontal to vertical.

Any and all help would be much appreciated. Thanks.


Based on Dave Tweed's square wave idea, I sketched out the following circuit. This is my best guess about what you meant for using two out-of-phase square waves. Is this correct? If I understand correctly, this will result in the connected squares alternating between +5V and Gnd? (Sketch below)

If this is correct, I assume that for the other "switching" squares, I would duplicate this circuit and reverse the signal inputs? Thanks again.

enter image description here

  • \$\begingroup\$ How much current (maximum) do you expect to flow when something is touching both a +5V and a G square? How do you intend to detect when something is touching both? How fast and how often do you need to switch between the horizontal and vertical configurations? \$\endgroup\$
    – Joe Hass
    Commented Sep 18, 2013 at 20:02
  • \$\begingroup\$ I'll start with the easiest first: It doesn't need to be very fast. Maybe twice a second. Fairly low current. Milliamps range. Though I don't know exactly the max yet. I have design control over the resistance of the components that would be touching. So as high as possible while still detectable. I'm still working out detection methods; I've thought of a few options but nothing final yet. \$\endgroup\$
    – Murdock
    Commented Sep 18, 2013 at 20:39
  • \$\begingroup\$ One point to note though would be that detection will have to reside in the "grid" circuitry. The detected components will (as far as circuit considerations go) be passive resistors. \$\endgroup\$
    – Murdock
    Commented Sep 18, 2013 at 20:42

1 Answer 1


Actually, you'll note that there are four distinct sets of squares in your grid:

  • Some of the squares are always at +5V
  • Some of the squares are always at Gnd
  • Some of the squares are at +5V for the "horizontal" grid, and Gnd for "vertical"
  • The rest of the squares are the opposite of the previous set.

Therefore, you need four signals: +5V, Gnd, and two out-of-phase square waves; wire each square to the appropriate signal and you're done!


Since the above answer was written, comments associated with the question indicate that it's really a position detection problem, not simply a question of driving a voltage pattern on the grid of squares. This will require a completely different approach.


simulate this circuit – Schematic created using CircuitLab

In the diagram above, the dashed boxes represent the sensing squares. Note that within each 2×2 group, the pattern of diodes on each square is unique. The pattern can be repeated indefinitely to make a larger grid.

To use, drive each "col drive" line high, one at a time, and look at which "col sense" lines show signal. Then, drive each "row drive" line high, one at a time, and see which "row sense" lines show signal. Make sure you hold all the row drive lines low while scanning the columns, and vice-versa.

If position information is not required, then all of the row drive lines can be connected together, and all of the col drive lines can be connected together. Similarly, the row sense lines can be tied together (using a single sense resistor) and the col sense lines can be tied to another sense resistor.

  • \$\begingroup\$ Well played, sir. For those who are counting this shouldn't require more than four switches in the worst case. \$\endgroup\$
    – Joe Hass
    Commented Sep 18, 2013 at 20:03
  • \$\begingroup\$ Great observation. Thank you. I took my best shot at figuring out what you meant about using two out-of-phase square waves to power the "switching" squares. Would you mind looking at my edit (picture included) to tell me if my interpretation is correct? Thanks again! \$\endgroup\$
    – Murdock
    Commented Sep 18, 2013 at 21:22
  • \$\begingroup\$ Dave, per your edit, it's actually not a position detection problem. In its current form all I'll need to do is detect the resistance of a component touching Gnd and high. The position and orientation can change, hence the need for two voltage grid patterns, but position as a piece of data is irrelevant. \$\endgroup\$
    – Murdock
    Commented Sep 18, 2013 at 22:11
  • \$\begingroup\$ This is great. Clear and extremely helpful. Time to prototype! Thanks again. \$\endgroup\$
    – Murdock
    Commented Sep 19, 2013 at 16:39

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.