Sensors Only = Clean Results, Sensors + DigitalWrite = Tainted Results

Heya,

We're using two pulsesensors 5V and one Arduino (we have a Nano and a Duemilanove, this occurs on both).

What we need to do is sample two pulses, and each has its own digital output as well.

If all the Arduino does is Serial.Write, we're golden, they each work great, output is accurate for both sides.

Here's where our problems start:

We have two output pins, if we use digitalWrite on them, suddenly the feedback from the sensors is disrupted and they affect each other, to the degree where one works alright but when trying the second pulsesensor, it sets off both sensors as if they're both receiving synchronized inputs! At first we thought this was an output problem, but when printing serial outputs it seems that the pulsesensors themselves are giving off wrong results, in that one is affecting the other. However, this can be isolated to some degree with software; but it's not a solution, since we need to continuously receive inputs from both sensors.

We're new to Arduino and hardware in general, and think that this issue may stem from some sort of feedback when writing to digital outputs. Maybe we should add something to the connection between Arduino and sensor, or Arduino and the output to avoid sending back wrong signals? No idea.

We've tried to connect both to two relays, but for debugging we've also tried regular LEDs, still the same issue, this problem is clearly visible when using LEDs.

This message was originally posted to: http://pulsesensor.proboards.com/index.cgi?board=ijustgotmypulsesensorand&action=display&thread=74#ixzz1xMWHJrAI
but to no avail :frowning:

Thanks for your time, and we'd appreciate any help given. Please help!

is it similar to this:
http://arduino.cc/forum/index.php/topic,85559.0.html
?

Have you got a ground loop perhaps? What's the power supply? How much current is the output controlling? You are not exceeding 30mA or so per digital output?

This sort of problem is usually caused by shared grounds. Dedicate one of the ground pins on your Arduino to connecting the ground sides of the sensors. Use a different Arduino ground pin to connect power and the ground sides of your output devices.

I Hate to Harp on this subject but are both devices and the supply that feeds them well by-passed? This is a recurring issue that is poorly addressed in the basics of "Using Arduino"... IMO

Doc

dc42:
This sort of problem is usually caused by shared grounds. Dedicate one of the ground pins on your Arduino to connecting the ground sides of the sensors. Use a different Arduino ground pin to connect power and the ground sides of your output devices.

dc, are they not ultimately the same thing?- in the sense that they must be joined together just inboard of the pins? Or are they genuinely separate?

Edit: In fact this schematic shows that the ground pins on the header between Vin and 5V are joined together..

The issue is that current flowing in the ground wiring creates a voltage - a wire is just a low-value resistor - and that voltage will be "seen" by your sensor circuit if you share the same ground wire for a high current device and a sensor.

The fix is to have a single central ground point (the middle of the Arduino groundplace) and radiate ground wires out from it keeping sensors separate from high-current loads.

In practice the most likely source of resistance is the point where the wire plugs into the Arduino's headers - without using gold-plated connectors you can expect maybe 0.1 ohms from a plug/socket. 1A flowing through that makes 100mV error if shared with a sensor.

It's not just resistant of common ground wires that is a problem, inductance is a problem too.

Spiderknives,

To better your odds at figuring this out, could you draw up a quick schematic of your setup and include part name/numbers on devices that the arduino is 'reading pulses' from? Also include a snippet of your code. This will be helpful in deciding which direction to take the trouble-shooting effort.