|
arduino IDEArduino
|
Control a Stepper Motor with a Slide of Your Finger
Supplies:
- An Arduino microcontroller board
- A PS/2 touchpad from a laptop(Try to get one with a Synaptics chip onboard)
- *A ULN2003 stepper motor driver(For unipolar stepper motors(5-wire))
- *An L298N stepper motor driver(For bipolar stepper motors(4-wire))
- 6 male to female jumper wires(2 for power and 4 for digital signals)
- A stepper motor
- A 5-12 volt DC power source(Depending on the stepper motor)
Here, the setup is powered from a mobile phone charger that supplies 5-volts to the Arduino board and the stepper driver. Even though the stepper motor is rated for 12-volt, you can use a lower voltage supply if the torque requirements of the motor are not high because using a lower voltage supply will keep the motor as well as the driver cooler.
*Both the stepper motor drivers have the same pin connections with the Arduino board.
Step 1: Get the Ps2 and Accel Stepper Libraries
Download the folder of the ps2 library from here. Move the downloaded folder to the desktop as it will be easier to find. Open the Arduino IDE and click Sketch>Include Library>Add .ZIP Library... and then select the ps2 folder from the desktop. The library will be included and you now be able to use the ps2 library.
For the Accel Stepper library, you can get it by pressing Ctrl+Shift+I and then typing in 'Accel Stepper' and installing the library.
Step 2: Figure Out the Connections of the Touchpad
If you have a Synaptics touchpad like the above one, the pad 'T22' is +5V, 'T10' is 'Clock', 'T11' is 'Data' and 'T23' is 'GND'. You can also solder the 'GND' wire to a large exposed copper as shown above.
If you have a different touchpad, try searching for its part number on the internet with 'pinouts' or you can ask the r/Arduino community on Reddit if you get stuck.
Step 3: Test the Touchpad
Make sure the correct connections are made to the touchpad. To test the touchpad, upload the ps2 mouse code on the Arduino microcontroller from Examples>ps2. Connect 'Clock' wire to D6, 'Data' wire to D5, GND to GND, and +5V or VCC to +5V pin of the Arduino board respectively. Reconnect the Arduino board to the computer and open the serial monitor. If you see the numbers changing as you move your finger across the touchpad, the touchpad is working properly and you can proceed.
Step 4: Program the Arduino Microcontroller
You can get the Arduino codes from here.
The first code, 'PS2_toucpad_with_Stepper' has no acceleration/deceleration feature for the stepper motor but has a homing function.
The second code, 'PS2_toucpad_accel_stepper' has no homing function but has an acceleration/deceleration feature.
You can know more information from the respective Arduino codes.
Step 5: Study the Circuit Schematic
Step 6: Make the Wiring Connections
Step 7: Connect the Arduino Board to Power and Turn It On
After powering up the setup, slide your finger along the length of the touchpad and see if the motor moves.
Step 8: Troubleshooting
If you encounter some problems, you can do the following:
If the stepper motor steps back and forth instead of moving in a particular direction:
- Change the sequence of pin declaration. For example: replace Stepper stepper(200, 8, 10, 9, 11) with Stepper stepper(200, 8, 9, 10, 11).
- Check all the signal wires connecting the motor driver to the Arduino board as well the wires of the stepper motor are properly connected where they should be and are not loose and faulty.
If the motor does not move at all:
- Check if the touchpad is working correctly, go back to Step 5.
- Check if the motor driver and the touchpad are getting power.
- Check if the motor or the motor driver is faulty.
I hope you enjoyed making this project. But don't stop here, try to tinker with the project and modify it to add more features or make it work as your liking. All the best!
Control a Stepper Motor with a Slide of Your Finger
- Comments(0)
- Likes(1)
- ElectroMaker Jul 06,2021
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
8design
-
7usability
-
10creativity
-
10content
More by KushagraK7
- Raspberry Pi Pico RC Vehicle SuppliesA Raspberry Pi Pico(Almost any microcontroller can be used here, but the Pico offers great f...
- Stepper Motor Controlled Stepper Motor Without Microcontroller! Step 1: Watch the VideoWatch the video to get a full understanding of the project and learn how to t...
- Automated Model Railroad Layout Running Two Trains I made an Automated Model Train Layout with Passing Siding a while back. Upon request from a fellow ...
- Program the Raspberry Pi Pico With the Arduino IDE The Raspberry Pi Pico is a recently launched product in the family of microcontrollers and its load ...
- Reuse an Old Laptop's Touchpad to Control a Computer! PS/2 laptop touchpads are among the coolest user interface devices to use with a microcontroller. Th...
- Automated Model Railroad Layout With Reverse Loops In one of my previous projects, I showed how to make a Simple Automated Point to Point Model Railroa...
- Use a Stepper Motor As a Rotary Encoder Rotary encoders are great for use in microcontroller projects as an input device but their performan...
- Keyboard Controlled Model Train(PS/2 Interface) Using Arduino microcontrollers, there are a lot of ways of controlling model railway layouts. A keyb...
- Stepper Motor Speed and Direction Control Without a Microcontroller In one of my previous projects, I showed you how to control a stepper motor's speed using a 555 time...
- Smartphone Controlled 4X4 Robot With ESP8266 SuppliesFor this project, you will need:An ESP8266 microcontroller(Node MCU)A dual H-bridge motor dr...
- Touchpad Controlled Digital Servo Motor Here is a quick and simple project where we control a digital servo motor with the slide of our fing...
- Smartphone Controlled Model Railroad With an ESP8266 IntroA while back, I made a project where a stepper motor's position is controlled using a smartphon...
- Simple USB Volume Controller with Arduino This project uses a rotary encoder connected to an Arduino Leonardo to control the audio volume of a...
- Motor Speed and Direction Control with a Web-Server using an ESP01 Supplies:For this project, you will need:An ESP01 microcontroller(You can use any ESP8266-based micr...
- Wi-Fi Controlled Stepper Motor With an ESP Microcontroller Step 1: Get All the Required StuffFor this project, you will need:An ESP8266 microcontrollerA Steppe...
- Simple Automated Model Railroad Loop With Yard Siding Video:Supplies: For this project, you will require:An Arduino microcontroller board compatible with ...
- Laptop Touchpad Controlled Model Railroad Supplies:For this project, you will require:An Arduino microcontroller compatible with Adafruit Moto...
- Control a Stepper Motor with a Slide of Your Finger Supplies:An Arduino microcontroller boardA PS/2 touchpad from a laptop(Try to get one with a Synapti...
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
55 0 0 -
-
-
-
Sega Master System RGB Encoder Switcher Z80 QSB v1.2
57 0 0 -
18650 2S2P Battery Charger, Protection and 5V Output Board
78 0 0 -
High Precision Thermal Imager + Infrared Thermometer | OpenTemp
419 0 6 -
Sony PlayStation Multi Output Frequency Oscillator (MOFO) v1
129 0 2