• 0
Sign in to follow this  
kmesne

Green/Red detector and button controlled car (BASYS3/VHDL)

Question

Hi, I am a 2nd-year ee student, and I need to make a term Project. With BASYS3 by using VHDL.
 

My purpose is constructing a car which can be controlled with the buttons on BASYS3 ( I think I need Bluetooth module for it to RC a car). In addition to that my car should stop when it sees red ( i think I should use a color sensor for it) and should not work until it sees a green. These “red” and “green” can be anything like green cubic toys.

This color sensor does not have to be mounted on the car, but it would be better if it is.
 

I have very little information about basys3, vhdl, sensor design, etc. (this is my first course in ee I was learning principle courses like math, phy, cs )
 

I would appreciate any help.

Thanks.

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @kmesne,

We responded to your other question here with some detail, but I will try to elaborate a little bit more here.

The Pmod COLOR is not intended to detect colors from any sort of distance, so you would need it next to the red/green light indicator and then have it transmit data to the main controller for the car as opposed to be mounted on the car (unless the red/green indicator was on the car itself). I believe the Pmod COLOR could detect the green in a green cube, but it would need to be fairly well lit up due to the limitations of the sensor itself.

As a bit of perspective, this will be a large and non-trivial state machine (especially for first semester project) with a lot of conditions to be covered; is light red or green to control the enable bit on 2+ H-bridge drivers running the motor, which needs to be checked frequently in order to obey traffic laws, as well as the enable bit being toggled as appropriate when changing input directions if the vehicle can go in reverse to avoid burning out the h-bridges, pwm control over the enable pin to allow the vehicle to turn; all done over (presumably) 3 remote systems communicating with each other; the controller with the direction buttons, the color sensor detecting the light change, and the RC vehicle itself. Which system/input will have priority in the state machine and how often will you need to check each input to provide a "smooth driving experience" will all be things that you need to consider.

Some good resources for VHDL basics can be found at asic-world.com and fpga4fun.com, as well as this page that discusses state machine construction in VHDL.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

@JColvin
Thanks first of all

I did not understand what is the intention of Pmod color sensor then. Doesn't it sense colors of object ?

https://www.adafruit.com/product/1334 Can i use this sensor for it ? Last time I checked it sensed color of objects

Share this post


Link to post
Share on other sites
  • 0

Hi @kmesne,

The Pmod COLOR does sense the color of objects; it even uses the same chip as the Adafruit part that you listed.

The restriction (and perhaps I am misunderstanding your application) is that the color you are wanting to detect needs to be very close to the sensor. This is illustrated on the Adafruit page where they place an orange/apple directly on top of the sensor (link) in order to have it correctly detect the intended orange/green.

Let me know if you have any more questions.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

@JColvin I am rewriting my question then :

 

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

Share this post


Link to post
Share on other sites
  • 0

Hi,

>> I would be really glad if someone helps 

no one is going to do your course homework for you. But, I think you should talk with your supervisor. You've been thrown in at the deep end of the pool, which is OK only for someone who knows how to swim. Reading between the lines, you don't.

Now if this is a follow-up to a VHDL course: Review the course material and lab exercises, it will probably give you some shortcuts. If one could teach simply by throwing people into the pool, there would be no need for schools...

Otherwise, it looks (based on your post, of course), like a nasty amount of work without any focus e.g. connecting to "a" toy RC car feels like an exercise in tinkering, not engineering e.g. buy a $10 RC toy and hack the transmitter with an MTC61-ish optocoupler. To the FPGA, it looks like a LED.

Do not assume it's easy (in a sense of "don't assume swimming is easy").

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this