EDAboard.com | EDAboard.de | EDAboard.co.uk | WTWH Media

Color sensor with BASYS3 VHDL

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - FPGA - Color sensor with BASYS3 VHDL


Guest

Mon Mar 18, 2019 7:45 pm   



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


Guest

Mon Mar 18, 2019 8:45 pm   



On Monday, March 18, 2019 at 2:28:50 PM UTC-4, utkud...@gmail.com wrote:
Quote:
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.

elektroda.net NewsGroups Forum Index - FPGA - Color sensor with BASYS3 VHDL

Ask a question - edaboard.com

Arabic version Bulgarian version Catalan version Czech version Danish version German version Greek version English version Spanish version Finnish version French version Hindi version Croatian version Indonesian version Italian version Hebrew version Japanese version Korean version Lithuanian version Latvian version Dutch version Norwegian version Polish version Portuguese version Romanian version Russian version Slovak version Slovenian version Serbian version Swedish version Tagalog version Ukrainian version Vietnamese version Chinese version Turkish version
EDAboard.com map