Problem getting signal with Vin

I am trying to control the lights of my Rc Car with receiver. I made the installment as in the photo and generate the the code as below. I can get the 1056 and 1942 signals from the receiver ana and change the lights when arduino is connected to the usb. However when i connect my 2S lipo to the card signal becomes 0 and i cannot change the light combination. I have tried with 2 different nano card and both give same result. How can i fix it.

#include "Arduino.h"

#define TXPIN 3
#define LED_1 6
#define LED_2 9
#define LED_3 12

int tx; // Transmitter Input
int i;
static unsigned int state;
static unsigned int counter;

void setup() {
  // put your setup code here, to run once:
  pinMode(TXPIN, INPUT); // Set the tx input pin
  pinMode(LED_1, OUTPUT);
  pinMode(LED_2, OUTPUT);
  pinMode(LED_3, OUTPUT);
  state = 0;
  counter = 0;

  Serial.begin(9600); // Start serial
}

void loop() {
    switch (state)
    {
    case 0:
      Serial.println("Case = 0");
      digitalWrite(LED_1, LOW);
      digitalWrite(LED_2, LOW);
      digitalWrite(LED_3, LOW);
      break;

    case 1:
      Serial.println("Case = 1");
      digitalWrite(LED_3, LOW);
      digitalWrite(LED_1, LOW);
      digitalWrite(LED_2, HIGH);
      delay(500);
      digitalWrite(LED_2, LOW);
      delay(500);
      break;
      
    case 2:
      Serial.println("Case = 2");
      digitalWrite(LED_2, LOW);
      digitalWrite(LED_3, LOW);
      digitalWrite(LED_1, HIGH);
      break;  

    case 3:
      Serial.println("Case = 3");
      digitalWrite(LED_1, LOW);
      digitalWrite(LED_2, LOW);
      digitalWrite(LED_3, HIGH);
      break;

    case 4:
      Serial.println("Case = 4");
      digitalWrite(LED_3, LOW);
      digitalWrite(LED_1, HIGH);
      digitalWrite(LED_2, HIGH);
      delay(500);
      digitalWrite(LED_2, LOW);
      delay(500);
      break;

    case 5:
      Serial.println("Case = 5");
      digitalWrite(LED_2, LOW);
      digitalWrite(LED_1, HIGH);
      digitalWrite(LED_3, HIGH);
      break;

    case 6:
      Serial.println("Case = 6");
      digitalWrite(LED_1, HIGH);
      digitalWrite(LED_2, HIGH);
      delay(500);
      digitalWrite(LED_2, LOW);
      delay(500);
      digitalWrite(LED_3, HIGH);
      break;
    }
  
    tx = pulseIn(TXPIN, HIGH, 25000); // Read paulse from Tx
    delay(50);
    Serial.println(tx); //channel

    if (tx < 1700 && i==1)  {
      counter += 1;
      state = counter % 7;
      i=0;
    }
    
    if (tx > 1700 && i==0)  {
      counter += 1;
      state = counter % 7;
      i=1;
    }
    Serial.println(state);
    //delay(100);
}

Your diagram does not show any current limiting resistors between the LEDs and the Nano.

If the code is working with USB input but not the Lipo, the Lipo would be suspect. Please check the voltage at Vin to make sure it is not too low under load.
BTW, how do you know that the signal becomes 0 when connected to the Lipo? And which card are you talking about?

The Nano requires 5v for proper operation.
Additionally the Vin pin goes to the built-in regulator that requires a 7-12v input.
If you wish to use a 3.7v lipo battery you will need a buck converter to bring the voltage up to 5v and connect it to the 5v pin

The voltages quoted for LiPos is misleading. A fully charged 2S LiPo will be at 8.4 volts. Each LiPo cell has a nominal voltage of 3.7V and a fully charged voltage of 4.2V

I see, I've never used one.

I am working with arduino Nano. I have the resistors. LED's work perfect.
I have tried with two different 2S lipo and two different arduino nano. But i have not checked the voltage at Vin. I used serial monitor to check the signals from the receiver.


This is the serial monitor when usb connected and lipo is not connected.


This is the serial monitor when both usb and lipo is connected.

Does that mean that you do not have a voltmeter?
Is the Nano Power LED On ?

Nano power led is on of course. I can check with voltmeter tomorrow at work.
The problem is it even don't get the signal both usb and power is connected. Voltage problem in Vin can cause this problem. It also gets power from the usb at same time.

It would were the battery connected to 5V instead of VIN.

If everything was obviously working in every project, this forum wouldn't have any reason to exist. We can't peek over the shoulder of forum enquirers to actually see what is going on. Nor can we magically know their skill level or attention to detail.

This is really odd. If I understand you correctly:
USB power only: can read signal correctly.
USB power + Lipo connected to Vin: no signal
Only Lipo connected to Vin: no signal.

BTW, I would not connect the Lipo to 5V since your Lipo is not putting out a regulated 5V output. Your Lipo voltage would be 7.2V nominal, but could be as high as 8.4V if fully charged.

When you post your schematic, a hand drawn circuit in jpg or png is far preferable over a pretty Fritzing picture. A schematic is way simpler and easy to understand than a physical layout. The schematic is a functional description describing the flow of operation, something Fritzing does poorly. Using Fritzing will reduce the pool of folks prepared to even look at your problem.

How is the receiver powered?

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