Simple easy fix..... (I hope)

Hi Guys and girls,

Many thanks in advance for some pointers on this, I am sure this is at a level way beneath some of the master minds on this forum but after about 6 hours of trolling for answers I am officially stuck. My understanding is lacking around the programming side, I understand the electronics (enough? :slight_smile: ) and the mechanical.

My grand plan is to use a stepper motor and thermo couple to keep my gas burner on my brewing setup at a constant temperatures for defined periods of time.

Step 1 has gone well, using the step by step program in the arduino library and wiring up the motor shield.

Step 2 was planned to use two push buttons to step forward or reverse so I can manually adjust the temperature of my brew, Step 3 was to then work out how to use the K type thermo couple, Step 4 to then set up timers and temperatures for more complex brews.

I am using a "Freetronics eleven" with a Deek-Robot stepper motor shield (based on the generic design all seem to be built on). Code is currently just the step by step routine.

I am stuck at step 2, I understand that to reverse the direction of the bi polar stepper motor I need to reverse the wires for one of the poles.

My struggle is how to do this with the standard stepper motor library, and how to do this with push buttons to start with.

Appreciate all help I can get :slight_smile:

Lucifyer:
I am stuck at step 2, I understand that to reverse the direction of the bi polar stepper motor I need to reverse the wires for one of the poles.

My struggle is how to do this with the standard stepper motor library,

Have a read of the reference page for Stepper.step():

steps: the number of steps to turn the motor - positive to turn one direction, negative to turn the other

So it really doesn't matter whether positive value for steps is clockwise and negative is counterclockwise or vice versa as long as you just write your code according to the configuration of your hardware.

Lucifyer:
and how to do this with push buttons to start with.

The first step is to get each part working separately:

Write a test sketch(or use one of the examples at File > Examples > Stepper) that turns the stepper motor both ways.

Write a test sketch(or use one of the examples such as File > Examples > 02.Digital > Debounce to get your buttons doing something).

Next you can combine the two sketches together to make the buttons control the stepper.

If you want help you have to post your code so we can see what might (or might not) be the problem.

Post a link to the datasheet for the stepper motor you are using.
Post a link to the datasheet for the stepper driver / shield

What is the stepper motor used for?
If it is just turning a knob to control the flow of gas then a servo might be very much simpler.

...R
Stepper Motor Basics
Simple Stepper Code

Hi guys,

Thanks for the tips with the other basic code I can use for starting out :slight_smile: I will start hunting through them now!

Thanks for the idea around a servo, already though about this and came to the conclusion that it is easier to mechanically fix the stepper onto the gas fixture I'm controlling than the servo, also the tap has a small operating range, so the worm drive setup I have allows for good fine control.... however if the program gets to hard I would rather use a servo.

Thanks again guys for the help :slight_smile:

J

as a note, your deek-robot shield
http://www.deek-robot.com/productShow.asp?id=17

seems to be using a L298 and the link for stepper motor basics is very much single minded on only using boards that have step and direction and not the 4 pins that the L298 uses

so, if you want to use your board, you can pretty much disregard everything in those two links and follow the instructions for your board with the example program and use something a bit more friendly to the parts you already own.

Hi Dave,

I was just coming to the same realisation after getting my head around Robin's NOOB post around stepper motor control, (P.S. awesome write up Robin)

Thanks for the link I will start investigating now :slight_smile:

Thanks guys/girls for all the help!

J