I have had r different code writers try and crack this.
I have to pay them as this is not skill I possess.
Having said that, when looking at the serial data I dont see the sensor been read. But Chris, Josh, Tim or Lyndon do not know how to better define, from all hardware specs and data, how to get that communication.
I approached Paktronics for any piece of information but no response yet.
I have attached specs etc of hardware.
I have previously attached code and video of outcome.
Thanks again.
The original scope is below if you want it.
DETAILS: Wind speed Gate.
So I can send drawings but essential we have a small gate that swings 90 degrees and is by default always in the 'closed' or 0 degree position.
We are using -
Paktronics wind speed/direction sensor
Arduino Mega
Nema 23 stepper motor (4 pin configuration to L298N stepper motor driver)
NOTE:
When switched on (Arduino), a wind speed reading is taken and the gate moves to the desired location -
Closed - 0 degrees (no movement if wind speed is 20+kph - see 'stages' below),
30 degrees open,
60 degrees open or
open - 90 degrees).
A wind speed reading will be taken every second and the gate will open and close accordingly.
Rpm is slow, say 15 but again I will need to easily be able to change the intervals between readings, rpm, steps per movement etc.
From closed to open = 6 rotations cw.
So every stage is 2 rotations either cw or ccw depending on where the gate is located.
Simply put, if the Arduino was powered up and the wind speed was read st 45kph, the gate wouldn't move.
Or,
If the Arduino was powered up and the wind speed was read st 9kph, the stepper would rotate 6 times CS putting the gate in the open position.
If the next reading was 15kph the stepper would rotate 4 times ccw putting the gate in the 30 degree position.
NOTE FOR ARDUINO
If a single Mega cannot handle taking wind speed and wind direction readings simultaneously let me know. We will have to use 2 completely different sensor/module and Arduino boards.
No, you haven't. We expect links to all used hardware (except Original Arduino boards) and not smartphone screenshots. We must have schematics of the used wind sensor board and at least a manual of the motor driver.
If a single Mega cannot handle taking wind speed and wind direction readings simultaneously let me know. We will have to use 2 completely different sensor/module and Arduino boards.
I have given the specs for the L298N only because I was using it throughout the test.
Needing higher amps I must move to to Nucleo or Geeko.
I have used the Geeko before with Nema 34.
I have not used Nucleo before but it was recommended.
From the face of it this sounds like a quite straightforward thing to do. A Mega should easily handle it; a basic Uno/Nano/Pro Mini would handle a simple task like this just fine, too.
Basically you have to start with two sketches:
a sketch that reads and prints (to the Serial monitor or LCD display or whatever convenient) your wind speed sensor.
Make sure this works, and you see the numbers you're expecting. Now you're already 1/3 there.
a sketch that controls the stepper motor, and with it the gate. Just move it to 0 deg, then 30, 60, 90, stopping for a few seconds at each point, and back again. Preferably in the form of a function that takes the position as input.
There is no mention of a "home" sensor. A stepper motor doesn't know where it is when switching on, so you need some kind of "home" position. A magnetic sensor, microswitch, something like that. Your sketch should start by moving the gate to the home position when starting up.
Now you can control the gate. 2/3 done.
Merge the two together. Based on the speed of the wind, change the gate (add hysteresis and some delayed reaction: more than say 10 or 20 seconds higher/lower than a certain threshold before taking action).