8 bits Digital to Analog Converter

Discussion in 'General Electronics Chat' started by JridiHamza, Jul 29, 2014.

  1. JridiHamza

    Thread Starter New Member

    Jul 22, 2014
    18
    0
    Hi everyone
    I want to convert an output tension from pic from a binary word to an analog tension using an integrated circuit.I used the DAC 0800 and 0808,I had it converted in the AOP output but the problem is when I link it to an optocoupler rn on a lamp its value fall down and nothing happen
    could you help me with this plz...I'll give you the circuit's schema
     
  2. JridiHamza

    Thread Starter New Member

    Jul 22, 2014
    18
    0
    Hi everyone
    I want to convert an output tension from pic from a binary word to an analog tension using an integrated circuit.I used the DAC 0800 and 0808,I had it converted in the AOP output but the problem is when I link it to an optocoupler rn on a lamp its value fall down and nothing happen
    could you help me with this plz...I'll give you the circuit's schema
     
  3. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    Is your goal to be able to adjust the intensity of the light?

    If this is true then the circuit that you are using to control the light is incorrect. The MOC2031 is an ON/OFF switch. With this circuit you can only turn the light on or off, with no in between intensities.

    Mark
     
  4. AlphaDesign888

    New Member

    Jul 27, 2014
    189
    10
    Your OP AMP configurations are wrong. I presume that you want an comparator? Do an search on the forum for comparator using OP AMPs. No feedback unless you require hysteresis. Even then it is wrong the way you have it. I see no Vref either. You cannot use absolute GND as an Vref, since there is no such thing as an 'ideal' OP AMP.

    You want the OP AMP configured as as an comprator right? This is the only thing that would make any sense with what you are doing.
     
  5. AlphaDesign888

    New Member

    Jul 27, 2014
    189
    10
    LM358 makes a terrible comparator. Use LM393. This is an specific comparator IC with open collector outputs.
     
  6. JridiHamza

    Thread Starter New Member

    Jul 22, 2014
    18
    0
    yes my goal is to adjust the intensity of the lifht...how can I correct my circuit do you have any idea plz :)
     
  7. JridiHamza

    Thread Starter New Member

    Jul 22, 2014
    18
    0
    my goal is to adjust the intensity of the light using a photovoltaique cell(LDR) as an input then I use this intesity to light on the lamp is my circuit is right except the AOP??
     
  8. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    JridiHamza
    You have the same post in two forums. The moderators may adjust this. Until then I will continue to post in this thread.

    JridiHamza, are you writing the PIC code?

    Controlling an incandescent light with a triac and a MOC2031 is very simple, but the control is done in the software of the PIC. You do not need a DAC or opamp. You can use the MOC2031/triac circuit that you have. You will have to add a "zero crossing detector". The circuit will be much simpler than your current schematic but you will have to write some code to make it work.

    Mark
     
  9. JridiHamza

    Thread Starter New Member

    Jul 22, 2014
    18
    0
    I wrote the code for converting the input intensity from the photovoltaique cell (LDR) to an 8 digital binary word then I make it an output from the Port D of the pic;after that I have to reconvert it to an analog intensity using the DAC to light on the lamp...about the D/A converter with code I don't have any idea about it...can you give me a urgent solution with the DAC 0808 or 0800 then when I have time I'll try it with code
    thank you very much
     
  10. AlphaDesign888

    New Member

    Jul 27, 2014
    189
    10
    So you this is why you have the OP AMP configured as an unity gain buffer? You figure that voltage from the DAC will vary the brightness of the lamp?
     
  11. JridiHamza

    Thread Starter New Member

    Jul 22, 2014
    18
    0
    yeah right ,but why it doesn't work?
     
  12. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    You will not like it. It takes a lot of parts to do this function in analog.

    I built this up a few years ago. 0 to 10 volts input at TP5 will give you 0 to 100% brightness. You will have to rescale for a different voltage input.

    It is so so much simpler to do this in software. You would have less parts than you do now.

    Mark
     
  13. AlphaDesign888

    New Member

    Jul 27, 2014
    189
    10
    The LED inside the optocoupler is an current controlled device, not voltage.

    You need to consider using PWM (Pulse Width Modulation) techniques to control the brightness of the lamp. This is an textbook method.
     
  14. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    I don't understand how you want your circuit to work. Looks like you're regulating voltage into MOC3021. If it is enough voltage (1.2V) and current (15mA) to light the internal LED, it'll trigger on every cycle and you get (nearly) full light. If not, it will not trigger at all, and you won't get any light.
     
  15. AlphaDesign888

    New Member

    Jul 27, 2014
    189
    10
    He is trying to use an varying DC voltage from the DAC to control the brightness of an lamp.
     
  16. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    JridiHamza
    The reason it does not works is that you are feeding a variable voltage to a circuit that requires a pulse. It would be the same if you connected your DAC to a logic chip input. You could change the DAC output all you wanted but nothing would happen until you crossed the logic threshold.

    Mark
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It seems that you are trying to control the intensity of an AC powered lamp using a TRIAC, controlled by an analog voltage level. That's not going to work; the TRIAC and thus the lamp will wind up being either ON or OFF.

    You will need to have a zero crossing input to your microcontroller to tell it when the AC is at zero volts; then you can delay for a relevant amount of time before turning on the TRIAC via the MOCxxxx. The MOC should be turned off when the zero crossing is detected.
     
  18. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    In order for you to control the intensity you do not need a DAC. You need to control WHEN to pulse the triac relative to the AC sine wave. You need to control time, NOT voltage.

    Mark
     
  19. AlphaDesign888

    New Member

    Jul 27, 2014
    189
    10
    He could use an comparator to simply turn the light on & off though.
    Since he has probably already built it and all, this would be an easy modification.
     
  20. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    He wants to control (vary) intensity and use the CS cell for intensity feedback. The issue is unworkable with his current circuit.

    He also has the same thread going in the Projects forum.
     
Loading...