Receiving signal on ground pin!

I have a situation where I am reading a signal from a bridge rectifier, its being pulsed by an automotive ignition source (providing about 6v). The pos of the bridge goes to a 20k trimpot then back to the negative terminal.

The out of the trimpot is in parallel with 10uF cap (WRT neg terminal of bridge) and presents a steady output at about 4v as the arduino reads it, but the arduino can not read the pulse.

so on the pos terminal i set up a 20k 20k voltage divider (about 2.7v) without a capacitor and it reads it ok, (using pulseIn) - little bit off in my estimation but here's the odd part.

I removed the signal wire with just the ground left and it still reads a signal! The best part is that the reading appears to be more accurate than the signal wire and it wasn't just some random noise, i altered the throttle and the reading flowed along with it - linearly. also the (averaged) readings come in a lot faster because the cleaner signal takes less time to accumulate due to the If condition in my code

Could i somehow be back feeding voltage onto the arduino?!? - thats my best guess

So can anyone shed some light on what (maybe) going on?

cheers

Could i somehow be back feeding voltage onto the arduino?!?

How is the input pin wired when not connected to the signal wire ?

Do you have a pullup or pulldown resistor in place to keep the input at a known voltage or is it just floating in the breeze picking up passing transient voltages ?

Correct its just floating but that would indicate at least a small variation in the reading, what i have is a very steady and (what appears to be) very accurate reading without a signal attached to the appointed pin?
only ground connected

A floating (unconnected) pin is undefined in its reading. Sometimes it will read high, sometimes low.

Please post circuit diagram of your setup.

Correct its just floating but that would indicate at least a small variation in the reading,

No a floating pin can read anything. Do not expect small variations from a floating pin.

please see attached

Sensor.GIF

Grumpy_Mike:
No a floating pin can read anything. Do not expect small variations from a floating pin.

does that mean it could provide a consistent - linear - repetitive reading, i don't mean to sound aggravating but i have disconnected and reconnected several times and i get a consistent reading thru ground

OP's schematic:
d3bd66b8ec8f89bdb003c516c823952c66ada62c.gif

I don't really understand the purpose of that circuit, and how it's supposed to work.

That "Arduino I/O" is a digital output or input? In the OP you talk about a 20k/20k voltage divider and a 20k pot, none of which I can find in your drawing.

Apologises, please see attached revised schematic:

the I/O is an input

int pulsePin = 10;
unsigned long RPS;
unsigned long total;
unsigned long average;
unsigned long pHigh;
unsigned long pLow;
void setup() {
  
  Serial.begin(9600);  
}

void loop()
{
  total = 0;
  for (int i = 0; i < 10; )
  {
    pHigh = pulseIn(pulsePin, HIGH);
    pLow = pulseIn(pulsePin, LOW);

    unsigned long interval = pHigh + pLow;


    if (interval > 6000)
    { 
      Serial.print(pHigh); 
      Serial.print("\t:\t"); 
      Serial.print(pLow);
      RPS = (1000000UL / interval);
      Serial.print("\tRPS: "); 
      Serial.println(RPS);
      total = total + RPS;
      i++;
    }
  }
  
  average = total / 10;
  Serial.print("Average RPS: "); 
  Serial.println(average);
  delay(100);
}

forget about the trimpot but just focus on the two resistor setup.

As I was saying without any signal attached and just ground i am getting a very stable reading

Sensor.GIF

does that mean it could provide a consistent - linear - repetitive reading,

Yes, if you have some strong source of interference the pin acts like an antenna and in effect the floating pin is a radio receiver.

I have seen this effect before.

Grumpy_Mike:
Yes, if you have some strong source of interference the pin acts like an antenna and in effect the floating pin is a radio receiver.

I have seen this effect before.

Righto, good to know, thought i was going daft for a moment then, Thanks mike

You cannot get reliable results unless you declare another point of the circuit the logic ground, and connect it to Arduino GND.

But according to your circuit you risk a ground loop with such a direct connection, that has the potential to destroy the Arduino and more. For a safe connection use an opto coupler, with its input across the rectifier input or output, and with a current limiting resistor, and the output going to Ardino GND and input pin.

