I've been trying to play around with a 4050 non inverting Hex Buffer for my SD card project but I have run into some issue. This is how my hardware is all connected:
And here is the code I have written:
int triggerPin=9;
int readPin=A0;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(triggerPin, OUTPUT);
pinMode(readPin, INPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
analogWrite(triggerPin, 255);
delay(500);
Serial.println(analogRead(readPin)*0.0049);
delay(2000);
}
Very short code, and when I read a 5v supply the reading is pretty spot-on at 5.01v. However, when I read according to the setup I have I get a consistent 4.35v instead of the expected 3.3v from the level shifter. Does anyone have any idea what I'm missing here?
Thanks so much.