CNY70 Output Issues

Greetings. I am working to create a MIDI breath controller that is centered on a CNY70. I am new to this component and have been testing it out using a basic analog read sketch (as referenced below).

I have the CNY70 connected as follows:

Two ground pins to ground
LED anode to 5V and a 220 ohm resistor
Sensor pin to 5V with a 47K resistor (recommended value for the sensitivity needed for this project) and A0.

When I run the sketch, the serial monitor stays fairly close to 1024 and only seems to run slightly lower when an object in held close to or covers the sensor. I would think that the values should change much more drastically.

Any thoughts as to what might be wrong? As far as I can tell, the sensor is correctly connected.

Many thanks.

Sketch used:

void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1);  // delay in between reads for stability
}

The info I have seen shows the CNY70 being connected to 3.3V, not 5V

This is the project I am doing, though I was trying to test basic serial readings at 5V.

It turns out to have been a connection issue; couldn't get the module to sit properly in a breadboard because of the distance between the rails.

Today I attached Dupont cables to the four leads instead, made appropriate connections and now it works as it should.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.