AT89C52 and TCS230 Circuit Design for Object Sorting: Will it Work?

  • Thread starter Thread starter beluluk
  • Start date Start date
  • Tags Tags
    Circuit Work
Click For Summary
SUMMARY

The discussion centers on designing a circuit for object sorting using the AT89C52 microcontroller and the TCS230 color sensor. The circuit aims to process digital pulses from the TCS230 and control stepper motors based on RGB values. Key concerns include managing the sensor's maximum frequency of 600 kHz, ensuring safe voltage levels with a regulated 5V power supply, and implementing effective pulse counting using timers and counters. Suggestions include using a prescaler to handle high-frequency signals and ensuring proper power supply design to avoid damaging components.

PREREQUISITES
  • Understanding of AT89C52 microcontroller architecture
  • Familiarity with TCS230 color sensor specifications
  • Knowledge of timer and counter operations in microcontrollers
  • Basic principles of power supply design and voltage regulation
NEXT STEPS
  • Research the implementation of timers and counters in the AT89C52 microcontroller
  • Study the TCS230 datasheet for detailed electrical characteristics and maximum ratings
  • Learn about designing power supplies, specifically using L7805C voltage regulators
  • Explore the use of prescalers and external counter chips for frequency division
USEFUL FOR

Electronics hobbyists, embedded systems developers, and engineers working on object sorting projects or color detection applications.

beluluk
Messages
27
Reaction score
0
Greetings,
Currently, I'm designing a project to sort objects using AT89C52 as the "brain" and TCS230 as the "eye". And so, it is necessary for me to connect the AT89C52 with the TCS230 colour sensor and stepper motors. And before doing the real thing, i must know the frequency range of the sensor, i use leds to show me that.

I designed this circuit which I'm not so sure about.
The plan is to receive digital pulse from TCS230 colour sensor (J3), do something with the pulse with AT89C52, and send some output (J1 and J2).
The output will be connected to board 2 or board 3.
Board 2 is for displaying the RGB value from the sensor, while board 3 is for driving a 6V stepper motor.
I'm worrying about the voltages and the currents. I've added some resistors to the circuit, but I'm just not so sure about it.
Will the circuit work? Any suggestions?

Please forgive me if my english is not too good.
Thanks B4.
 

Attachments

  • board.jpg
    board.jpg
    53.8 KB · Views: 476
Engineering news on Phys.org
It's got to be hard to see.

i reviewed my post and i found out that it will make your head spin to see the image. so i repost the figure.

and since the picture is not so detailed, i want to note that the red arrowheads on board3 is meant to be diodes.
 

Attachments

  • board1.jpg
    board1.jpg
    41 KB · Views: 470
Try http://www.parallax.com/dl/docs/prod/datast/TCS230.pdf

They do discuss counting the color frequency.
The max frequency happens to be 600khz which is likely more than the AT89C52 can handle. They are thinking that you need to control the max illumination to fix this.

Interesting.
 
I've seen that...

NoTime said:
Try http://www.parallax.com/dl/docs/prod/datast/TCS230.pdf

They do discuss counting the color frequency.
The max frequency happens to be 600khz which is likely more than the AT89C52 can handle. They are thinking that you need to control the max illumination to fix this.

Interesting.

The truth is i already know how to handle the frequency, it is using the S0 and S1 pins on the sensor (and if that can not be done, we can always reduce the counting period:rolleyes: ). You can obtain the datasheets of TCS230 (i've downloaded em all) at http://taosinc.com. and about AT89C52 from www.atmel.com (this contains the DC characteristics)

It is the electrical design which worry me most. I will be using a regulated 5V 1A power supply as the Vcc. Will that be safe? The TCS230 costed me US$ 79. I don't want to waste that much money.

Ow yeah... i need to note here that I'm using the exact sensor on the link you shown above (TCS230). the TAOS real version is TCS230D with some electrical characteristics on the datasheets which i don't understand much.

Thanks anyway:biggrin:
 
Last edited by a moderator:
Hmmm, I don't see a power requirement for the module.
Look on the TCS230D data sheet. Find Imax.
The rest of the components look like <50ma.
If your regulator is just a non heatsinked Ic its probably good for 300ma. If its a real spec 1A continuous power supply that's different.
 
beluluk said:
we can always reduce the counting period:rolleyes: ).
Won't do it.
There will be a max rate at which you can toggle the uP port.

