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
}