Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Will this circuit work?

  1. Jul 21, 2006 #1
    Currently, I'm designing a project to sort objects using AT89C52 as the "brain" and TCS230 as the "eye". And so, it is neccessary 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.

    Attached Files:

  2. jcsd
  3. Jul 21, 2006 #2
    It's gotta be hard to see.

    :yuck: 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.

    Attached Files:

  4. Jul 21, 2006 #3


    User Avatar
    Science Advisor
    Homework Helper

    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.

  5. Jul 21, 2006 #4
    I've seen that...

    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: Apr 22, 2017
  6. Jul 21, 2006 #5


    User Avatar
    Science Advisor
    Homework Helper

    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 thats different.
  7. Jul 21, 2006 #6


    User Avatar
    Science Advisor
    Homework Helper

    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.
  8. Jul 22, 2006 #7
    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.

    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?
    Last edited: Jul 22, 2006
  9. Jul 22, 2006 #8


    User Avatar
    Science Advisor
    Homework Helper

    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:

    Add an external counter chip. The simplest would be a D-FlipFlop for divide by 2.
  10. Jul 23, 2006 #9
    thanks.... that solved it. I will work it right away.:biggrin:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook