Problem breadboard Arduino Photoresitor

Hi,

I just finish my project on arduino, so i begin to transfer it on breadboard. I follow this tutorial Here.

And i notice strange thing .

On arduino with only photoresitor connected and on breadboard with the same photoresistor the data i read was totaly diffrent. From arduino evrithing was ok. From breadboard the data i receve was some random numbers 0-1023.

The code is very simple

    Serial.println( analogRead( nLightSensorAnalogPin ) );
    delay( 100 );

What can be the problem ? I think something is wrong with power regulator but not sure what?

The problem is a floating input, you have not wired it up correctly.

Grumpy_Mike: The problem is a floating input, you have not wired it up correctly.

Wich one the power regulator or the ATMega ?

The photo resistor connection.

But, photoresistor in both times is in separate breadboard.

The case is this →

In one separate breadboard i put only photoresistor with this architecture

           PhotoR     10K
 +5    o---/\/\/--.--/\/\/---o GND
                  |
 Pin 0 o-----------

I connect pin 0 to arduino Analog0 , +5 to arduino 5v, GND to arduino GND → it all worked.

After that i change only 5v and DNG ( pin 0 still on arduino )
I connect +5 to + just after the volt regulator ( I attach picture )
Did i miss something ?

Hi, if the pic is of the setup that is not working, then you probably have a protoboard that does not have pos and neg tracks that run the full length of the board. Halfway down the board they are open, so in your situation the left pair is not connected the the right pair of supply tracks because of the breaks. Check that you have supply at both ends of both pairs. By the way where is your photo sensor?

Tom...... :)

TomGeorge:
Hi, if the pic is of the setup that is not working, then you probably have a protoboard that does not have pos and neg tracks that run the full length of the board.
Halfway down the board they are open, so in your situation the left pair is not connected the the right pair of supply tracks because of the breaks.
Check that you have supply at both ends of both pairs.
By the way where is your photo sensor?

Tom… :slight_smile:

Yes for that i put led on other side from regulator to see if power goes everywhere. The led is on so i doubt board to be split.

The photoresistor is on other breadboard i get only power from that breadboard.

After that i change only 5v and DNG ( pin 0 still on arduino ) I connect +5 to + just after the volt regulator ( I attach picture ) Did i miss something ?

Well I am not sure from that what you are actually doing, but it sounds like you have a missing ground from your regulator to the breadboard with the photo resistor on.

I fixed it was bad wiring ... when i change evrithing and wired again there is no problem.

Thx for evryone's help and sorry that lose ur time.

mravkata: I fixed it was bad wiring

Reply #1 ;)