8 bits Digital to Analog Converter

Thread Starter

JridiHamza

Joined Jul 22, 2014
18
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
thank you so much I'll try to understand it
for the software solution,I know that the pic has an A/D converter but it has a D/A converter too??
 
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.
Sounds like an day's work in protel and C. 100 bucks mate.

So to get this straight. The LDR is an input. The lamp is an output. The light level that the LDR sees denotes the intensity of the lamp.

Is this what you want?
 
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.
Don't forget to tell him about the missing snubber circuit too.
 

Lestraveled

Joined May 19, 2014
1,946
To help you understand....

- A triac is a switch, you must control when you turn it on.
- To know when to turn it on you must know when the AC sine wave passes zero. This requires a zero crossing detector. It is very simple, two resistor and the right opto-isolator is all it requires.
- If you turn the triac on at zero crossing the triac will remain on for the entire cycle. This will result in 100% intensity.
- The longer you wait to turn on the triac, the dimmer the light will be.

- Q1 and U3 make up the zero crossing detector.
- The two parts of U4 make up a delay circuit that is voltage controlled.
- The polarities of U5 work with U4 to yield the 0 to 10 volt intensity control.
- the output of U4 triggers the triac.

Mark
 

Lestraveled

Joined May 19, 2014
1,946
In software you would simply wait for the zero crossing signal and then delay for the intensity. Zero delay equals maximum intensity. Maximum delay equals zero intensity. Maximum delay equals the AC line frequency (period) divided by 2. 50Hz = .010 sec, 60 Hz = .0083sec. At the end of the desired delay you would simply drive the MOC2031 which triggers the triac.

No DAC0800 or opamp

Mark
 

Lestraveled

Joined May 19, 2014
1,946
Did you calculate all of the component values from scratch.
Yes, the timing capacitor C10 is the only thing that needs to change to operate at 50 Hz. The snubber values are for 60 Hz but should work for 50Hz.

My steam driven slide rule (calculator) says it should be .082 uF for 50Hz operation.

Mark
 
Last edited:
Yes, the timing capacitor C10 is the only thing that needs to change to operate at 50 Hz. The snubber values are for 60 Hz but should work for 50Hz.

Mark
I think that most of these guys are using textbook building blocks. This is how I was formally taught at Tafe college. The maths as you would know is quite intense to derive some of these component values from scratch. Particularly when it is an AC circuit.
 

Lestraveled

Joined May 19, 2014
1,946
I might upload some projects soon for people to simply copy & paste and claim ownership of.
There is nothing original out there any more, especially on simple stuff like this. There are probably several good ways to do the same function out there and probably half of them are better/cheaper than this circuit. This is just a circuit, it is no big deal. It is the language we speak.

Mark
 
Top