MAX-7219 controlling Electromagnets

Hello,I would like to make a 8X8 Electromagnets Matrix which controlled by MAX-7219

the rated voltage of these Electromagnets is 24V. As this result, I use 16 Relays(Input: 3v-32v, Output: 200V Max) as switch,and buy 2 Switching power supplies (Output: 15A, 24V).

I have research some documents about MAX7219. Successfully rebuild a Electromagnets Matrix replaced the little LED Matrix.

BUT, the output voltage of MAX7219 is 5v. in 8X8 matrix, only 5v DC could not lead all the 16 relays worked. Generally, when I turn 64 magnets on, the last column of magnets work normally, the others in very low power state.

I don't know how to solve it. this problem maybe in Circuit

Hi. You said you have found a circuit for this somewhere? Please post a link to that. I cannot imagine how such a circuit as you describe could work, especially using relays!

If I were designing a circuit for 64 electromagnets, I might use 8 tpic6*595 shift registers if the current required by the electromagnets is low enough. Otherwise 8 74hc595 shift registers and 64 MOSFETs.

PaulRB:
Hi. You said you have found a circuit for this somewhere? Please post a link to that. I cannot imagine how such a circuit as you describe could work, especially using relays!

If I were designing a circuit for 64 electromagnets, I might use 8 tpic6*595 shift registers if the current required by the electromagnets is low enough. Otherwise 8 74hc595 shift registers and 64 MOSFETs.

Hi, @PaulRB

the attach file is the circuit blueprint. Sorry, I don't know how to draw a standard one.

in my limited knowledge of that, you said the shift register that I heard first time.

before, I use the <LedControl.h> library wrote program.

#include <LedControl.h>

int DIN = 2;
int CS = 4;
int CLK = 6;

LedControl lc = LedControl(DIN, CLK, CS, 1);

void setup() {
//Serial.begin(9600);
lc.shutdown(0,false);
lc.setIntensity(0,15);
lc.clearDisplay(0);
}

void matrix() {
byte f1[8] = {
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
};

for (int i = 0; i <= 7; i++) {lc.setRow(0,i,f1*);}*
}
void loop() {

  • matrix();*
  • lc.clearDisplay(0);*
    }
    [/td]
    [/tr]
    [/table]
    1 is on, 0 is off.
    could the "74hc595" use the LedControl library?

Sorry, I don't know how to draw a standard one.

That is a shame because unless you use symbols that people can actually understand then no one can interprete what you have done.

Read the how to use this forum sticky post it tells you how to post code, it is not what you did.

Your circuit diagram is hard to understand. However, I still believe this idea will not work.

You said

I have research some documents about MAX7219. Successfully rebuild a Electromagnets Matrix replaced the little LED Matrix.

Please give us a link to the document you found showing how max7219 can control 64 electromagnets. I have never seen this circuit and i am curious how that can be possible.

I do not think led control library will work with any circuit except one based on max7219 chips.

I add 16 relays before the electromagnets pins

I add 16 relays before the electromagnets pins

I can not reconcile that statement with anything in electronics.

The segment pins source current and the digit pins sink current. Do you understand that?

What value have you used for the Iset resistor? This will limit the current the chip can deliver.

(Input: 3v-32v, Output: 200V Max)

That doesn't sound like an electromagnetic relay.

What current is required to turn on your relays?

@Grumpy_Mike, thx

maybe I did not describe clearly.

1, write a program controlled MAX7219 device. you see, all the 64 turn on. I have wrote others, this one just for test.
2, take out the leds display(1088AS), in original MAX7219 board, there are 16 pin jack,upper 8,bottom 8
3, I test “1088AS” out what pins controlling rows or columns with multimeter. meanwhile, I know which pin is positive , which negative electrode.
4, I made a huge 8*8 electromagnets matrix replaced the little LEDs display, building circuit referenced some documents from internet.
5, electromagnets matrix finished, it has 16 pins, 8 positive electrode, 8 negative electrode. I know that the MAX7219 can not drive this big matrix work, so I have to look for power supplied additionally, and the digital signal of MAX7219 control matrix's image which means on/off, by 16 relays.
6, I connect INPUT side of relay with every electrodes and MAX7219's 16 pin jack
7, OUTPUT side of relay connected switch power supplies. in this way, Matrix has enough power
8, In my idea, when program turn any electromagnet on, the corresponding 2 relays(one depends positive , the other depends negative )work, then the power through the relay turning electromagnets on

The segment pins source current and the digit pins sink current. Do you understand that?

I think the source is power supply, and the digit is controlling.
if I have not misunderstood.

What value have you used for the Iset resistor? This will limit the current the chip can deliver.

MAX7219 has a little resistor, but in Matrix, it has no one.

