8 bits Digital to Analog Converter

Thread Starter

JridiHamza

Joined Jul 22, 2014
18
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
 

Attachments

Thread Starter

JridiHamza

Joined Jul 22, 2014
18
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
 

Attachments

Lestraveled

Joined May 19, 2014
1,946
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
 
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.
 

Thread Starter

JridiHamza

Joined Jul 22, 2014
18
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
yes my goal is to adjust the intensity of the lifht...how can I correct my circuit do you have any idea plz :)
 

Thread Starter

JridiHamza

Joined Jul 22, 2014
18
LM358 makes a terrible comparator. Use LM393. This is an specific comparator IC with open collector outputs.
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??
 

Lestraveled

Joined May 19, 2014
1,946
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
 

Thread Starter

JridiHamza

Joined Jul 22, 2014
18
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
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
 
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??
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?
 

Lestraveled

Joined May 19, 2014
1,946
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
 

Attachments

NorthGuy

Joined Jun 28, 2014
611
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.
 
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.
He is trying to use an varying DC voltage from the DAC to control the brightness of an lamp.
 

Lestraveled

Joined May 19, 2014
1,946
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
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Lestraveled

Joined May 19, 2014
1,946
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
 
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
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.
 

Lestraveled

Joined May 19, 2014
1,946
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.
 
Top