0
\$\begingroup\$

My project involves 100 small solenoids, that I either have drive individually, or hopefully I can drive in a multiplexed configuration, the same way LED displays are driven. Then I only need 20 control pins on the MCU.

Each solenoid would have a series diode to make the multiplexing work, plus a parallel flyback diode to clamp the turn off spikes.

10x10 multiplexing means a 10% duty cycle for each solenoid. I need to figure out a way to prevent the solenoids from vibrating from the low duty cycle. My first thought was to just pick a frequency ten or more times higher than the solenoid time constant. For example if I have a time constant of 10 ms, I just drive them at 1 kHz. But I have limited practical experience with solenoids, and if there will be problems with this approach (heating, vibrations, etc). What is the lowest and highest practical drive frequency to use for a solenoid with a specific inductance and resistance?

\$\endgroup\$
3
  • \$\begingroup\$ I would not multiplex solenoids. Problems can arise with jitter in your software (Service Communication, long ISR, whatever....) I would either use I2C/SPI Port-Expanders (Ready made ICs or "custom" CPLD/MCU) or simple Shift-Registers. Also, you may have to consider what happens when your MCU suddenly hangs/resets: There is no steady state for all realys, so you could damage machinery depending on the application. \$\endgroup\$ Commented Jan 3 at 9:48
  • \$\begingroup\$ @ElectronicsStudent No defined steady state is no problem for my project. I will have flyback diodes on all solenoids, and a large capacitor on VCC near the controller. Wouldn't that prevent any problems with jitter? \$\endgroup\$ Commented Jan 3 at 10:09
  • 1
    \$\begingroup\$ The control pins of the MCU are not rated for the curents needed to drive multiplexed solenoids. You need driver ICs for higher current and voltages. Read the datasheet of the MCU very carefully and look for the limits. \$\endgroup\$
    – Uwe
    Commented Jan 3 at 10:31

2 Answers 2

2
\$\begingroup\$

As suggested in the comments, the best way to do it is using IO Expanders. Multiplexing a solenoid would make a lot of noise.

However, for the sake of the experiment, if you like to do it by multiplexing, you need to consider that when you use a 10% duty cycle for each solenoid, no matter the frequency, the DC voltage on your solenoid will be 10% of the supplied voltage. This means, for example, if the solenoid is 12v, you would need a 120v supply! That is a very bad idea. Despite of the danger of working with high voltages, If one of the cycles deviates from 10%, it can easily damage the solenoid. Also, you need to make sure that the higher voltage will not saturate the solenoid core during the 10% duty cycle. That is very unlikely; meaning the core will saturate very fast, the current increases and the solenoid will be damaged.

The other solution would be to add a big enough capacitor parallel to the solenoid. This capacitor should hold enough energy to keep the solenoid voltage above the minimum acceptable voltage during the 90% off period. This means you need high current switches/MOSFETs to charge the capacitor during the 10% on time. Again, this is not a good idea to do so. That high inrush current will create a lot of EMI noise.

\$\endgroup\$
4
  • \$\begingroup\$ Thanks. I think most answers assume too much about my project. Voltage/current is no problem in my case because it is really small solenoids. Around 100 ohm, only a few mA to drive, 0.1-0.3 V. I will wind them myself around an iron core, and their action is only 1 mm. They will have a series resistance to set the current to match the selected duty cycle. I was thinking about adding a capacitor in parallel like you mentioned, but I think that if I pick a high enough frequency, the capacitor will not make a difference. \$\endgroup\$ Commented Jan 3 at 12:12
  • 1
    \$\begingroup\$ Well, you are right about the assumption. I assume you are using a transistor to drive the solenoid. Don't connect them directly. When using a single transistor (not a totem pole), the current is going in one direction. This means by turning on the transistor, you charge the capacitor in a short time. When the transistor is off, the cap will keep the solenoid on. The frequency should not be an issue as long as the switch can turn on fast enough (this will be an issue if you are planning to go with MHz). \$\endgroup\$
    – Saadat
    Commented Jan 3 at 12:37
  • \$\begingroup\$ Probably a good idea to add that information to the question. This way, someone else might come up with a better solution. \$\endgroup\$
    – Saadat
    Commented Jan 3 at 12:38
  • \$\begingroup\$ I appreciate that you and others try to help me with my project, but no one seems to pay attention to what the question is. I already know that I will try multiplexing and that it probably will work. My details don't matter, and I left them out to make the question short. Given a solenoid with a specific resistance, impedance and duty cycle, what would be a good frequency? \$\endgroup\$ Commented Jan 3 at 17:22
0
\$\begingroup\$

Considering the criteria outlined in your question and comments:

  • Activation voltage for the relay is a maximum of 0.3V.
  • Each coil has an approximate resistance of 100 ohms.
  • The inductance of the coils is currently unknown.
  • There are a total of 100 solenoids.
  • The time constant for the solenoid is also unknown.

Given the absence of some crucial details:

  • What is the turn-on time after the initial application of voltage?
  • How long does the solenoid remain active after the removal of voltage/current?
  • What is the desired drive voltage (1V8, 3V3, 5V0)?

i personally would use one of the following implementations:

(1) Large FPGA/CPLD:

Use a low-complexity, high-pin-count FPGA/CPLD to create a custom 'SPI/I2C IO-Slave'. Multiplexing is still an option, such as a 5x20 configuration to enhance the durty cycle, or you can opt for direct control of all elements.

(2) Ready-made port expanders:

You can use 'Port-Expander' ICs (e.g., dedicated ones via SPI/I2C or simple serial shift registers). These can be employed to reconfigure your multiplexing matrix, for instance, to a 5x20 setup again. Alternatively, you can use them to drive each solenoid directly.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks for taking the time, but if you check the OP again my question is: given that I have a solenoid with a specific resistance and inductance, and drive it at a specific duty cycle, what is a good frequency to use, and are there drawbacks to using even higher frequencies? \$\endgroup\$ Commented Jan 3 at 17:27
  • \$\begingroup\$ FYI, this is what I was planning to build, as a present to a friend of mine who is a musician. But that seems moot now when I just discovered that they already exist. youtube.com/watch?v=_ChXIuDt3W4 \$\endgroup\$ Commented Jan 3 at 17:37
  • 1
    \$\begingroup\$ @BjörnMorén I can understand your perspective, but I cannot answer your question in detail or in general. Nonetheless, I'd like to suggest taking a step back from the ideas circulating your mind. From my perspective, it can be beneficial to evaluate the potential benefits of multiplexing vs. the potential drawbacks. I often found myself in situations where I tried to simplify a design and made it a lot more complex by doing so. I respect and encourage taking unknown roads, but most of the time, I just want to be home for dinner on time and without headaches. \$\endgroup\$ Commented Jan 3 at 18:49
  • 2
    \$\begingroup\$ @BjörnMorén A USB/Serial converter IC with a dozen or so shift registers on a custom PCB seems like my everyday highway to/from the office to me. Multiplexing solenoids, which require accurate and jitter-free timing (your application is music), sounds like a bumpy cross-country road. \$\endgroup\$ Commented Jan 3 at 18:53
  • \$\begingroup\$ What you write makes sense. \$\endgroup\$ Commented Jan 3 at 20:40

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.