1

I'm working on a project using an arduino Nano (official) and two peripherals from Atlas Scientific (pH and DO) communicating via i2c. Everthing works fine when i use a usb alimentation connected to the PC or to a 5V adaptater (typically a phone charger).

I want to use a 12V battery and a 12V DC 1.5A adaptater to power up my system, the problem is that it works fine for a moment (30 to 40 seconds) and then the pH start having problem with the communication and the led becomes red and the TX/RX leds from the arduino (which are connected to nothing start going crazy. I use 4.7k pull up resistors and an L7805ACV voltage regulator to go from 12 to 5V.

Attach, a part of the system schematics.enter image description here

If you have any clue, starting to be new idealess

EDIT : Here is the part of the program concerning the i2c communication :

#include "Wire.h"

/*********************************************************************************************************
 *                                               Address
 *********************************************************************************************************
 */
int pH_address = 99;
int DO_address = 97;

/*********************************************************************************************************
 *                                         i2C CONFIGURATION
 ********************************************************************************************************* 
 */

byte received_from_computer = 0;                                                                           
char sensor_data[20];                                                                                      
byte in_char_sensor = 0;                                                                                   
byte j = 0;                                                                                                
byte code = 0;                                                                                             
int time_ = 850;     

void setup()
{
  Wire.begin();
}
void loop()
{
  pH = Get_i2C(pH_address);    
  delay(200);
  DO = Get_i2C(DO_address);
  delay(200);      
}

/**********************************************************************************************************
 *                                                  i2C
 * ********************************************************************************************************
 */

float Get_i2C(int address)
{
  char computerdata = 'R';  
  Wire.beginTransmission(address);
  Wire.write(computerdata);
  Wire.endTransmission();

  delay(time_);

  Wire.requestFrom(address, 16, 1);
  code = Wire.read();
  while (Wire.available())
  {
    in_char_sensor = Wire.read();
    sensor_data[j] = in_char_sensor;
    j += 1;
    if (in_char_sensor == 0)
    {
      j = 0;
      break; 
    }
  }
  return atof(sensor_data);
}                                                                    
1

Two ideas.

1: Count your grounds. If you count more than 1 you have a problem. Your system should have a single ground, so ANY connection on every component labeled GND should be connected to ground.

The reason multiple grounds are a problem is that all your signals are measured relative to ground, so if two components have different ideas of what "ground" is they start to disagree about what constitutes a 1 and a 0.

2: Scope your power supply. Check that your 5V supply is still providing 5V. It's possible (although unlikely) that the L7805ACV can't supply enough current and your system is browning out. If possible have a look with an oscilloscope to check for noise on the 5V supply.

Your boards should already have decoupling capacators, but adding another won't hurt, so also try adding a 0.1uf cap between 5V and GND to eliminate any noise.

  • Thank you for your answer. For the first idea : every ground are connected together. For the second one, i thought about that too, so i now power my nano with the 12V for the adaptater and the two i2C are power supply with the 5V of the nano. The rest CO2 + HC05 with the 5V of the L7805ACV. – Hugo Vernier-Lambert Sep 11 at 10:52
  • And still get the problem ... i can try adding some decoupling capacitor. Something really weird is that the TX/RX leds start to blink but nothing is connected to it, when the problem is happening. – Hugo Vernier-Lambert Sep 11 at 10:59
  • @HugoVernier-Lambert That's really weird. All I can suggest is removing parts until you see the problem resolve. That may at least give you an idea what part may be the issue. Failing that, probe every signal. You could also provide us with a copy of your code. It doesn't sound probable, but there could be something there. – ForgeMonkey Sep 11 at 14:12
  • I edited the question with the i2c program. – Hugo Vernier-Lambert Sep 11 at 14:31
  • 2
    Discussing the problem with another electronic engineer, he told me that the L7805ACV was over heating making some voltage drop which were rebooting over and over the arduino. And because the TX/RX leds blink one time when rebooted at start, we see it blinking faster and faster. I'll try to get some heat sink in order to cool that voltage regulator. – Hugo Vernier-Lambert Sep 11 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.