An ignition coil can see several hundred peak volts on it's primary . I'm surprised your circuitry survives...

What are you trying to achieve?

Allan

Thats exactly what i was doing, the circuit worked ok but there seemed to be an increased RPM reading with this set up.
I could adjust the pot up to about 10k before the the resistance became too much and caused read errors on the arduino side.
Bouncing was an issue here mind - every time the signal went low, (the magnet passed the over the ignition coil) there was an immediate (100-350 uS) high signal which was a real pain and slowed down the average RPM count.
So i experimented at other ways to read the signal and to be fair the voltage (although i have not got a scope) seems to be consistant at 5.5v out from the coil that is why i went for a direct read(without opto).
and it worked, just the same results as with the opto and with the same 'unfathomable' increased RPM. At first i thought it was the rise/fall times of the opto but it was far too much for that about 800RPM or about 13 RPS which equates to 260mS!

As i tried the divider option the result was coming thru at an accurate 50RPS, which was good but the reading was being averaged again and any spurious readings were abandoned(the bounce issue), this led to agonising RPM count times and practically to slow for my application. This was where i stumbled upon the reading with just the negative side of the bridge grounded on the arduino. The reading count was updating rapidly and was following linearly with RPM change.

It must be the explanation GrumpyMike give and the pin is acting as an antenna, this is something i am going to investigate as i am truly surprised that the readings are so accurate. If only to learn something but will see if other non assigned pins are reading so accurate.

Anyways the other side of why i'm trying to read from the ignition is that this can be used to ground the ignition and stop the engine, via another opto(traic) - but i am yet to get to that. i should point out that the coil is on a 7hp generator (single cylinder) and i believe that the voltage from this is coming from an incidental 'Trigger Coil' which opens up a transistor on the primary to pass current to the secondary.

So any ideas here or insight to better design the system that i got?

cheers

Capture.GIF

I would definitely say you are picking up noise from the coils. They back feed on the ground as well. Known from year of automotive scoping. Most auto coils have internal diode and capacitor protection. Not sure about the design of the engine are reading.

To smooth things out I would add a diode (1n4004 or similar), small resistor (33k), and/or a cap (100uf). As far as a field effect as mentioned above, the only way is to separate or insulate the device from the coils. Put a shield up and see if readings change.

From your posts I see what you're actually trying to do is read the RPM of that motor.

Any reason to go for reading these coils, rather than using another technique? There are ways to read the RPM of a motor which don't need any electrical connection between the two.

plancette:
I would definitely say you are picking up noise from the coils. They back feed on the ground as well. Known from year of automotive scoping. Most auto coils have internal diode and capacitor protection. Not sure about the design of the engine are reading.

To smooth things out I would add a diode (1n4004 or similar), small resistor (33k), and/or a cap (100uf). As far as a field effect as mentioned above, the only way is to separate or insulate the device from the coils. Put a shield up and see if readings change.

i'm pretty sure from what i've been reading that opto isolation is the way to go - although the problems i'm getting with unreliable readings i think its just the tweeking of the resistors/capacitors.

Im not sure about the coil manufacture myself, as there is very little info on the net about them, so ill just have to keep plugging it till something turns up.

wvmarle:
From your posts I see what you're actually trying to do is read the RPM of that motor.

Any reason to go for reading these coils, rather than using another technique? There are ways to read the RPM of a motor which don't need any electrical connection between the two.

the reason for reading from the coil is to use just one wire to get the reading and also use that wire to ground out the ignition to kill the engine. Its seems a bit OTT but its feasible and requires no intrusive elements which are a pain to mount where there have been no provision for fitting. I have done the inductive sensor (which might i add produces its own current when passed by a magnet and requires no power) and also the hall sensor which worked flawlessly. Its not about cost its really just about whats already there to be used and simplifying the overall application of RPM detection (on small single cylinder engines <400cc).

The typical ignition coil as referred to.

Hi,
Have you googled Arduino engine tacho

Can you tell us your electronics, programming, Arduino, hardware experience?

Tom... :slight_smile: