logo elektroda
logo elektroda
X
logo elektroda

Reducing Control Signals for 128x128 Solenoid Grid Multiplexing via Parallel Port

138 21
ADVERTISEMENT
  • #1 21667455
    jhon Lool
    Anonymous  
  • ADVERTISEMENT
  • #2 21667456
    Jos Flores Aranda
    Anonymous  
  • ADVERTISEMENT
  • #3 21667457
    jhon Lool
    Anonymous  
  • ADVERTISEMENT
  • #4 21667458
    Steve Lawson
    Anonymous  
  • #5 21667459
    jhon Lool
    Anonymous  
  • #6 21667460
    Steve Lawson
    Anonymous  
  • #7 21667461
    jhon Lool
    Anonymous  
  • ADVERTISEMENT
  • #8 21667462
    jhon Lool
    Anonymous  
  • #9 21667463
    Steve Lawson
    Anonymous  
  • #10 21667464
    jhon Lool
    Anonymous  
  • #11 21667465
    Steve Lawson
    Anonymous  
  • #12 21667466
    jhon Lool
    Anonymous  
  • #13 21667467
    Steve Lawson
    Anonymous  
  • #14 21667468
    Mark Harrington
    Anonymous  
  • #15 21667469
    jhon Lool
    Anonymous  
  • #16 21667470
    Steve Lawson
    Anonymous  
  • #17 21667471
    Mark Harrington
    Anonymous  
  • #18 21667472
    Mark Harrington
    Anonymous  
  • #19 21667473
    Mark Harrington
    Anonymous  
  • #20 21667474
    Steve Lawson
    Anonymous  
  • #21 21667475
    Steve Lawson
    Anonymous  
  • #22 21667476
    Steve Lawson
    Anonymous  

Topic summary

✨ The discussion addresses reducing the number of control signals required to multiplex a large solenoid grid (128x128) using a parallel port, with a focus on minimizing pin usage. The original approach involves using an old PC parallel port, but alternatives such as microcontrollers with I2C I/O expanders are suggested to reduce pin count. The solenoids only require pulsed activation, not continuous holding, with an update rate of about once per second for the entire grid. Due to the high current demands of solenoids, direct driving from parallel port or shift register outputs (e.g., 74HC595) is insufficient; external driver circuits using transistors (e.g., PN2222A, MPSA32) or dedicated driver ICs are necessary. Opto-isolators are recommended to protect the parallel port and microcontroller from voltage spikes and noise. Multiplexing strategies include dividing the grid into smaller blocks managed by individual microcontrollers or using chained shift registers for rows and columns, though timing constraints for large arrays may be challenging. The use of ferrofluid valves actuated by electromagnets is mentioned as an alternative to solenoids, still requiring similar driving considerations. Key design parameters such as voltage, current, and pulse duration must be determined to select appropriate drivers and protection components like flyback diodes (e.g., 1N4001). Overall, the solution involves combining multiplexing, external drivers, and isolation to safely and efficiently control a large solenoid or electromagnet grid with limited control lines.

FAQ

