A3423

Hello all,

I am in a new project that inclueds the A3423 to measure speed and wind speed.
For that i took the small turbine from an portable windmeter.
The sistem is already working about measureing the speed, now the problem is the direction
In the datasheet it says the direction pin is high or low.
Tried to use an digital input but the voltage in that pin just drops a bit so could not detect the diference.
Changing statagy and using the analog 0 pin but that did not work to.
Is there any other ideias?
Is a photo of the prototype.
Is also including an DS18B20 to temperature measure.

// Constants definitions
const float pi = 3.14159265;  // pi number
int period = 10000;           // Measurement period (miliseconds)
int delaytime = 10000;        // Time between samples (miliseconds)
int radio = 6
// Variable definitions
unsigned int Sample = 0;       // Sample number
unsigned int counter = 0;      // B/W counter for sensor 
unsigned int RPM = 0;          // Revolutions per minute
float speedwind = 0;           // Wind speed (m/s)
void setup()
{
  // Set the pins
  pinMode(3, INPUT);
  digitalWrite(3, HIGH);
  pinMode(13, OUTPUT);
  pinMode(5, INPUT);
  
  // sets the serial port to 115200 
  Serial.begin(115200);
}

void loop() 
{
  Sample++;
  Serial.print(Sample);
  Serial.print(": Start measurement...");
  windvelocity();
  Serial.println("   finished.");
  Serial.print("Counter: ");
  Serial.print(counter);
  Serial.print(";  RPM: ");
  RPMcalc();
  Serial.print(RPM);
  Serial.print(";  Wind speed: ");
  WindSpeed();
  Serial.print(speedwind);
  Serial.print(" [m/s] ");
  Serial.println();

  if (counter > 10){
    if (digitalRead(5)== LOW)
    {
      Serial.print(" IN ");
    }
    else
    {
      Serial.print("OUT ");
    }
  }
  else
  {
    Serial.print(" No Wind ");
  }
  delay(10000);
}

// Measure wind speed
void windvelocity(){
  speedwind = 0;
  counter = 0;  
  digitalWrite(Led, HIGH);
  attachInterrupt(1
  , addcount, CHANGE);
  unsigned long millis();                     
  long startTime = millis();
  while(millis() < startTime + period) {
  }
  digitalWrite(Led, LOW);
  detachInterrupt(1);
}

void RPMcalc(){
  RPM=((counter/2)*60)/(period/1000);  // Calculate revolutions per minute (RPM)
}

void WindSpeed(){
  speedwind = ((2 * pi * radio * RPM)/60) / 1000;
}
void addcount(){
  counter++;
}

Thanks,
Timóteo

I would rather see the data sheet than a picture that is 4 times to big for me to view.

datasheet

A3423.pdf (275 KB)

The sensor outputs appear to be open drain. Do you have a pull up resistor on the dir output? Try 10K to start.

Hello,
Yes i do have in both an 10k resistor (pull up).
Any other ideia? is a good option to use the interrupt pin 2 do measure the direction? Since it is faster…
Thanks.

Hello all,

Still did not found a solution for my problem any help is welcome :). Thanks

Hola Timoteo, Is your small turbine magnetized? If so, try to rotate the turbine manually (in both directions) very slowly (with no power) and see how the direction pin changes between LOW and HIGH. Saludos,

p

You need to provide a better explanation of what you are doing and how you intend to do it.

How are you using the direction sensor? Based on a brief scan of the data sheet, it sounds like you’re supposed to put the chip next to an array of magnets so that when the sensor moves relative to the magnets it detects the motion. Are you trying to sense the rotation of the wind meter? Does the wind meter have magnets on the fan blades or on the rotating armature? Is this an arrangement you have seen used elsewhere, or something you are creating from scratch?

P.S. The data sheet for that chip says that it is being discontinued, and that you should use the newer A1230 instead.

timoteo_mendes:
Hello all,

