Turning analog inputs into multi-switch digital inputs
Description: There is an interest in creating an interactive LED game board or a "Stargate" DHD-type sci-fi prop, where each tile is illuminated from below by either a single white LED or an RGB combination. The goal is to make each tile responsive to touch with a simple on/off switch. The project may consist of 21 RGB tiles or 64 white or monochromatic tiles, which would require multiple controllers. A proposed solution involves assembling a set of resistors, each selected to resist a specific percentage of the total analog input voltage. Each resistor would connect to a momentary switch, arranged in parallel on the same analog input circuit. Activating a switch would lower the voltage by a different amount, allowing the code to interpret the switch depression and illuminate the corresponding LED. For instance, if switches are labeled A through H, with each switch allowing different voltage levels (e.g., 0.5V for A and 1.0V for B), the code could recognize these discrete voltages as specific switch activations. This method could potentially enable multiple switches to be pressed simultaneously, allowing for a more complex input system. The concept could allow for transforming 8 analog inputs into 64 digital inputs, facilitating the creation of an interactive chessboard or a Stargate dialing device. Previous experimentation with a similar system involved using precision multiturn potentiometers to create voltage dividers. While the 8/8/8 controller has 10-bit inputs, practical limitations would likely allow for 20 switches to function reliably on one input. However, identifying multiple simultaneous button presses remains a challenging aspect. The current project utilizes an LCD/8/8/8 unit, which has three contact points: +5V, ANALOG INPUT, and GROUND. The challenge lies in constructing the desired circuit using simple resistors instead of potentiometers.
In this project, the interactive LED game board or sci-fi prop is designed to enhance user experience through touch-sensitive tiles. Each tile, equipped with either a white LED or an RGB LED, will be controlled using a simple on/off mechanism. The proposed architecture involves a parallel resistor network, where each resistor corresponds to a specific voltage drop when a switch is pressed. This voltage drop is detected by an analog input, allowing the microcontroller to determine which switch has been activated based on the resulting voltage level.
The arrangement of resistors should be carefully calculated to ensure that the total voltage range aligns with the microcontroller's analog input specifications. Assuming a typical 5V system, the resistors can be selected to provide distinct voltage levels corresponding to each switch. For instance, a series of resistors could be configured to produce voltages of 0.5V, 1.0V, 1.5V, and so forth, up to the maximum voltage limit that the microcontroller can interpret. This method effectively allows for a compact input system, where a single analog input can manage multiple switches.
In a practical implementation, the microcontroller's firmware would include a routine to read the analog input and determine which switch is pressed by comparing the voltage level against predefined thresholds. Additionally, the firmware could be designed to handle multiple simultaneous switch activations by employing techniques such as voltage averaging or more complex algorithms that can differentiate between overlapping voltage signals.
To construct the circuit, the resistors should be connected in parallel with each momentary switch, ensuring that pressing a switch alters the voltage at the analog input. The circuit would also require a common ground connection and a power supply that matches the microcontroller's operating voltage. The LEDs would be connected to digital outputs on the microcontroller, allowing them to illuminate based on the detected input.
This design not only simplifies the control of multiple tiles but also minimizes the number of required microcontroller pins, making it feasible to create a large interactive display with a relatively small footprint. The project demonstrates the versatility of analog input systems in creating engaging interactive devices, paving the way for innovative applications in gaming and educational tools.I am interested in creating an interactive LED gameboard of some kind (or even a sort of "Stargate" DHD-type sci-fi prop!), where each square or tile is lit up from below by either a single white LED or an RGB combo. It always occurred to me that I`d love it if I could have each tile be responsive to touch. Nothing fancy, just a simple on/off switch. But the project I have in mind would either be 21 RGB tiles or 64 white or monochromatic ones. and that`s a lot of controllers! If I assemble a set of resistors, each selected to resist a discrete percentage of the total analog input voltage, and connect each resistor to a momentary switch, and put them all in parallel on the same analog input circuit, then each switch would lower the voltage by a different amount, and (with the right code, of course) that could be properly interpreted as the depression of that switch, and (for example) the appropriate LED could be illuminated! In other words, for example, if I have switches labeled A through H, and switch A allows the analog input to receive 0.
5V, and switch B allows the analog input to receive 1. 0V, and so on all the way up to H, which provides 8. 0V to the analog input, then it should be simple to write code that interprets each of these discrete voltage amounts as "representing" the depression of a particular switch, so that the rest of the code can respond appropriately. In fact, theoretically, if I come up with the right combination of resistors for each "column" of switches, I could even arrange it so that you could press more than one switch at the same time, and the code would recognize that unique new aggregate resistance properly as the combination of certain depressed switches!
However, even if you *could* only press one button at a time - and that certainly would be easier - that`s still a way to, for example, turn 8 analog inputs into 64 digital inputs! That`s enough to create a fully interactive, light-up chessboard with only an LED64 controller and a single 8/8/8 controller (you could use the other I/O connections for things like GAME SELECT and RESET and whatnot!), or to create a Stargate dialing device, where the tiles light up and unique SFX are triggered as you press them down.
That trick definitely works. I rigged up a system similar to what you`re talking about back when I was in college. I was using a 68HC11 dev board, not an 8/8/8, but the concept is the same. I had no real reason for doing this, I think I was just struck by the idea and wanted to try it. For each button, I used a precision multiturn potentiometer to create a voltage divider that could be tuned to a very specific voltage. I only ended up using five of them on one A/D input, but I`m sure you could cram a lot more in there.
Since the 8/8/8 has 10-bit inputs, you could theoretically increment each button by 5 mV and put 1023 switches on each analog input! Actually, the 0-1000 limitation in the Phidget system would limit you somewhat, but you get the idea.
Realistically though, I bet you could get 20 switches to work reliably on one input without much trouble. Now the problem of identifying multiple buttons simultaneously in a system like this, that`s a tough one.
For that you`ll need to consult someone who has much more free time than I do. Hey, I`m actually working on a project (FINALLY!) that`s using the principle I describe at the top, but now that I actually have the LCD / 8/8/8 unit, I see that the Analog Input has 3 contacts: +5V, ANALOG INPUT and GROUND. Even the diagram for hooking up a simple potentiometer shows that all three contacts are used. I`m afraid my electronics skills are insufficient for me to grasp the concepts, so. if I wanted to build the circuit I describe above, and I just want to use simple resistors (instead of pots that have voltage dividers with which I could hook up to all 3 contacts), so
This article offers a circuit diagram and a discussion on CMOS logic and IC layout for creating a set of attention-getting LED running lights. It details a simple sequential LED flasher or light chaser that can be built, including the...
Any LED can be used for D1 - D10; however, blue LEDs require a higher voltage, which may result in them appearing dimmer compared to red, yellow, or green LEDs. If pin 9 of U2 is left disconnected, the circuit...
This circuit is designed to gradually illuminate and fade a pair of red LEDs (light-emitting diodes). The fading LEDs can be used as 'eyes' in a small pumpkin or skull for Halloween decorations, or as part of a Christmas tree...
This project has two advantages over previous dice circuits. It produces a realistic readout as well as a slow-down feature. These combine to make it one of our most popular games projects. As can been seen in the photo, the...
This flasher circuit functions as a relaxation oscillator, with capacitor C1 discharging periodically through the LED when the Programmable Unijunction Transistor (PUT) is activated. The flashing rate is approximately 100 times per minute, based on the specified component values.
The flasher...
This LED (Light Emitting Diode) display consists of 10 LEDs to indicate the level of an input signal. If the signal is low, only LED #1 will light up. As the signal level increases, the illuminated dot will progress through...
A front wheel with a built-in dynamo was purchased, providing a sine wave output of 30 Vpp at no load. Based on this, a simple power supply was designed using BD911 transistors, which are somewhat oversized for the application, but...
It cannot be 0 volts, as the current does not flow freely due to the presence of the resistor. This results in one side being more negatively charged and the other side more positively charged, as electrons can move more...
Switch S1 allows for direction change (Up/Down), Pot1 adjusts the clock speed, and LED D1 serves as an indicator for the clock speed.
The circuit utilizes a switch (S1) to control the direction of operation, allowing for two modes: upward and...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more