TL;DR: 74HC595 outputs source about 8 mA; as Steve put it, “you need a driver.” Use shift registers, drivers, diodes, and isolate the PC port. [Elektroda, Steve Lawson, post #21667467]

Why it matters: This FAQ helps makers design large solenoid/electromagnet matrices (up to 128×128) with minimal control lines, safely and reliably from legacy parallel ports or microcontrollers.

Quick Facts

How many control signals do I need for a 128×128 solenoid grid?

Use matrix scanning. Divide the grid into manageable cells (e.g., 8×8 or 16×16), each with a small microcontroller handling rows and columns. A main controller sends serial updates to each cell, potentially via data selectors to minimize lines. This reduces front-end pins dramatically while distributing switching locally. Ensure each cell has sufficient GPIO for its row/column count plus serial IO. Add output drivers sized for coil current. [Elektroda, Steve Lawson, post #21667458]

Can the PC parallel port directly power solenoids or electromagnets?

No. Most solenoids need far more current than a PC’s parallel port can supply. Use the port only for logic-level control and add driver stages powered from a proper supply. Determine your coil voltage and current first, then design the driver accordingly. Protect the port during development. [Elektroda, Steve Lawson, post #21667460]

How fast can I update a 128×128 array at a 1-second frame rate?

At 1 Hz, you have about 61 microseconds per actuator if you drive them sequentially. That pulse may be too short for some coils to actuate reliably. Validate with your specific electromagnet and load. Consider parallelizing by blocks to lengthen per-coil on-time. [Elektroda, Steve Lawson, post #21667463]

Should I use 74HC595 shift registers for rows and columns?

Yes. Chain one set of 74HC595s for rows and another for columns. Clock a bit through columns while stepping the row bit each completed line. Latch outputs per step. However, add external drivers because 74HC595 outputs cannot source typical coil currents safely. [Elektroda, Steve Lawson, post #21667463]

What does “driver” mean here?

A driver is a power stage between logic and the coil. Use transistors or arrays to switch higher current and voltage than logic can. For example, a PN2222A can sink up to about 1 A, while higher-voltage parts like MPSA32 handle higher V. Match devices to coil specs. [Elektroda, Steve Lawson, post #21667467]

How do I protect against inductive kick from coils?

Place a diode across each coil, cathode to the positive supply. Parts like 1N4004 or better clamp the voltage spike when current is switched off. This protects shift registers, microcontrollers, and power rails. Do this on every coil, regardless of control method. [Elektroda, Steve Lawson, post #21667470]

Do I need opto-isolators on the parallel port?

Yes. Isolate the PC from the high-current side. Opto-isolators prevent a driver failure from back-feeding into the motherboard. As Steve said, “Better to blow out one of those” than your port hardware. This also reduces noise-induced misbehavior. [Elektroda, Steve Lawson, post #21667474]

What current limits should I respect on microcontroller ports?

Budget both per-pin and per-port currents. Example PIC parts allow about 25 mA per pin but only around 100 mA per port. Eight pins at 25 mA would exceed port limits. Use external drivers and stagger activations to stay within safe limits. [Elektroda, Mark Harrington, post #21667472]

What is charlie multiplexing, and could it help?

Charlie multiplexing reduces control lines by time-multiplexing outputs, often used in LED matrices. Mark suggested it, but your original diagram needs clarification for coils. For inductive loads, ensure adequate on-time, drivers, and protection before adopting it. [Elektroda, Mark Harrington, post #21667468]

How do I chain 74HC595s to scan a matrix? (3-step)

  1. Daisy-chain 74HC595s for columns and a second chain for rows; share clock and data.
  2. Shift column bits for one row, latch, then advance the row bit one position and repeat.
  3. Add external drivers between 74HC595 outputs and coils for safe current. [Elektroda, Steve Lawson, post #21667463]

Can an I2C I/O expander reduce pin count versus the parallel port?

Yes. An I2C expander lets a microcontroller control many lines using only two pins (SCL, SDA). It’s a clean path if you plan to replace the PC port with USB plus a microcontroller. Ensure the expander drives only logic; keep power switching in drivers. [Elektroda, Jos Flores Aranda, post #21667456]

What update timing did the OP target for smaller grids?

For a 16×16 grid with a 1-second frame, the OP budgeted about 62.5 milliseconds between activations. That generous window eases actuation compared with 128×128 at 1 Hz. Measure your coil’s minimum pulse to confirm. [Elektroda, jhon Lool, post #21667459]

Do the actuators need holding current, or just a pulse?

The OP specified pulse-only operation with a spring return to the off state. That reduces average power but still demands correct peak current and protection components. Size the driver for the pulse current and repetition rate. [Elektroda, jhon Lool, post #21667461]

I’m moving to ferrofluid micro-valves. Does the same drive strategy apply?

Yes. You still energize an electromagnet. Determine required voltage, current, and minimum pulse width for the magnetic structure, and include a flyback diode. Then design the driver and supply around those values. Validate actuation experimentally. [Elektroda, Steve Lawson, post #21667470]

Can limiting active lines reduce total current stress?

Yes. If only one or two ports are on at a time, instantaneous current through a given MCU port remains low. This helps keep within port aggregate limits, but each coil still needs a proper driver stage. [Elektroda, Steve Lawson, post #21667476]
ADVERTISEMENT