Problem with logic level converter and stepper driver. Please Help.

Hi,

i am running this setup to control a stepper motor:

Unfortunately the stepper doesnt move a bit. I attached the schematics of my circuit, please take a look and tell me what i did wrong.

Here is what i do with Output enable in my code:

byte llcPin = 11;
pinMode(llcPin, OUTPUT);
digitalWrite(llcPin, HIGH);

Please help, thanks so much!

The answer to your question is clearly indicated in the manual (pg-6, section-4, fig-2) for the stepper driver.
In the manual the "Controller represents the arduino. It is shown with open collector outputs, which SINK
current. If you replace the controller with an arduino , in order to SINK the current, ALL of the signals
from arduino must be ACTIVE LOW, NOT active HIGH. This is because ALL of the signals from the controller are in fact connected to the CATHODE of the opto isolator leds. You need to use a LOW to turn
ON ANY stepper driver signal, NOT a HIGH. Also, to be perfectly clear. It is STANDARD proceedure to
ALWAYS isolate the controller by using opto-isolators at the controller end as well. If you wish to do that
and have any questions about how to do it , almost anyone here on the forum can tell you. [EDIT]

FYI,
[EDIT]
When you get time you really should upload a photo or an avatar image,… (such as attached )
Anything that shows you made the effort, and you can still remain anonymous.

avatar_woman.jpg

A blank avatar generally implies you are either too lazy to pick an avatar or don’t know how, either of which do not reflect well on your image as a member , if you get my drift.

If you wish to insult lots of people you’ve never met, you are going the right way about it.

Feel free to ignore requests for biometric data from strangers.

No offense, but judging from your avatar name I am assuming you have no electronics experience and that is why you did not notice the open collector configuration of the controller.

This is even more offensive IMO, even if it starts with 'no offence' you just know your going to be offended.

Adafruit: We also add 0.1uF caps onto both sides and a 10K pull-up resistor on the output enable pin so you can use it right out of the box!

No need to mess with the enable pin.

Ignore Prospero Raschemmel, he's having a bad day, tortured by monsters from the Id, in some far away Jungian nightmare! ;) :P

Ask away and crack on, it's the internet, not diffusing a bomb! Careful using a female avy name, it often attracts prejudice or attention.

[EDIT]

@Foggiest,

Ignore Prospero Raschemmel, he's having a bad day, tortured by monsters from the Id, in some far away Jungian nightmare!

FYI, Freud came up with the Id Ego and SuperEgo, not Jung. FREUD:Id, ego,_and_super-ego If you recall, it was "Monsters from the ID" that caused the Krell machinery to generate the monster that was melting his way into the Control Room, 1 MW at a time, (the scene that gave me nightmares) As you may recall, when Leslie Nielson asked the Professor how much power the machine could draw to melt the walls the Professor replied "unlimited" . Each dial represented one order of magnitude and the dials stretched all the way around the room. . . I can tell by your knowledge and understanding of the Forbidden Planet that you were probably in the same theater I was when I saw it. If you didn't have nightmares it was because you probably covered your eyes. Just for the record, they didn't have PG-13 in 1957 and I was only 8 yrs old so trying to make me feel guilty for having nightmares as an 8 yr old is a bit insensitive ...

:grin: @MarkT,

Feel free to ignore requests for biometric data from strangers.

Dude, this makes no sense. How can an avatar image of Donald Duck be construed as biometric data ? What that all about ? Who's requesting biometric data exactly ? I clearly said any image, not necessarily a photo. Read it again:

When you get time you really should upload a photo or an avatar image,...

Your comment makes absolutely no sense.

Actually, I'm really not such a bad guy once you get to know me...Yeah, I say what I think. So what ? It' just my opinion and I haven't insulted anyone. I am drawing a conclusion based on an observation. It takes 30 sec to pick an avatar image and upload and you are not compromising any personal data. To suggest an pre-made image is biometric data is totally absurd. "If the shoe fits....wear it.." If it doesn't why should you care ?

The level conversion is carried out by the transistors.

Excellent point. I neglected to mention that but I was distracted by the incorrect logic in the code.

raschemmel: @MarkT,

Dude, this makes no sense. How can an avatar image of Donald Duck be construed as biometric data ? What that all about ? Who's requesting biometric data exactly ? I clearly said any image, not necessarily a photo. Read it again: Your comment makes absolutely no sense.