thank you

MAX7219 has a little resistor, but in Matrix, it has no one.

Without this resistor the MAX7219 will not produce an output.

6, I connect INPUT side of relay with every electrodes and MAX7219's 16 pin jack
7, OUTPUT side of relay connected switch power supplies. in this way, Matrix has enough power

A relay ( you still have not told me what relay ) does not have an input and output side. It has a set of contacts which make or break depending on the current flowing through the relay coil. The relay's coil has two connections, are you driving the relay's coil directly from the MAX7219?

I think the source is power supply, and the digit is controlling.
if I have not misunderstood.

I think you might have, or at least be using the wrong words.

You are having problems because you are asking a question here. So in order to help you first of all I have to understand what you have wired up. This is something I still can't get a handle on. A real schematic would tell me what you have but you can't draw one. How on earth did you wire anything up without one?

So please could you tell me:-

  1. What relay do you use? A link to the part would be good.
  2. How are the relay coils wired up.
  3. How are the relay contacts wired up to the magnets?
  4. Are you doing anything to suppress the back EMF from the relay coils?

I think your project is doomed to fail.
This chip scans, so each output is only active 1/8th of the time.
That, and the outputs have to stay within the supply voltage of the chip.

PaulRB gave you the solution in post#1
TPIC6595 chips ( is A, B, or C).

The TPIC6A595 can direcly drive a eight 24volt <350mA solenoids.
No other parts needed, apart from a 100n power supply decoupling cap per chip.
Eight of those chips can be daisy-chained for 64 solenoids.
Leo..

While you are right in what you say I think I have figured out what he is trying to do and it is a lot more complex than this.

I think the OP is trying to get 8 relays to follow the row scan and another 8 to follow the column scan. There are major snags with this.
First the relays can not respond anywhere like the speed of the row scan, so all the row relays will be on all the time. Then the column scan is only on when an LED is on. But that LED can be on any row in the matrix and that relay will be on.
So the information about what LED is on is lost. Therefore you can not use this chip for this purpose.

Next if he does as is recommended and has shift registers controlling the relays then he can control which one magnet is on at any time. He can not control more than one magnet to be on at any one time. This is because the speed of the multiplexing is governed by the maximum speed of the relay and this is longer than a magnetic field from the electro magnets will last.

Also each magnet will need a seriese diode with it to stop the matrix shorting out.

I am not sure if these restrictions are acceptable because we know nothing of the reason for this.

MAX7219 muxes at 800 Hz. Relays will chatter them selves to death pretty quickly.

Grumpy_Mike:
if he does as is recommended and has shift registers controlling the relays then he can control which one magnet is on at any time. He can not control more than one magnet to be on at any one time. This is because the speed of the multiplexing...

But the suggested solution does not involve multiplexing. The 8 shift registers would provide an output for each individual relay.

Doesn't the MAX7219 multiplex it's outputs all the time?
If multiplexing an 8-digit 7-segment display would stop, it could burn out the then active segments.
Leo..

  1. What relay do you use? A link to the part would be good.
  2. How are the relay coils wired up.
  3. How are the relay contacts wired up to the magnets?
  4. Are you doing anything to suppress the back EMF from the relay coils?

1,yeah,the relay is solid state relay, HHG1-0/032f-20 1A

2&3, I wired them following their electrode:
(1), positive electrode, make sure that the wire connected from MAX7219 is positive, another connecting GND

I tested the pin jack corresponding Row or Column. "8+" means Column No.8, "3-" means Row No.3.


electromagnets replace these LEDs.


red wire is positive electrode, black wire is negative electrode.
(2), negative electrode, make sure that the wire connected from MAX7219 is negative, another connecting VCC 5V from Arduino UNO

(3), OUTPUT also following the wire's electrode, 8 "positive" relays wired switch power supply V+, 8 "negative "relays wired it's V-. other wired electromagnets. also, I distinguish them. it means every relays series connecting with every rows and columns.

(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.

==============================
hi,@Wawa

In my dictionary, "fail" and "half success" are synonyms. :smiley:

but, I am not sure the 8 of shift registers could control them prefect. Now, I am searching the Large LEDs display control driver board in internet. But, you know, so expensive.

===============================
thank you all again
=======edit: when I writing this reply, I find 4 new suggestions came to the fore====
@CrossRoads

MAX7219 muxes at 800 Hz. Relays will chatter them selves to death pretty quickly.

Yes! 1/4 of 64 electromagnets could work normally with crazy noise as a large hive, other 3/4 work weakly.

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.

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.
Leo..

(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.

PaulRB:
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.

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:

lc.clearDisplay(0);

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.

"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.

http://www.crossroadsfencing.com/BobuinoRev17/