How to make the photoresistor more satiable ?

I try to control the rotation of the servo(0-120 degrees) with a photoresistor. When I connect a 470-ohm resistor in series with the photoresistor, the range of motion of the arm is usually between (0-15 degrees) unless I shine a really bright light. However, when I use a 2.2k resistor the arm can rotate in full motion without I shine other light. I wonder why analog in Pin doesn’t measure a high voltage when I use a small resistor.

#include <Servo.h>
Servo myServo;
int const photSenserPin = A0;
int photVal;
int angle;
void setup() {
void loop() {
photVal = analogRead(photSenserPin);
Serial.print("photVal: ");

angle = map(photVal, 0, 1023, 0, 120);
Serial.print(", angle: ");

Untitled document.pdf (446 KB)

I wonder why analog in Pin doesn't measure a high voltage when I use a small resistor.

To answer that question, study how voltage dividers work.

Measure the input to A0 with several different resistors. What do you notice? Also look at the data sheet for your photocell? So what do you conclude?


angle = map(photVal, 0, 1023, 0, 120);

the range of your photoresistor voltage drop should be 0-5V for that line of code there, if you series a resistor, you lose range by the ofset of the voltage drop of series resistor. Maybe map the pot val to match the maximum analog input difference that you can get.... like angle = map(photVal, 0, 500, 0, 120); or simmilar... first measure your A0 extremes, then adjust map, or desighn your external circuit so your photoresistor can change A0 from 0 to 5V