TAGS :Viewed: 14 - Published at: a few seconds ago

[ Forcing a sensor to sleep on RaspberryPi ]

I am new to microprocessor programing and currently have a RGB sensor which reads an RGB value and increments a variable by an arbitrary number. I want the sensor to turn off for 0.3 seconds when I reach a certain value. Is there a way to do this or will I have to figure out a different way to throw out all the values the RGB sensor receives during that 0.3 second time span? I am writing in C.

Note: The sensor I am currently using is a TCS230.

Answer 1


According to the datasheet pin #3 is Output Enable ('OE, active low). So if you drive this pin high it should cut off the chip's output.

Or more to your question, it looks like if you drive pins S0 and S1 both low, it will place the chip in a "Power Down" state.

Whichever option you choose depends on what's more important. Do you want quickest reaction time, or do you want to conserve power? If you want the quickest reaction time, use 'OE. There is a typical 100ns delay between asserting this signal and the chip responding. The downside is the chip is still running during this whole time. If you choose the Power Down state, then you will save energy vs the Output Enable option, but the photodiodes have a typical 100 microsecond "recovery from power down" delay. Obviously that's a factor of 1000, and if you're doing time-critical work, probably not the best option.

Keep in mind, I have never used this chip in my life, just basing my answer a quick read of the datasheet.