Hello guys!) I need help) I bought anemometr RS-FSJT-N01(Maybe this https://aliexpress.ru/item/4000590278227.html?spm=a2g0o.productlist.0.0.431727c051z2yt&algo_pvid=5e6107bc-8099-43ce-b2a9-5db9e7864bcc&algo_expid=5e6107bc-8099-43ce-b2a9-5db9e7864bcc-28&btsid=0b8b034e15916013609556765e2641&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_) I forgot link on this anemometr on aliexpress( OK.I was surfing the internet and i finding simple code for analog this anemometr but this code don't work(
CODE:
#include <SoftwareSerial.h> // GitHub - PaulStoffregen/SoftwareSerial: SoftwareSerial library used on Teensy
#define RX 10 //Serial Receive pin
#define TX 11 //Serial Transmit pin
#define RTS_pin 9 //RS485 Direction control
#define RS485Transmit HIGH
#define RS485Receive LOW
SoftwareSerial RS485Serial(RX, TX);
void setup() {
pinMode(RTS_pin, OUTPUT);
// Start the built-in serial port, for Serial Monitor
Serial.begin(9600);
Serial.println("Anemometer");
// Start the Modbus serial Port, for anemometer
RS485Serial.begin(9600);
delay(1000);
}
void loop() {
digitalWrite(RTS_pin, RS485Transmit); // init Transmit
byte Anemometer_request[] = {0x01, 0x03, 0x00, 0x16, 0x00, 0x01, 0x65, 0xCE}; // inquiry frame
RS485Serial.write(Anemometer_request, sizeof(Anemometer_request));
RS485Serial.flush();
digitalWrite(RTS_pin, RS485Receive); // Init Receive
byte Anemometer_buf[8];
RS485Serial.readBytes(Anemometer_buf, 8);
Serial.print("wind speed : ");
for( byte i=0; i<7; i++ ) {
Serial.print(Anemometer_buf*, HEX);*
- Serial.print(" ");*
- }*
- Serial.print(" ==> ");*
- Serial.print(Anemometer_buf[4]);*
- Serial.print(" m/s");*
- Serial.println(); *
- delay(500);*
}
And result the COM port:
wind speed : FF FF FE FF FF FE FF ==> 255 m/s
wind speed : FF FF FF FF FF 7F FF ==> 255 m/s
wind speed : CC DE FF FC FF F8 F8 ==> 255 m/s
wind speed : 70 E0 FF FF 32 D8 E ==> 50 m/s
wind speed : CB FF FF F7 FF FF E7 ==> 255 m/s
wind speed : FC FF FB C7 B8 FF C3 ==> 184 m/s
Of course,this imposible because it's stay on home don't have air.
What i missed? Please help me)
@anderbro, you have asked a new question in a very old Thread so I have suggested to the Moderator to move you to your own Thread.
When posting code please use the code button </> so the code looks like this
#include <SoftwareSerial.h> // https://github.com/PaulStoffregen/SoftwareSerial
#define RX 10 //Serial Receive pin
#define TX 11 //Serial Transmit pin
#define RTS_pin 9 //RS485 Direction control
#define RS485Transmit HIGH
#define RS485Receive LOW
SoftwareSerial RS485Serial(RX, TX);
void setup() {
pinMode(RTS_pin, OUTPUT);
// Start the built-in serial port, for Serial Monitor
Serial.begin(9600);
Serial.println("Anemometer");
// Start the Modbus serial Port, for anemometer
RS485Serial.begin(9600);
delay(1000);
}
void loop() {
digitalWrite(RTS_pin, RS485Transmit); // init Transmit
byte Anemometer_request[] = {0x01, 0x03, 0x00, 0x16, 0x00, 0x01, 0x65, 0xCE}; // inquiry frame
RS485Serial.write(Anemometer_request, sizeof(Anemometer_request));
RS485Serial.flush();
digitalWrite(RTS_pin, RS485Receive); // Init Receive
byte Anemometer_buf[8];
RS485Serial.readBytes(Anemometer_buf, 8);
Serial.print("wind speed : ");
for( byte i=0; i<7; i++ ) {
Serial.print(Anemometer_buf, HEX);
Serial.print(" ");
}
Serial.print(" ==> ");
Serial.print(Anemometer_buf[4]);
Serial.print(" m/s");
Serial.println();
delay(500);
}
...R
I got this from the product link
Specification:
Condition: 100% Brand New
Item Type: Wind Speed Sensor
Material: Polycarbonate
DC Power Supply (Default): 5-30V DC
Transmitter Circuit Operating Temperature: -20℃ to +60℃, 0%RH-80%RH
Communication Interface: Pulse Output
Resolution: 0.0875m/s
Accuracy: ±0.3m/s
Measuring Range: 0-70m/s
Dynamic Response Time: ≤0.5s
Pulse Output Type Calculation:
The transmitter turns 1 circle, outputs 20 pulses
For example, when the wind speed transmitter 1S turns 1 circle, the transmitter 1S outputs 20 pulses, which means the wind speed is 1.75m/S.
Product Size: Approx. 16 x 16 cm / 6.3 x 6.3 in
Weight: Approx. 328g / 11.6oz
My guess is that the program you have found is quite unsuitable for that anemometer. I think you need a program that counts the number of pulses per second or which measure the interval between pulses.
...R
@anderbro
TOPIC SPLIT
DO NOT HIJACK / NECRO POST !
Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Hi,
Welcome to the forum.
Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
What model Arduino are you using?
What do you mean it doesn't wprk?
Does it compile?
If not can you post the error message?
If it compiles does it load?
If it loads what does and doesn't do?
Thanks.. Tom... 
TomGeorge:
What do you mean it doesn't wprk?
There is an example of the output in the Original Post
...R