I am in a new project that inclueds the A3423 to measure speed and wind speed.
For that i took the small turbine from an portable windmeter.
The sistem is already working about measureing the speed, now the problem is the direction
In the datasheet it says the direction pin is high or low.
Tried to use an digital input but the voltage in that pin just drops a bit so could not detect the diference.
Changing statagy and using the analog 0 pin but that did not work to.
Is there any other ideias?
Is a photo of the prototype.
Is also including an DS18B20 to temperature measure.

// Constants definitions

const float pi = 3.14159265;  // pi number
int period = 10000;           // Measurement period (miliseconds)
int delaytime = 10000;        // Time between samples (miliseconds)
int radio = 6
// Variable definitions
unsigned int Sample = 0;       // Sample number
unsigned int counter = 0;      // B/W counter for sensor
unsigned int RPM = 0;          // Revolutions per minute
float speedwind = 0;           // Wind speed (m/s)
void setup()
{
  // Set the pins
  pinMode(3, INPUT);
  digitalWrite(3, HIGH);
  pinMode(13, OUTPUT);
  pinMode(5, INPUT);
 
  // sets the serial port to 115200
  Serial.begin(115200);
}

void loop()
{
  Sample++;
  Serial.print(Sample);
  Serial.print(": Start measurement…");
  windvelocity();
  Serial.println("   finished.");
  Serial.print("Counter: “);
  Serial.print(counter);
  Serial.print(”;  RPM: “);
  RPMcalc();
  Serial.print(RPM);
  Serial.print(”;  Wind speed: “);
  WindSpeed();
  Serial.print(speedwind);
  Serial.print(” [m/s] ");
  Serial.println();

if (counter > 10){
    if (digitalRead(5)== LOW)
    {
      Serial.print(" IN ");
    }
    else
    {
      Serial.print("OUT “);
    }
  }
  else
  {
    Serial.print(” No Wind ");
  }
  delay(10000);
}

// Measure wind speed
void windvelocity(){
  speedwind = 0;
  counter = 0; 
  digitalWrite(Led, HIGH);
  attachInterrupt(1
  , addcount, CHANGE);
  unsigned long millis();                     
  long startTime = millis();
  while(millis() < startTime + period) {
  }
  digitalWrite(Led, LOW);
  detachInterrupt(1);
}

void RPMcalc(){
  RPM=((counter/2)*60)/(period/1000);  // Calculate revolutions per minute (RPM)
}

void WindSpeed(){
  speedwind = ((2 * pi * radio * RPM)/60) / 1000;
}
void addcount(){
  counter++;
}




Thanks,
Timóteo

Hello Palliser,

Thanks for your reply. Yes the turbine is magnetized and the speed is working, internaly the sensor have two measures: speed and direction. What do you mean with no power? I have creat a very simple sketch to detect the direction

    if (digitalRead(9)==LOW)
    {
      Serial.print(" entrar ");
    }
    else
    {
      Serial.print(" sair ");
    }
   delay(1000);

But the output is inconsistent, sometimes it assumes entrar sometimes sair even if i keep turning in the same direction... I can not understand why? Any ideia? Thanks

Timóteo

Hello DuncanC,

I am trying to creat a data logger to measure wind and direction speed to be used in a cave. it also measure the temperature in 2 places and barometric pressure, then it record it in an SD card. Did i make myself clear? The fran are magnetic so every turn it creats an pulse to my measure the i calculate speed based on a 10seconds sample. This sistem does not exist, or i dont know any... I used an old wind measure and take the turbine to this project. Is correct that, the IC is an old and obsolete product but i found this at a very reasonable price in RS. The problem now is the direction and not the speed and if the speed is ok the direction should be also. Any ideias? Thanks.

Timóteo

timoteo_mendes: What do you mean with no power?

Without power, rotate the fan blades using your fingers or a stick in both directions while monitors the direction pin to determine the correspondent output values.

p

Hello,

If i do not connet power could not detect any signal. Thanks