I'll let the OP decide that, just pointing out we're not all like you.

@raschemmel : your prejudices have no place on this forum. Please keep them to yourself.

I'll let the OP decide that, just pointing out we're not all like you.

Thank you for sharing...

It would be nice to hear from the OP, about anything ...

@AWOL,

@raschemmel : your prejudices have no place on this forum. Please keep them to yourself.

Acknowledged. Let me know if there is any other comments would like me to remove. Robert

JohnLincoln: I did notice on the Adafruit link, that it said:

There is no need to use this logic level converter. You can use open collector npn transistors to switch the opto-isolators. You switch the transistor on using the 3.3V Due outputs. The level conversion is carried out by the transistors.

What transistors would be suitable and what resistors should be used in this circuit? I d On the other side, i do have the LLC already, so i could as well use it. Can anyone confirm from my schematic, that i hooked up the LLC correctly?

Riva: No need to mess with the enable pin.

Are you saying, i should not use the enable Pin at all because its already auto-enabled?

PS: Thank you all for your answers. Please leave my avatar out of discussion here, it is not important now.

Julia85:
Are you saying, i should not use the enable Pin at all because its already auto-enabled?

From the Adafruit page you linked to in your first post…

This breakout saves you from having to solder the very fine pitch packages that this chip comes with. We also add 0.1uF caps onto both sides and a 10K pull-up resistor on the output enable pin so you can use it right out of the box!

Riva: From the Adafruit page you linked to in your first post...

Ok, thanks! I will leave it unconnected then as i want it to be enabled all the time. I will test my setup tomorrow and see if everything works.

What transistors would be suitable and what resistors should be used in this circuit? I d On the other side, i do have the LLC already, so i could as well use it. Can anyone confirm from my schematic, that i hooked up the LLC correctly?

Yes, it is connected correctly, but as already mentioned you don't need an LLC , you need transistors. You can use general purpose NPN type like 2N3904 or 2N2222. (with 470 ohm base resistors in series) FYI, As I mentioned before,

The answer to your question is clearly indicated in the manual (pg-6, section-4, fig-2) of the stepper driver.

If I were doing it I would utilize the Enable for what it was intended for, specifically, to be connected to a panel switch labeled Enable/Disable so if you want to disable the motors to do something without powering the entire system down you simply disable the motors while you're working on the sensors or whatever... Since it is pulled up internally, a switch to GND will Disable it.

I built a transistor circuit and it works fine. 8) Why and how would i also use opto couplers on the controller side, since they are already at the driver side?

What about common ground of the arduino and the driver? is this obsolete when using opto-couplers?

Thanks,

Julia

Welcome back.

An opto coupler is a device that combines a led, a transparent isolation barrier , and a photo-transistor in one package. You drive the led with a resistor in series using almost any dc voltage you want, compensating for the voltage with the resistance. Higher the input voltage , higher the resistor value. You get the forward current spec from the datasheet and use Ohms Law to calculate the correct resistor value. You can even drive it with ac , creating a zero-crossing detector. The output , being a transistor , replaces the transistors you are currently using with the added benefit of electrical isolation note this spec on the datasheet :

Isolation test voltage VISO 5000 VRMS

No, that’s not a misprint. It says 5000V

So you wire the output stage just like you wired the transistors you have working now. Nothing different. It is an open collector output so it is sinking the current, which, presumably is what you are doing. All you have to do is read the datasheet, find the forward current;

Forward current IF 50 mA

apply Ohm’s Law:

5V/0.050A = 100 ohms.

Done. Put a 100 ohm resistor in series with the ANODE pin (A)(pin-1), connect the CATHODE (C)(pin-2) to GND , connect the other end of the 100 ohm resistor to you digital output pin and you’re in business.

What about common ground of the arduino and the driver? is this obsolete when using opto-couplers?

Think about it. You’re using an optocoupler because you want isolation so the second you plug the opto into your circuit and wire it properly , your circuit has TWO SIDES .

1-arduino side , with arduino GND going to PIN-2 (CATHODE) of the opto.
2. Stepper motor side, which we sometimes like to call “the OUTSIDE WORLD”) with the opto TRANSISTOR EMITTER (E)(pin-4) CONNECTED TO THE STEPPER MOTOR GND. Once you have done that, get an ohm meter and put it on resistance mode and put one lead on the arduino GND and the OTHER lead on the STEPPER motor GND. What do you expect to see ?