Help with Stepper Motor, Switch and Sensor

I am new to all this coding and I am looking for advice. I know very little about all of this. I am trying to find a code to operate a stepper motor Nema 23 with an integrated driver. The stepper has 6 wires (5V,12V,ground,DIR,STP,ENA) I want to run this stepper and a possible touch screen along with on NC magnetic sensor. When someone touches the up button on the touch pad the stepper will go up until they stop touching and vice versa on the way down. The sensor has 3 wires (VCC 5v, ground and Signal) I would like to possibly use a Nano and wireless so I can build a dashboard and they can operate it wirelessly. Can someone please help with a code?

Show your schematic or wiring diagram and the sketch you have started.

If you do not have these ready, you should learn to write programs and about basic electricity so you do not need your hand held on every step of your project with power, connections and controller programming.

Welcome to the forum. :smiley:

Specifically, which model nano are you going to use for wireless control?

Which stepper motor controller are you planning to use?

When you say wireless, do you mean WiFI, Bluetooth, or BLE?

I suggest you create a separate project for each of the components. When you are comfortable with each one working to your satisfaction, combine the projects individually. This will help simplify debugging.

Search the web for tutorials for each sensor/actuator you wish to use. This is often a good starting point.

Thank you for your response. I guess to start I will be using the integrated stepper ISD04-10 from stepper online that will plug into the Uno and a touchscreen that I have yet to source that will raise(CW) or lower(CCW) the motor and run a NC normally closed magnetic sensor so when the motor is raised up to the sensor it will stop. At this point I will not be running wireless. That will be down the road once I learn more. I am very new to all this and I am trying to learn this coding. I appreciate the patience if I ask something that does not make sense during this process.

No problem. Please post your code in code tags and also provide wiring diagrams as you progress.

In the mean time, research stepper motors. They ONLY turn, they do not move up and down. Perhaps you need more design work on your project.

Yes the way I have set the motor it will raise and lower a component. I have tested the prototype on a very complicated Arduino program that was put together for me that has way more features than I need. I believe it would be easier to start over on a simple program then strip down the long very complicated version.

Have you also tested the other devices you mentioned, so you now have a design for the final program to include all the devices?

There is some very simple step/dir stepper code shown here.

Yes I actually have a product that I designed for an indoor ag where we turn lights at a set times which cuts down on half the amount of grow lights needed. This is for human food. I have now designed this product and tested using the program for the above product however I do not need as all the components that one needed. The coding is something I know not much if anything about and would like to learn for this project.

2 Likes

But you already have a working example that you can learn from. That is such a far step ahead of others! Start learning to control your stepper and ignore all the other stuff right now.
My late company built a bunch of LED control boxes for a customer wanting to test various custom designed LEDs for indoor growing. Not food grade. Used Arduino nano. Had a local engineer do the electronics and software. I still have some of the components and tools.

The very nice thing about those, as compared to Arduinos, is that they have a synchronous AC motor that keeps time much better than the Arduinos' +/-0.5% (+/-7.2min/day) built-in timer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.