Introduction: VISUINO Remote Control Module + Stepper Motor + OLED Lcd + Drv8825 Driver
In this tutorial we will use OLED Lcd, Stepper motor, Remote control, stepper driver DRV8825 and Visuino to make a stepper motor rotate when we push a button on our remote control.
Watch a demonstration video.
Step 1: What You Will Need
- Arduino Mega (can be any other Arduino)
- Breadboard (or breadboard shield)
- OLED Lcd
- Jumper wires
- Red LED (or any other color)
- Pull-up resistor (50k ohm)
- Stepper motor driver DRV8825
- Remote Control 315MHZ 4 Channel Wireless
- Stepper motor 28BYJ48 (can be any other stepper, just make sure that you know how to wire it on controler)
- Visuino program: Download Visuino
Step 2: The Circuit
The connections are pretty easy, see the above image with the breadboard circuit schematic.
- Connect breadboard positive pin to Arduino 5V pin and connect the breadboard negative pin to Arduino GND pin.
- Connect positive pin of LED to resistor and the other to GND pin on breadboard.
- Connect resistor pin to breadboard positive pin and other resistor pin to button pin.
- Connect OLED lcd positive pin to breadboard positive pin and OLED lcd negative (gnd) pin to breadboard negative pin.
- Connect OLED lcd SCL pin to Arduino SCL pin
- Connect Remote Control + pin to breadboard positive pin
- Connect Remote Control GND pin to breadboard negative pin
- Connect Remote Control D3 pin to Arduino pin(3)
- Connect Remote Control D2 pin to Arduino pin(4)
- Connect DRV8825 RESET and SLEEP pin to breadboard positive pin
- Connect DRV8825 GND pin to breadboard negative pin
- Connect DRV8825 DIR pin to Arduino pin (5)
- Connect DRV8825 STEP pin to Arduino pin (6)
- Connect Power Supply for the motor to DRV8825 VMOT and GND
- Connect Capacitor across VMOT and GND
- Connect stepper motor as shown on the picture.
(note that this motor is UNIPOLAR but the driver is used for BIPOLAR motors, so we will wire this motor as it would be BIPOLAR, this means that we will left one wire unconnected)
**if the motor is humming and not moving when you run the circuit, it means that the wires of the motor are not connected correctly
**To check what wires are A1,A2 or B1,B2 on a motor use multimeter (beep function) and connect wires to it, if it beeps it means you have found the right pair
Step 3: Start Visuino, and Select the Arduino MEGA Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program ESP 8266!
The Visuino: https://www.visuino.eu also needs to be installed.
Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino
When the dialog appears, select "Arduino MEGA 2560" as shown on Picture 2
Step 4: Add and Connect Pulse Generator, Logic Gates,Delay and OLED Component
- Add Pulse Generator, set frequency to 100 (it will auto change to 1E2) see pic2
- Add two AND Logic gates
- Add two Delay components and set interval to 50
- Add OLED display component
- Double click OLED component ad in the dialog (right)
- select "Fill screen" drag it to the left side under properties set color to tmcBlack
select "Draw Bitmap" drag it to the left side under properties "Bitmap" load desired bitmap (like arrow pointing right), under properties "X" set it to 40
select "Draw Bitmap" drag it to the left side under properties "Bitmap" load desired bitmap (like arrow pointing left), under properties "X" set it to 40
Step 5: In Visuino: ​Connecting Components
- Connect Pulse Generator pin Out to logic gate1 component pin [1]
- Connect Pulse Generator pin Out to logic gate2 component pin [1]
- Connect Arduino Digital Out pin [3] to logic gate1 component pin [0]
- Connect Arduino Digital Out pin [4] to logic gate2 component pin [0]
- Connect logic gate1 component pin [Out] to Arduino Digital pin [5] and pin [6]
- Connect logic gate2 component pin [Out] to Arduino Digital pin [7]
Connect Display OLED Pin [Out] to Arduino Pin I2C [In]
Connect Display OLED - Elements Fill Screen1 Pin [Clock] to Arduino Digital Out Pin [3]
Connect Display OLED - Elements Draw Bitmap1 Pin [Clock] to Delay1 Pin [Out]
Connect Display OLED - Elements Draw Bitmap2 Pin [Clock] to Delay2 Pin [Out]
Connect Display OLED - Pin [In] to Arduino Serial out pin [0]
Connect Delay1 component pin [start] to Arduino Digital out pin [3]
Connect Delay2 component pin [start] to Arduino Digital out pin [4]
Step 6: Generate, Compile, and Upload the Arduino Code
In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.
Step 7: Play
If you power the Arduino Mega module, the Oled Lcd will start showing arrow, once you press a button on remote, the stepper will start to rotate in a desired direction.
Congratulations! You have completed your Stepper motor project with Visuino. Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.eu