Hello, I currently have a NEMA 17 stepper motor with an EasyDriver hooked up to an Arduino Uno with a 12 Volt power supply. Eventually, we are going to attach a load cell with a strain meter and will want to have the force to always be at 8 lbs. The stepper motor will be coupled with a vertical stage dial that will rotate depending on if the force is above or below 8 lbs. As of right now, I was wondering if it is possible to code the arduino to turn the stepper motor “counter clockwise” if the 12V power supply is under 12V and “clockwise” if it is over 12V just to practice for when the strain meter comes in. Is there a way for the arduino to read how many volts are output from the power supply? That is where I’m stuck right now. Thanks!
The Arduino has an analog to digital converter (A/D, ADC, A2D) whose max input is the Arduino supply voltage (5V with an Uno). You can divide the “12V” down to always be under the 5V via a resistor divider and use the ADC to measure the voltage and do what you want (perhaps adding a little filtering and hysteresis).