Go Down

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

#### Wu-Mokun-Tian

##### Jul 23, 2016, 04:13 pm
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

#### PaulRB

#1
##### Jul 23, 2016, 04:35 pmLast Edit: Jul 23, 2016, 04:39 pm by 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.

#### Wu-Mokun-Tian

#2
##### Jul 24, 2016, 04:46 amLast Edit: Jul 24, 2016, 04:55 am by Wu-Mokun-Tian
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 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);}

1 is on, 0 is off.

could the "74hc595" use the LedControl library?

#### Grumpy_Mike

#3
##### Jul 24, 2016, 05:57 am
Quote
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.

#### PaulRB

#4
##### Jul 24, 2016, 08:55 amLast Edit: Jul 24, 2016, 09:12 am by PaulRB

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

You said
Quote
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.

#### Wu-Mokun-Tian

#5
##### Jul 24, 2016, 01:45 pm

I add 16 relays before the electromagnets pins

#### Grumpy_Mike

#6
##### Jul 24, 2016, 02:29 pm
Quote
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.
Quote
(Input: 3v-32v, Output： 200V Max）
That doesn't sound like an electromagnetic relay.

What current is required to turn on your relays?

#### Wu-Mokun-Tian

#7
##### Jul 24, 2016, 05:44 pm
@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

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

Quote
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

#### Grumpy_Mike

#8
##### Jul 24, 2016, 08:09 pmLast Edit: Jul 24, 2016, 08:10 pm by Grumpy_Mike
Quote
MAX7219 has a little resistor, but in Matrix, it has no one.
Without this resistor the MAX7219 will not produce an output.

Quote
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?

Quote
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?

#### Wawa

#9
##### Jul 25, 2016, 02:39 am
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
TPIC6*595 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..

#### Grumpy_Mike

#10
##### Jul 25, 2016, 06:03 amLast Edit: Jul 25, 2016, 06:09 am by Grumpy_Mike
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.

#11
##### Jul 25, 2016, 06:55 am
MAX7219 muxes at 800 Hz. Relays will chatter them selves to death pretty quickly.
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.

#### PaulRB

#12
##### Jul 25, 2016, 07:34 am
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.

#### Wawa

#13
##### Jul 25, 2016, 07:42 am
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..

#### Wu-Mokun-Tian

#14
##### Jul 25, 2016, 08:07 amLast Edit: Jul 25, 2016, 08:28 am by Wu-Mokun-Tian
Quote
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.

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====