Color sensor with BASYS3 VHDL

Guest
Hi, I need to make a circuit which does the following thing:

When it sees a red object it will send output 0 until it sees a green object (like a well colored cubic toy), after it sees green it will send output 1 until it sees red again. ( If it is hard to implement I'm ok with just output 0 when it sees red and outputs 1 when it sees green, I mean it is ok if the outputs not continuous but it would be great if they are continuous)

I have basys3 and have to use VHDL. I think I should use TCS34725 sensor https://www.adafruit.com/product/1334 but I'm not sure I just assumed, I would be really glad if someone helps

Some extra questions: If it is possible I will implement it on a toy RCcar is it possible to connect it with Bluetooth module to get inputs or how should I do it ?- I can use another board JUST FOR CONNECTIONS my main Project should be on BASYS-3

Thanks
 
On Monday, March 18, 2019 at 2:28:50 PM UTC-4, utkud...@gmail.com wrote:
Hi, I need to make a circuit which does the following thing:

When it sees a red object it will send output 0 until it sees a green object (like a well colored cubic toy), after it sees green it will send output 1 until it sees red again. ( If it is hard to implement I'm ok with just output 0 when it sees red and outputs 1 when it sees green, I mean it is ok if the outputs not continuous but it would be great if they are continuous)

I have basys3 and have to use VHDL. I think I should use TCS34725 sensor https://www.adafruit.com/product/1334 but I'm not sure I just assumed, I would be really glad if someone helps

Some extra questions: If it is possible I will implement it on a toy RCcar is it possible to connect it with Bluetooth module to get inputs or how should I do it ?- I can use another board JUST FOR CONNECTIONS my main Project should be on BASYS-3

Thanks

Are you familiar with finite state machines (FSM)? I think FSM will be the best circuit for this task since you want it to remember which color it last saw.

The inputs to the FSM will need to come from a much more complex circuit that reads the state of the color sensor via I2C and makes a decision as to the color it is seeing. This will need to pick three states of the input color, red, green and neither.

To get the color data to make these decisions will require a controller circuit to read the registers in the chip. Looking at the data sheet it looks like this is not completely straight forward but requires a sequence of operations to make the chip sample the light through ADCs. So you should make sure you understand this process. You may want to read the library code to see the sequence of operations implemented there while correlating that with the data sheet.

So read the data sheet, look at the code and make sure you understand what is required to get the data out of the color sensor. Once you design that circuit you can try testing it by just driving I/O lines with the data values and looking at them on the oscilloscope. If you pump the samples out serially, you can see it on the oscilloscope with the low order bits toggling furiously but the higher order bits fairly stable but changing as you change colors.

When you think you are reading the color chip correctly, add the circuit to weight the values and produce the two signals "red" and "green". See if you can get these to work.

I would say you should construct a test bench and simulate it, but explaining to you how to construct a model of the color chip might be more than you can do. If you think you can do that, the test bench would be much better than working on the actually FPGA because you can "see" any signal in the design.

Rick C.
 

Welcome to EDABoard.com

Sponsor

Back
Top