You could use a prescaler.
Which is more important?
Resolution or range.
 
NoTime said:
Hmmm, I don't see a power requirement for the module.
Look on the TCS230D data sheet. Find Imax.
The rest of the components look like <50ma.
If your regulator is just a non heatsinked Ic its probably good for 300ma. If its a real spec 1A continuous power supply that's different.

I will use a transformator to convert voltage to 6V 1A, and i will use a L7805C-V to regulate power for the microcontroller and sensor (and that makes a Vcc for me). Is it safe to connect the output of the regulator directly to the microcontroller and sensor? I've added some resistors to limit currents (which I'm not so sure).
I've heard that when ICs overpowered, for example, given voltage higher than 5.5V, it will burned out.

NoTime said:
Won't do it.
There will be a max rate at which you can toggle the uP port.

You could use a prescaler.
Which is more important?
Resolution or range.

What i was thinking is to use the timer/counter.
What i planned is:
let T0 to count pulses from the sensor's OUT for a determined time.
for example, if we use a 11.0592MHz crystal (and that makes the machine cycle 0.9216MHz), we can run T0 as counter and at the same time, T2 as a timer. Wait until T2 timed 921600 machine cycles (that makes 1 sec), (use the Reload mode, it would be: 3600*256 times(set RCAPH,RCAPL = 65536d - 3600d = 61936d = 0F1F0h and make T2 overflow 256 times), and then capture the T0 value.
The problem would be: The T0 can only count to 65535 times before it goes overflow. But it is easily solved by reducing the "period", that is the T2. For example if the max frequency is 500KHz, we must divide it by 2000 to make it below 256. We just divide the timer value, 921600/2000=460.8.

resolution is not so important in this project, so i would only make the RGB range only 0 to 255.

My problem now is the power supply, i don't want to burn up the sensor.

and by the way... what do you mean by a prescaler?
thanks.
 
Last edited:
beluluk said:
I will use a transformator to convert voltage to 6V 1A, and i will use a L7805C-V to regulate power for the microcontroller and sensor (and that makes a Vcc for me). Is it safe to connect the output of the regulator directly to the microcontroller and sensor? I've added some resistors to limit currents (which I'm not so sure).
I've heard that when ICs overpowered, for example, given voltage higher than 5.5V, it will burned out.
Running Vss at 5.5v unlikely to damage an IC in a 5v logic family.
Having Vss at 5.0v and applying 5.5v to an input pin will likely destroy it.

I'd have to go back and look, but I think the documentation said that your sensor could be operated at 7v.

On you power supply design. 6v is low for a 5v regulator. You would need a very large capacitor.
A 5v regulator needs Vin min of about 7v over the entire AC cycle to operate correctly. A 10v transformer would be a better choice.
It's a trade off between how much heat you have to get rid of vs how big your input cap has to be.
Build your power supply.
Load it to double your expected load.
If it doesn't overheat and maintains regulation you will be ok. Regulator Ics are very reliable and rarely fail.
Don't forget the .1 bypass caps. They are important.

Putting a resistor in a power supply line is a very bad idea.
You could always add a crowbar regulator to kill any power supply failure.
They sell Ic to do this function :smile:

beluluk said:
and by the way... what do you mean by a prescaler?
thanks.
Add an external counter chip. The simplest would be a D-FlipFlop for divide by 2.
 
thanks... that solved it. I will work it right away.:biggrin:
 

Similar threads

Replies
12
Views
2K
  • · Replies 51 ·
2
Replies
51
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
20
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
4K