Arduino is fine when connected to computer but not when on battery

its a duracell pluss 9v battery

A square 9 V battery ? Are you sure ? :astonished:

Man.. That is no good for your set-up. Use a 9 V pack --> 6 X AA or 6 X C. A 9 V square battery don't have enough juice in them.

To confirm what I am saying... measured the voltage at the battery when you are connected to your setup. The voltage will be lower than 9 V. If it is going below 6 V... well... your poor ardiuno will not have its breakfast. ]:slight_smile: