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

Discussion Overview

The discussion revolves around the design of a circuit using the AT89C52 microcontroller and the TCS230 color sensor for an object sorting project. Participants explore the integration of these components, focusing on the sensor's frequency range, power supply considerations, and circuit design challenges.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant expresses uncertainty about the circuit design and seeks suggestions regarding the connection of the AT89C52 with the TCS230 and stepper motors.
  • Another participant points out that the maximum frequency of the TCS230 is 600 kHz, which may exceed the AT89C52's capabilities, suggesting control of illumination to mitigate this issue.
  • Concerns are raised about the power supply, with one participant stating they will use a regulated 5V 1A supply and questioning its safety for the TCS230, which is noted to be expensive.
  • Discussion includes the need to check the TCS230D datasheet for current requirements and the implications of using a non-heatsinked regulator.
  • Participants discuss the possibility of using a prescaler to manage the frequency and the importance of resolution versus range in the project.
  • One participant describes a proposed method for counting pulses from the sensor using timers and counters, while also expressing concern about the power supply potentially damaging the sensor.
  • Clarifications are made regarding the voltage limits for the microcontroller and sensor, with suggestions for ensuring safe operation.
  • Another participant advises against using resistors in the power supply line and suggests adding a crowbar regulator for safety.

Areas of Agreement / Disagreement

Participants express various concerns and suggestions regarding the circuit design and power supply, but no consensus is reached on the best approach. Multiple competing views on power supply safety and circuit design remain unresolved.

Contextual Notes

Participants note the importance of checking specific electrical characteristics from datasheets and the potential limitations of the power supply design, including the need for adequate voltage and current handling.

Who May Find This Useful

Individuals interested in electronics design, particularly those working with microcontrollers and sensors in project-based applications, may find this discussion relevant.

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: 482
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: 476
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 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · 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
8
Views
4K