read the energy flow from meter

hi,
i want to start a new project in which i want guidance regarding how to read the energy flow from the meter using rx tx pin.

*what are the things required to implement the code and read the live flow of energy through rx tx pin.
*i have arduino mega 2560 to use as micro controller but other things that are required for implementation which i am not sure what to buy ?
*some of things i have found through google named like max 232,rs 485 full,half duplex but do not understood which one to go for ?
*is there any code example to test the things?

please help me out,thanks.

Ransher:
i want to start a new project in which i want guidance regarding how to read the energy flow from the meter

Gee, I wonder what "the meter" is.....?

hi nick,
it is water flow meter with rx tx pin .

Well, that does narrow it down drastically. At least he water meters with different pin markings are out.

Do you happen to have a crystal ball for me? Maybe it can tell you what meter you have. That failing, part numbers and links to data sheets and so may be helpful.

@Ransher, please post a link to the datasheet for your flow meter. Without that we have no idea what you are talking about.

In the meantime have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

Ransher:
hi nick,
it is water flow meter with rx tx pin .

And a water flow meter reads energy?

Nick_Pyner:
And a water flow meter reds energy?

:slight_smile:

...R

meter in the attached image is almost same type and it is custom designed.
yes, it read flow rate and which i can see from the display on the meter
it has rs 485 connecter on the opposite side of display thats all i know.

i think i need a max 485 and modbus rtu example thats all??

Ransher:
i think i need a max 485 and modbus rtu example thats all??

That's a good start.
But first you should give a call to whoever built this thing for you, and let them explain how to communicate with it. Baud rate, protocols, command set - the works. When you have all that (getting this information may turn out your biggest problem - don't buy anything before you have it!), you can start trying to make a connection and hopefully end up with a complete library that you can use in your project(s) that deal with this meter.

the parameters i want to use
MODE-RTU
SLAVE ADDRESS-2
DATA BIT-8
PARITY-NONE
ADDRESING FLOW RATE-1800
LENGTH-2
TYPE-HOLDING REGISTER

modbus (remote terminal unit) as slave and arduino mega 2560 as master

is there any library for above parameters ?

i didn't find one