At 08:03 AM 11/4/2011, yamanoor sairam wrote: >My theory for the LED getting stuck in a particular color is that=20 >the controller is getting reset and that this is happening due to=20 >the absence of capacitors in the circuit. I am considering adding=20 >capacitors across the LED and the microcontroller and at the input.=20 >My theory for the LED playing the default script is that the current=20 >draw for I2C communication interface is low. I am using a 1K pull up=20 >resistor on the SCL and SDA lines. I read an article that it should=20 >be at least 1.8K. But I am not able to prove it as the gadget works=20 >sometimes for 1K resistance. > >I would like to hear your thoughts on the erratic behavior of the=20 >enclosure when operated using a battery and mounted inside an enclosure. The easy way to tackle this is to break it into parts. 1) You ** DO ** need bypass capacitors for the input of the voltage=20 regulator and at the PIC Vdd pin. Try that first. 2) If adding the capacitors doesn't fix the problem, use 2 battery=20 supplies: one for the PIC and a separate power supply for the=20 LED. Do make sure that the negative lead of each supply is connected=20 together and to the circuit ground. 3) Ensure that any un-used pins on the PIC are connected to either=20 ground or Vdd. 4) How is the MCLR pin programmed? Is it an input or is it=20 reset? Pull MCLR up to Vdd if you aren't using it. Try all of the above things and let us know how you make out. dwayne --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .