Mega board and fuel flow meter

Ok, for starters I am an arduino newbie. My background is in web development, php, mysql, JavaScript...etc. so any shoves in the right direction is definitely appreciated.

I'm about to order 2 mega arduinos. I need to monitor analog sensors on 3 Diesel engines.

I plan on slaving one to the other so I have enough analog inputs.

So, one of the first order of business is monitoring fuel flow, and fluid flow. But for now let's just call it fuel flow.

I have ordered this sensor

Here are some specs
Flow range : 0-10LPM
Flow sensor connecting type: G 1/2''
Power input: 3-12Vdc
Accuracy: ±0.5%
Package include: 1 pc Flow sensor
Flow sensor wires :
Red---Power + white---Power - blue ---Pulse singal

So obviously the sensor sends pulses.

Now the complete newbie in me comes out lol....

So, do I just plug the pulse signal wire into an input, monitor it and run calculations...etc?

Or do I need to do 'something' before the pulse signal gets to the input?

Again, I'm new to this but eager to learn. I've read about a hundred articles today on arduino, brains about to explode I think! Hahah

Not that it really matters, but this is a personal project. Thanks in advance for any guidance!

You will need to make sure the voltage on the input pin does not exceed 5v. The easiest way is to power it from 5v.

It gives a certain number of pulses per mltr, this is written on the sensor.

Your program simply counts the pulses to do what ever you need to happen. If you need to do other processing, you may need to use interrupts.

Weedpharma

The specs for the mega state that input voltage is 7-12v. Am I not understanding something?

Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 14 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by bootloader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz

You mention other processing, yes I will need other processing. Would it be better for all the fuel flow meters to be on one board? And handle everything else on the other board? There will be Up to 8 flow meters.

I'm going to have to read up on interrupts.

Should each flow sensor get its own board? Maybe two flow sensors per board would be ok? I could use nanos or micros or something like that?

rustybucket:
Should each flow sensor get its own board? Maybe two flow sensors per board would be ok? I could use nanos or micros or something like that?

The Mega seems like a good choice ... lots of I/O and some extra memory. It could easily handle monitoring the pulse signals as their frequencies are quite low (in the 0-100Hz range). Possibly don't even need to use interrupts as you could detect changes on a complete port (8 inputs) in one command.

The link provided looks suspiciously like a Water Flow Meter ... are you sure this is what you want?
If so, you'll need to find some additional specifications for it, namely the mL/pulse or pulses/L.

rustybucket:
The specs for the mega state that input voltage is 7-12v. Am I not understanding something?

Microcontroller ATmega2560
Operating Voltage 5V

Yes, you are not. The Mega runs at 5v. You feed it 7-12v in order to be certain that it will do that. It has on board 5v regulators.

If the injectors are electronically controlled, you may find it quite simple to get the fuel flow. Alternatively you can use the simple Hall effect flow meters that I think you are alluding to.

I believe one Mega will handle five flow meters.

Nick_Pyner:
Yes, you are not. The Mega runs at 5v. You feed it 7-12v in order to be certain that it will do that. It has on board 5v regulators.

If the injectors are electronically controlled, you may find it quite simple to get the fuel flow. Alternatively you can use the simple Hall effect flow meters that I think you are alluding to.

Jaycar Water Flow Gauge | Freetronics

I believe one Mega will handle five flow meters.

I will be feeding it power through 12v lead acid batteries. I will not be feeding power to the sensors from the board. I will have them all wired to a terminal block. Only the pulse wire will be coming into the input. Is my logic flawed there?

The injectors are not electronic, they are old.

Thanks for the link, that's going to be helpful!

Should I be thinking about using a raspberry pi or something similar in this as well?

Depending on what and how many, it would be quite OK, and somewhat simpler, to feed the sensors off the Arduino. That is common practice. The DS 18B20 temp sensor for example requires some ridiculously small current. Alternatively, use a separate 5v regulator. Indeed, while 12v battery is OK, I think I would be inclined then to use a 5v regulator for Arduino too, as the on-board regulator is pretty crude. Normal practice is to run them off 9v and they can get a bit hot even with that.

