I work with an arduino nano every and I have a question about the power supply of my color sensor. If I connect the Vcc pin of my sensor to the 5V pin on my arduinoboard everything works as it should. My program gives me the different frequencies in my serial monitor, but the Vcc pin needs to be connected to the D11 pin on my board , because of the electric schematic we got from school. If I connect it to the D11 pin it gives only 0 as value in my serial monitor. I thought setting the D11 pin on HIGH with the digitalwrite command was the same as being connected to the 5V pin on my arduinoboard. Is it the same? Or am I doing something else wrong?
int PinColorSenS0 = 3;
int PinColorSenS1 = 5;
int PinColorSenS2 = 7;
int PinColorSenS3 = 9;
int PinColorSenVCC = 11;
int PinColorSenOUT = 2 ;
int PulseWidth = 0;
In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless
If the code exceeds the 9000 character inline limit then attach it to a post
An Arduino pin is not designed to power other devices and can only supply a limited amount of current and may have been damaged. Please post a link to the sensor that you are using and also post the schematic that you got from school. A photograph of the schematic will be good enough
I found the issue, I interpretted the schematic wrongly. The simplified circuit I used to calibrate the color sensor doesn't include a Darlington transistor(ULN2003A). In the regular circuit it is included so we can connect the Vcc pin of the color sensor to the D11 pin on the arduino board. To calibrate and test the sensor I will just connect the Vcc to the 5V on the board.