# Raspberry pi, Stepper Motor and level shifter

It is my understanding that a Rasperry Pi cant handle 5V on the GND-pin. For that reason I got myself a level-shifter which is supposed to be able to change the output from 3.3V to 5V. I need it to be 5V because that's what the stepper driver operates on.

I don't know if the 5v-output is programmable or if its just a steady stream of power. If it's programmable i assume i could plug pin2 directly into the stepper driver and send it back through the level shifter making it 3.3v that i can connect to a GND-pin.

The connection from the stepper driver to the motor should be fine.

This is the code im using trying to activate the stepper driver

import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from time import sleep # Import the sleep function from the time module
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setup(3, GPIO.OUT, initial=GPIO.LOW) # Set pin 3 to be an output pin and
set initial value to low (off)
for x in range(0,100):
GPIO.output(3, GPIO.HIGH) # Turn on
sleep(0.1) # Sleep for 0.1 second
GPIO.output(3, GPIO.LOW) # Turn off
sleep(0.1) # Sleep for 1 second


Stepper driver: http://sahel.rs/media/sah/techdocs/hb860h_manual.pdf

• Can you share the schematics for your raspberry pi board, data sheet for the level shifter and stepper driver? – Mahendra Gunawardena Feb 10 at 19:27
• Im not sure what you mean by schematics, but if I understand correctly, the schematics for the Raspberry Pi is what you can see in upper photo on the left. For the level converter and stepper controller i can sadly only give you the links (added them above). I found out that the level shifter seems to only give me 3,3v on the high voltage side. Can it be due to it being I2C? – Nlas Feb 10 at 19:43
• There are many versions of Raspberry Pi. Here is the link raspberrypi products. It is worth while tell us more about the hardware. – Mahendra Gunawardena Feb 10 at 23:37
• What is actually your question: if you can connect without the lever shifter? or you have a problem in the software and it is not working? – Adrian Maire Feb 11 at 10:41
• The 5V is not programmable. It's a direct connection to the raspberry pi power rail. – Drew Feb 12 at 8:32