Go Down

Topic: MAX-7219 controlling Electromagnets (Read 2831 times) previous topic - next topic


Jul 25, 2016, 08:26 am Last Edit: Jul 25, 2016, 08:26 am by dlloyd
I'm quite sure the switching speed of your solid state relays is way too slow. Could be anything from 3 to 20 milliseconds turn on and turn off time.


Jul 25, 2016, 09:01 am Last Edit: Jul 25, 2016, 09:13 am by Wawa
Post#14 explained what you're trying to do.
Solid state relays driven by a MAX7219 will never work though, because of the constant scanning of the matrix.
If you had only asked before you started this project.

Measure the resistance of one 24volt solenoid. Calculate the current.
If it works out under 350mA, then replace the MAX7219 and all the solid state relays with eight TPIC chips.

That chip family can also drive monster-size (common anode) 7-segment displays.

You can even drive the eight relay chips AND all the large display chips with just three control wires from the Arduino.


(4), Sorry, I really do not understand what the EMF meaning. if EMF is electromotive force, I did nothing to suppress it. Intuitively, I think that why the Row No.1 of the electromagnets can be energized strongļ¼Œothers (2-8) on low power state.
That only applies to relays with coils.

But the suggested solution does not involve multiplexing. The 8 shift registers would provide an output for each individual relay.
Yes but the control of 64 magnets from 16 relays does.

I said:-
So the information about what LED is on is lost. Therefore you can not use this chip for this purpose.
Do you understand that?

Also each magnet will need a seriese diode with it to stop the matrix shorting out.
Do you understand that?


Hello, guys. this 2 days I had finished current version of my project, also found some new questions

first, thanks to @Grumpy_Mike, @Wawa, @PaulRB and ......., for your patience. I am a Chinese, 4 months ago, I had decided to find a new way to do some interesting things with ferrofluid. Theretofore, I was a animator artist and painter worked in Beijing.

I had spent one month to research how to DIY ferrofluid, 2 months to learn basic C++ programming in Arduino IDE and VIM. when I finished that, I begun to start this project in early of this July. So, there are sometime could I not clearly know your advices, don't mind. I certainly do some research trying to know what your mean.

new questions found in this time, this version(MAX7219) :

1, the negative electrode of MAX7219, their connected voltage is lower than 3V. Output voltage of those positive electrodes of MAX7219 is 5V,which means regular to relays. As this result, negative side's relay can now work though, sometime.
To deal with it, I add a NEW MAX7219. 2 chips were named A-MAX, B-MAX. In program,Arduino send message to A-MAX is (x, y); B-MAX is (y, x). I use B-MAX chips' positive PINs connected negative side relays that make sure them work.  

Code: [Select]
int getMatrixXY(byte m[], int x, int y){
  byte row = m[x];
  return row >>(7-y) & 1;  

void setMatrixXY(byte m[], int x, int y, int value){
    m[x] |= (value << (7-y));

void rotateMatrix(byte target[], byte src[]){
  for (int x=0; x <= 7; x++){
    for ( int y=0; y <= 7; y++){
      setMatrixXY(target, x, y, getMatrixXY(src, y, x));  

2, BUT this time, I have ignored that electromagnet have no starting voltage design. as @Grumpy_Mike said, I didn't series connect a diode with every electromagnet, made sure others not work. So the effect of ferrofluid is a big cross, not points designed.


this morning, I have bought ten of TPIC6B595 and some new relays . I believed that I have to spend more than 2 weeks to learn new programming with TPIC chips and redesign new scheme.


@Grumpy_Mike ,

So the information about what LED is on is lost. Therefore you can not use this chip for this purpose.
I have experienced that. BUT, I find a odd way to solve this. cancel this in program:

Code: [Select]

and write a conditional judge function to shut all electromagnets down in control.

At present, I do not find what differences with final effect in visual between other way. I know you are right, and I just would like to confirm if there are some simple way.

Also each magnet will need a seriese diode with it to stop the matrix shorting out.
If I insist on using 16 relays to control 64 electromagnets, I have to follow this principles your signed.
new question: can I use 2 TPIC chips controlling 16 relays? I am not sure whether these information that including on/off lost.  


Jul 29, 2016, 03:41 pm Last Edit: Jul 29, 2016, 03:42 pm by CrossRoads
"can I use 2 TPIC chips controlling 16 relays? "
Yes you can. Compare the relay turn on current against the amount of current the TPIC part can sink that you select.
Here is an Arduino driving 20 shift registers, each board uses a TPIC6C595 to sink coil current.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up