I am using the arduino uno with a photoresistor to measure light, a one wire temperature sensor* for temperature and the CC3000 breakout board**, to send the data to carriots.com. When the arduino is powered by usb, both the temperature sensor and photoresistor give correct readings. However, when it is powered with a wall plug, the temperature sensor reading is -126.99, which seems to also be the reading that results from incorrect wiring of the sensor. Since it works perfectly with usb plug, I am thinking the wiring is correct and the wall plug might be insufficient. Is it possible? The wall plug specifications are as follows:
AC to DC power supply
9V 650mA
5.5 x 2.1 mm plug center positive
110 - 240V AC input
Hi, measure the 9V input when your have it connected, see what the voltage goes down to.
I'd say you wall plug id typical and is not a regulated supply.
That temperature reading can be a result of errors in reading the sensor itself, which can in turn be caused by a number of different problems (incorrect pullup resistor, failure of "parasite power" in that type of connection, etc.). The wall plug adapter might be electrically noisy, or suffer a voltage drop during moments of high current demand, which could interfere with readings. Try a different wall plug adapter.
You need to check the supply is regulated - its reading on AC volts should be close to
0V, otherwise its probably not really suitable (more particularly you'd really need an
oscilloscope to check if it is adequate or not).
Thanks everybody for the replies. I checked with a multimeter from 5V to gnd and the result is as follows:
with the USB:
DC = 4.7 V
with the wall plug:
DC = 4.8 V
I also tried an AC reading as MarkT suggested and the readings were 9.8 and 9.5 for the plug and the usb respectively, but I'm not sure if this makes sense. The lowest setting on my multimeter for AC is 200, so perhaps very low AC voltage is not being accurately measured?
Also in the OP I said that the photoresistor was giving the correct reading when powered by the wall plug. However, on closer inspection the readings given are totally erratic and seemingly random. Perhaps then the wall plug is noisy as jremington mentioned.