It doesn't matter whether I'm using the USB or wall socket as the power supply, anytime during sketch execution the board will stop providing the 5/ 3.3 V . I've tried different sketches, I've removed components thinking it was a current issue, but it always ends up randomly killing the power until I reset it/ unplug it and plug it again.
Just to clarify, the arduino itself does not shut down, it reads and sends data like it's supposed to, even if the data is a bunch of 0s because the sensors are powered off.
How have you determined power is "killed"? Are you making measurements or observing some type of behavior? Along with the hardware aspects that AWOL is asking for, code might be helpful to see as well.
AWOL, thanks for your reply. I didn't think to provide additional info because like I said, adding/removing components does not seem to be the issue. I'm using a CNY70 as a line counter, MLX90614 (IR temp sensor), gas sensor MQ-7, and humidity sensor HS1101-LF.
Line counter is wired to interrupt pin 2 on arduino board. IR temp. sensor, being an I2C device goes to pins A4 & A5. The other 2 go into A3 &A2 for analog measurements
Arduino 5V and GND wires go into the power rail of a solderless breadboard. All components are wired according to datasheet specs. I must stress the fact that everything works perfectly fine until the arduino shuts the power off.
I've tried to isolate the problem to either faulty hardware or a bad sketch, but even if I'm using only one sensor (with everything else unwired) it still happens.
James, I just use a multimeter to measure voltage between the 5v and gnd pins on the arduino board. I get 0. Following is the sketch I use to measure gas, you'll notice it's a straight ripoff from the examples. It'll measure for a while then just return 0s because the sensor isn't powered.
unsigned int BAUD_RATE = 9600 ;
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
void setup()
{
Serial.begin (BAUD_RATE);
}
int number = 0;
void loop(){
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
Serial.print(outputValue);
delay(200);
}
I can't see the sensor details from my phones, but gas detectors often have (relatively) meaty heaters - what sort of current does the gas detector draw?
Joolz:
I just use a multimeter to measure voltage between the 5v and gnd pins on the arduino board. I get 0.
This is where something isn't right. The 5V pin/node is the same node that powers the ATmega328. So if that node is getting "shut off" then the ATmega328 and Serial-to-USB chips would both be getting shut off as well. You wouldn't be able to read "0" when the sensor stops responding because there would be nothing else running.
AWOL:
I can't see the sensor details from my phones, but gas detectors often have (relatively) meaty heaters - what sort of current does the gas detector draw?
The MQ-7's heater resistance is in the neighborhood of 30ohm.
Joolz:
James, I just use a multimeter to measure voltage between the 5v and gnd pins on the arduino board. I get 0.
Yeah, I have to echo the sentiment that this is something you need to start with. I suspect you are exceeding the current that the power supply can offer, and it is shutting down.
Well that gas sensors heater is rated at a 350ma draw leaving 150ma for the arduino and the rest. Your most probably a little bit over on power consumption.
silasmoeckel:
Well that gas sensors heater is rated at a 350ma draw
No, it is rated for 350mW. Power, not current.
The coil has a resistance of 33ohms. So during the high cycle (5v) it will draw 160mA for 60 sec and the low cycle (1.4v) will draw 40mA for 90 sec. This gives an average (engrish: about), 350mW.
Well right now the board's connected to the usb port and and one 1A power supply through the dc jack. The duemilanove automatically selects the wall connection for power when both sources are available, is this correct?
Anyways, right now I'm using another board and everything seems to work fine. Will investigate the problem further when I have a little time, but thanks for your responses, hopefully one day I will also be able to contribute to these boards.
On another note, I see this thread has been moved to the Project Guidance forum, so perhaps my next question isn't out of place here. What software do you guys use to draw your schematics? Right now I'm trying Fritzing, but there's not a lot of parts available.
Joolz:
Well right now the board's connected to the usb port and and one 1A power supply through the dc jack. The duemilanove automatically selects the wall connection for power when both sources are available, is this correct?
As long as the voltage of that supply is >7.5V.
Joolz:
What software do you guys use to draw your schematics? Right now I'm trying Fritzing, but there's not a lot of parts available.
Sometimes the fastest is a piece of paper.
I like upverter.com because it is web-based and social is built in for sharing.
More advanced tools like Eagle have lots of power but learning curves associated with them.