Turning analog inputs into multi-switch digital inputs
Not rated
18,207
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
A digital thermometer is utilized for measuring room temperature. This project serves as a foundational exercise for beginners to comprehend the functions of various pins on the PIC16F877A microcontroller. The design incorporates the analog-to-digital conversion (ADC) capabilities of the...
I built this cable for my Casio QV-200 digital camera, it should work for many Casio models. It's basically an inverting buffer/converter to/from RS-232 voltage levels from/to CMOS levels. Why Casio didn't put this inside the camera like everyone...
The International Rectifier IRAM109-015SD is a multi-chip hybrid integrated circuit designed specifically for low-power appliance motor control applications, including fans, pumps, and refrigerator compressors. Its compact single in-line package (SIP-S) optimizes PCB space. The device includes several built-in protection...
The BPS Servo Controller - Digital is a comprehensive metering and control solution designed for servo stabilizers, accommodating a wide range of input voltages and load requirements. This system minimizes production overheads such as wiring and testing, thereby enhancing...
The TDC1808/TDC1809 is a pair of wireless remote control transmitter and receiver components. They utilize an internal antenna to transmit both digital and analog signals. These components are suitable for various wireless remote control devices. Key features include compact...
This device supports up to 8 analog inputs with a voltage range of 0 to 5 volts, generating selectable MIDI control output commands. The analog inputs can include rotary or slider potentiometers connected to the 0 to 5 volts...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more