This circuit, which we will discuss in tomorrow’s lecture, is just a simple example of how a reflective infrared colour sensor can be connected to the analog input of an MSP430G2553 microcontroller.
With the Race to the Wall in mind (it’s fast approaching!) I decided to leave the switch input from last week’s example connected also.
Some important notes:
- Please please please don’t just stick this together without trying to understand it. Building a circuit like this without having a basic understanding of how it works almost never works. To find out more about infrared colour sensor and how they work, I suggest you read this post I published previously.
- The colour sensor circuit should be built and tested with a multimeter before connecting it to the microcontroller. Remember: The secret to fault finding in a complex system is to break it down into smaller parts that can be tested separately.
- Once the working colour sensor is connected to the microcontroller, remember that the input pin must either be enabled as an analog input, or the high and low voltages for white and black must be close to 3V and 0V respectively. A large voltage swing between black and white is necessary for the sensor to drive a digital input reliably.