Hi and thanks for reply.
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 -
1. Paktronics wind speed/direction sensor
2. Arduino Mega
3. Nema 23 stepper motor (4 pin configuration to L298N stepper motor driver)
NOTE:
1. 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).
2. A wind speed reading will be taken every second and the gate will open and close accordingly.
3. There are 4 stages -
0 degrees (closed) - Wind speed 20+kph
30 degrees - Wind speed 15 - 20kph
60 degrees - Wind speed 10 - 15kph and
90 degrees (open) - Wind speed 0 - 10kph
4. 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.
5. 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
1. 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.