Hi guys,
I am currently working on a project which is using two stepper motors controlled by this board: http://www.ebay.co.uk/itm/251218184781? ... 1497.l2649 which obviously takes up the 8 GPIO pins.
I would also like to control an electronic switch, and i understand a relay is out of the question due to low current from the pi. How can I control something like a transistor from the pi, when I have taken up the 8 GPIO pins?
Many thanks,
Frank
-
- Posts: 4
- Joined: Tue Mar 12, 2013 3:00 pm
-
- Posts: 4
- Joined: Tue Mar 12, 2013 3:00 pm
Re: GPIO to control stepper motors and switch.
Or am I getting confused with the green pins, and which ones are actual GPIO pins?
Re: GPIO to control stepper motors and switch.
See http://elinux.org/Rpi_Low-level_peripherals for P1
The green pins are the general gpios.
You can also use txd, rxd, sda, scl, miso, mosi, sclk, ce0, ce1 if you don't need their special functionality.
Just open them as inputs or outputs.
The green pins are the general gpios.
You can also use txd, rxd, sda, scl, miso, mosi, sclk, ce0, ce1 if you don't need their special functionality.
Just open them as inputs or outputs.
-
- Posts: 4
- Joined: Tue Mar 12, 2013 3:00 pm
Re: GPIO to control stepper motors and switch.
That's fantastic news, I was getting worried then! For anyone else looking at this thread I will be using this guide for using a relay with the Raspbery Pi: http://www.susa.net/wordpress/2012/06/r ... sing-gpio/
Re: GPIO to control stepper motors and switch.
On Rev2 boards there are four more gpios available on P5 (gpios 28-31) to make a total of 21 usable gpios.
- alexeames
- Forum Moderator
- Posts: 2874
- Joined: Sat Mar 03, 2012 11:57 am
- Location: UK
- Contact: Website
Re: GPIO to control stepper motors and switch.
But there's a small catch.joan wrote:On Rev2 boards there are four more gpios available on P5 (gpios 28-31) to make a total of 21 usable gpios.

You have to solder on that header yourself.
Alex Eames RasPi.TV, RasP.iO
Re: GPIO to control stepper motors and switch.
Also if you are controlling the stepper in the normal 4 step sequence then the 4 drive signals are actually in two pairs so 2 that GPIO pins per motor is sufficient (rather than 4) providing one can invert the signals.
Coil 1 = GPIO-A
Coil 2 = Not GPIO-A
Coil 3 = GPIO-B
Coil 4 = Not GPIO-B
If you are using a ULN2803 and you have access to the pins then this can be done by using spare drivers on the ULN device as inverters with some pull up resistors, but you may not be able to do that easily with the board you are using.
The principle and circuit is well explained on page 13 of
http://www.philadelphia.edu.jo/academic ... erface.pdf
Driving all 4 signals independently does allow half stepping control.
Coil 1 = GPIO-A
Coil 2 = Not GPIO-A
Coil 3 = GPIO-B
Coil 4 = Not GPIO-B
If you are using a ULN2803 and you have access to the pins then this can be done by using spare drivers on the ULN device as inverters with some pull up resistors, but you may not be able to do that easily with the board you are using.
The principle and circuit is well explained on page 13 of
http://www.philadelphia.edu.jo/academic ... erface.pdf
Driving all 4 signals independently does allow half stepping control.
Re: GPIO to control stepper motors and switch.
btidey wrote: The principle and circuit is well explained on page 13 of
http://www.philadelphia.edu.jo/academic ... erface.pdf
Driving all 4 signals independently does allow half stepping control.
Thanks for that link. There's some useful stuff in there, and explained really well for us mortals!
Re: GPIO to control stepper motors and switch.
Are you using 5 or 4 wire stepper motors. If it is 5 or 6 wire you can use a darlington array. There is a very cheap little IC called ULN2003A that is more than capable of shifting enough current to drive a stepper motor. or relay or any other high current device from the Pi
Gee The Rabid Inventor 

-
- Posts: 4
- Joined: Tue Mar 12, 2013 3:00 pm
Re: GPIO to control stepper motors and switch.
I am using a: ULN2803 to control two: 28BYJ-48 5 VDC which is currently taking up 8 pins + two for power. But aslong as I can use other pins as regular GPIO pins ( which as the above posts state, i can ), I will be also powering two replay switches using this: http://www.susa.net/wordpress/2012/06/r ... sing-gpio/
Re: GPIO to control stepper motors and switch.
You can use smart stepper driver like this:
EasyDriver V4.4 Stepper Motor Driver Board for Arduino
It has one input for direction and another for steps. It can also do microsteps to avoid vibrations.
It is compatible with GPIO voltages and includes output protection.
It starts each step with higher voltage which decays to achieve higher reliability of steps and speed of steps. No regular H bridge can perform that.
EasyDriver V4.4 Stepper Motor Driver Board for Arduino
It has one input for direction and another for steps. It can also do microsteps to avoid vibrations.
It is compatible with GPIO voltages and includes output protection.
It starts each step with higher voltage which decays to achieve higher reliability of steps and speed of steps. No regular H bridge can perform that.