In this Instructable, we'll be learning how to monitor the amount of current that an actuator is using, so that you can tell how much force it is applying. This is a more advanced project, requiring in-depth coding and calibrating.
The programming we will be doing today will cover debouncing of switches through two methods, the monitoring of an analog input, and the use of functions.
First we will wire the circuit together, then go over the coding, and finish by calibrating the code to suit your application.
- 1x Megamoto
- 1x Linear actuator
- 1x Arduino Uno
- 1x 12V power supply
Let's get started!
Step 1: Wiring
The wiring part of this project is attaching the motor controller to the Arduino, and adding two buttons to move the actuators.
Do the following:
1) Plug the MegaMoto shield into the Arduino
2) Connect a wire from the BAT+ terminal to the Vin pin on the Arduino. Since it is a shield, the GNDs are already connected
3) Connect your actuator to the A and B terminals
4) Connect 12V to BAT+, and GND to BAT-
5) Verify the jumper settings on the MegaMoto.
For the buttons:
1) Wire a button between an unused pin and GND, so that when you push the button the pin is pulled LOW
2) Do the same with a second button
On to coding!