Read PNP 24 V pulse signal from Keyence FD-XA1 flow meter with ESP-32 board

Thread Starter

1_am_Ahab

Joined Dec 6, 2023
9
I am trying to read 24 V pulse signals from a Keyence flow meter with an ESP-32. I am using it in PNP mode with an optocoupler at the moment. It seems to work, but I do not think it is fast switching, so my readings are not accurate. Are there any other ways to do this other than using a voltage divider?
ESP-32 boards hate voltages higher than 3.3 V.
I need to accurately convert a 24 V pulse signal to 3.3 V pulse signal.
I have attached the Keyence documentation.

Thanks in advance!
 

Attachments

nsaspook

Joined Aug 27, 2009
16,249
OK, so you're sourcing voltage/current instead of sinking. If you need isolation then use a faster optocoupler. What are you using now?
 

MisterBill2

Joined Jan 23, 2018
27,159
That device I see certainly appears to have capacitors to slow the response. At least that is what I see from the posting, which certainly lacks a bit of details. What is clearly shown are PRICE and size, and probably shipping weight.
Why do you not want to use a simple voltage divider??? Does your application require isolation??

Are you using the display that is also described in some detail??? Or are you ONLY using the arduino?? Are you wanting to sense individual pulses from the sensor??
In short, we simply do not have the explanation of just what pulses you are wanting to send to the arduino digital inputs.

In fact, based on what I have read in that attached data sheet, pulses from the actual flow sensor are not available. You get on and off signals as the flow level crosses set values. You can also get analog currents for current loop instruments.

So the TS needs to provide a much clearer description of just what pulses they hope to get.
 

Thread Starter

1_am_Ahab

Joined Dec 6, 2023
9
I was able to resolve the issue by adjusting the flow meter’s pulse output setting from one pulse per 0.01 liters to one pulse per 0.1 liters. At the original setting, the pump’s high flow rate (5 gallons per minute) was generating pulses too rapidly for the optocoupler and microcontroller to reliably detect. By increasing the pulse volume, the frequency of output pulses was reduced to a manageable level. From that point, all that was needed was a minor modification to the code to accommodate the new pulse-to-volume ratio. I understand that the readings may be less precise when measuring volumes under 100 mL; however, that does not apply to my use case, as I am dosing approximately two liters at a time.
 
Last edited:
Top