Pages: [1]   Go Down
Author Topic: Connecting 24V inductive sensors to Arduino  (Read 1801 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Arduino users, any of you out there that could answer some of my questions ?

My goal: to measure RPM of our ships diesel engine. Hardware: arduino mega 2560 + ethernet shield, inductive sensor (pepperl+fuchs, datasheet here: http://www.pepperl-fuchs.com/global/en/classid_143.htm?view=productdetails&prodid=296)

The engine can make 650rpm max but the sensor detects 4 holes in our huge flywheel so that generates a pulsetrain of max 44Hz.

I found lots of code for rpm calculations but I am at lost on how to connect the sensor to the Arduino for it puts out 24V.
I suspect that a voltage regulator (L7805ac-v) can not dissipate the voltage overshoot fast enough to keep up with the pulsetrain, maybe the same goes for a "ruggeduino" (tolerates 24V on its pins), not sure tough.

Any suggestions ?   Optocoupler ?   Transistor ?



Logged

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 722
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd recommend a optocoupler with a drop-down resistor to make it safe. In case the signal is AC, use a AC optocoupler. That's what I have used here with my air conditioning system (the signals for most residential AC control systems in America are 24VAC). Attach the opto to a digital input and then count the pulse train. Given how slow the signal is, you could use a ISR to do the counting and then let your Arduino refer back to the count whenever you want.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, use the 24v output to drive an optocoupler through a series resistor. The sensor is powered from DC not AC (the datasheet says it has reverse polarity protection), so no need for an AC optocoupler, a cheap DC one will do.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx dc42 & constantin. For those struggling with the same questions, found this schematic (see attachment).

PS: this post is edited twice, to simplify the circuit and to correct my nooby mistake. Thanks dc42 for your help & patience !! 


* opto2.jpg (31.47 KB, 654x471 - viewed 69 times.)
« Last Edit: January 22, 2012, 05:15:31 am by sluiswacht » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 24v side of that looks OK although I don't know what 800E is supposed to mean. Most opto isolators want around 16mA current so I would make the resistor 1.5 Kohms.

On the Arduino side, it's a little simpler to connect the phototransistor side of the opto isolator between ground and the input pin, then enable the internal pullup resistor in software. This avoids the need for an external resistor. Again, I don't know what 22E means, and 22 ohms is certainly far too low a value for that resistor in that circuit.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks again dc42,  implemented your suggestions in the drawing. 
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's not quite right, you need to connect the emitter (lower right connection in your diagram) of the IR receiver to Arduino ground, and the collector (upper right connection) to the Arduino input pin.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1]   Go Up
Jump to: