Problem with external ground

I'm having an issue connecting the boxes below together. The 3 banana posts are A B C from left to right (on both). When A and B are connected a light turns on on another box (which works fine in testing) but I cannot connect A to the ground of the other box. When they do connect, ideally the current from A and B should get cancelled out by the ground of the other post and nothing should turn on, but this is not the case. I'm not sure if its something that can even be done, but any assistance would be appreciated. The code and photo of the boxes are below.

#include "nRF24L01.h" //NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include "RF24.h"
#include "SPI.h"

#define APost 2
#define CPost 3
#define BPost 4

unsigned long touching;

int SentMessage[1] = {000}; 
RF24 radio(9,10); // NRF24L01 used SPI pins + Pin 9 and 10 on the NANO

const uint64_t pipe = 0xE6E6E6E6E6E6; // Needs to be the same for communicating between 2 NRF24L01 

void setup()
{
  pinMode(APost, INPUT_PULLUP);
  pinMode(CPost, INPUT_PULLUP);
  pinMode(BPost, OUTPUT);
  digitalWrite(APost,HIGH);
  digitalWrite(CPost, HIGH);
  digitalWrite(BPost, LOW);

  touching = 0;
  
  radio.begin(); // Start the NRF24L01
  radio.openWritingPipe(pipe); // Get NRF24L01 ready to transmit
}

void loop()
{
  if (millis() <= touching + 500)
  {
    SentMessage[0] = 011;
    radio.write(SentMessage, 1);
  }
  else if (digitalRead(CPost) == LOW)    // If switch is pressed
  { 
      SentMessage[0] = 100;
      radio.write(SentMessage, 1);      // Send pressed data to NRF24L01
  }
  else if (digitalRead(APost) == LOW)
  {
    touching = millis();
  }
  else 
  {
      SentMessage[0] = 000;
      radio.write(SentMessage, 1);      // Send idle data to NRF24L01
  }
  delay(2);
}

Before you go any further you should consider whether the PP3 batteries that you are using are up to the job. This type of battery is designed to supply a small current over a long period, as used in a smoke detector. As a result they will not run your project for very long

As to your problem, it is not clear what you are trying to do. Please post a schematic (a phono of a hand drawn circuit is good enough) and explain the intended working of the circuit and what the Arduinos have to do with it

1 Like

Pictures are much more powerful that words for circuits - sketch the connections between the boxes in each case, explaining what you think should be the result.

If you only have one wire between the two boxes then each box acts as an antenna for the other, perhaps this is what's happening, but I don't really know from the description.


This is for a fencing scoring box. When the tip of a weapon depress, A and B connect and transmit a signal to the main box (pictured at the bottom). However if the tip touches the guard of the other weapon (C) it should cancel the current. Usually this would work fine but since I am trying to create a wireless box, they do not have a common ground. The "common ground" is what I am trying to figure out to cancel the current.

A and B of one box connect to the C of the other, so I'm not sure how the current works with that. I also tried connecting A and B of one to the ground of the battery on the other, but that also did not work. I also have a reply with a schematic now with a little extra explanation

Ah, that makes more sense now. Best to be upfront with vital information like this, otherwise the xyproblem will strike.

You need a common ground for this to work. If these are body mounted (which I assume to be the case for fencing) there is no common ground so a DC method cannot work - there is no current because there is no DC circuit. (A circuit is a loop).

You need to use something like capacitance sensing - each person acts as an antenna to the other, so you only have capacitance to the environment to go by. Upon contact the capacitance changes. IE using AC and relying on the displacement current due to stray capacitance.

Another thing that might work in a building is sensing the mains-pickup level changing upon contact - clearly this can't work outside.

For such a specialized application its wise to checkout existing designs to avoid re-inventing the wheel.

Also a bare microcontroller pin is not designed to plug into an antenna (a human!), so some protection circuitry is good to have - the standard schottky-diodes to the rails.

Thanks for the help. I'm doing this for a school project and I have minimal electrical knowledge. I just kinda went with what I knew how to do and hope it worked, but it seems if I want to see this project through I will have to spend a lot more time learning.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.