I know nothing about RaspberryPi but I wouldn't consider one for a moment. Arduino should be fine and. if the engines are in one installation, a single Mega should suffice.

Nick_Pyner:
Depending on what and how many, it would be quite OK, and somewhat simpler, to feed the sensors off the Arduino. That is common practice. The DS 18B20 temp sensor for example requires some ridiculously small current. Alternatively, use a separate 5v regulator. Indeed, while 12v battery is OK, I think I would be inclined then to use a 5v regulator for Arduino too, as the on-board regulator is pretty crude. Normal practice is to run them off 9v and they can get a bit hot even with that.

I know nothing about RaspberryPi but I wouldn't consider one for a moment. Arduino should be fine and. if the engines are in one installation, a single Mega should suffice.

thanks for the feedback. I didn't mean to get this thread off topic with the greater sum of the project, but I have decided to go with a raspberry pi and 2 (or more) arduino Mega's, controlled by the Pi.

The reason for this is that I'm going to be monitoring probably 20 other sensors in various formats (many already existing analog) along with the 8 flow sensors.

On top of the monitoring is going to be data logging and data access as well as feeding a nmea network with the data. May even drive a display or two with it.

I do believe I'm going to use cleaner power to power to keep the regulator from working so hard.

I repeat my caution to make sure the output of the sensor does not exceed 5v. I do not know what form the output takes. If it is open collector, then no problem. If it is pulses at the supply voltage, you will damage the inputs with a 12v supply.

Weedpharma

weedpharma:
I repeat my caution to make sure the output of the sensor does not exceed 5v. I do not know what form the output takes. If it is open collector, then no problem. If it is pulses at the supply voltage, you will damage the inputs with a 12v supply.

Weedpharma

Ok, I'll test the pulse with a multimeter to find out what it is exactly.

Being that I'm new to electronics in general. If it is pulsing 12v, what do I need to do to reduce? Assuming a resistor? I need to educate myself on the use of resistors.

weedpharma:
You will need to make sure the voltage on the input pin does not exceed 5v. The easiest way is to power it from 5v.

It gives a certain number of pulses per mltr, this is written on the sensor.

Your program simply counts the pulses to do what ever you need to happen. If you need to do other processing, you may need to use interrupts.

Weedpharma

What is the best way to have a 5v power supply when my power source is 12v lead acid batteries? I'm assuming a regulator? Anyone recommend a good one that would be robust enough to act as my power hub?

Using a simple meter may not give you a true pulse voltage as the meter may read an average voltage.

If you use a 5v supply, it will not exceed 5v. Also, a car battery may get up to about 15v.

If you are using a 12v battery, get a switch mode regulator to convert 12v to 5v. Don't use a LM7805 or similar as they are inefficient.

You can use a voltage divider to convert the signal to 5v.

As you need 5v for the Arduino, you are better off using 5v for everything.

Weedpharma

weedpharma:
Using a simple meter may not give you a true pulse voltage as the meter may read an average voltage.

If you use a 5v supply, it will not exceed 5v. Also, a car battery may get up to about 15v.

If you are using a 12v battery, get a switch mode regulator to convert 12v to 5v. Don't use a LM7805 or similar as they are inefficient.

You can use a voltage divider to convert the signal to 5v.

As you need 5v for the Arduino, you are better off using 5v for everything.

Weedpharma

I can't guarantee 5v for everything, but I can do 5v for everything i'm installing new, so all the flow sensors...etc.

Any ideas of where to get a good switch mode regulator? Is this just a regulator and terminal I can buy and assemble on a breadboard or is this an external piece of equipment I need to purchase for install?

Any chance an automotive type USB plug would work for this? Or would going straight in with 5v via switch mode regulator be better?

There are thousands available of the type below. I have not tried this supply, it is only an example.

An auto supply may work, depends on current requirement.

Weedpharma

weedpharma:
There are thousands available of the type below. I have not tried this supply, it is only an example.

http://www.dx.com/p/geeetech-lm2596-dc-power-down-adjustable-supply-module-red-370785#.Vq9oCvDCarU

An auto supply may work, depends on current requirement.

Weedpharma

Awesome, many thanks. Got a few similar units ordered. I'll have one power supply for the Pi, one for the Megas and one for the sensors.