STM32F051C8 controlling 0-10V lighting using GPIO pin

Thread Starter

zazas321

Joined Nov 29, 2015
936
Hello. I need to implement a way to achieve 0-10V analog output controlled by 0 - 3.3V logic from the microcontroller. I have got acces to higher voltage supply which I can step down to +10 or +12V if required.

The only sensible option I can think of is to use DAC. From the microcontroller datasheet:
https://www.st.com/resource/en/datasheet/stm32f051t8.pdf
It is mentioned about in-built 12-bit DAC but I am not sure if i can implement it for 0 -10V?

Another option I see is to built an R2R ladder or use DAC chip but I am not sure if I have that many GPIO pins available lets say 8 GPIO for 8-bit converter.

Any suggestions pleae?
 

MrChips

Joined Oct 2, 2009
30,794
There are a number of ways to produce a linear analog output covering a 0-10V range.
You did not say how much current you need to provide.

Almost all MCU solutions will not provide 10V output. You will need to boost the signal to the desired voltage and current (power).

Possible options:
  • Internal DAC
  • External DAC
  • PWM output
  • Digital Potentiometer
What is your maximum frequency if the output is not a constant DC signal?
The low voltage output can be amplified and the solution will depend on the voltage, current and frequency of the desired output.
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
There are a number of ways to produce a linear analog output covering a 0-10V range.
You did not say how much current you need to provide.

Almost all MCU solutions will not provide 10V output. You will need to boost the signal to the desired voltage and current (power).

Possible options:
  • Internal DAC
  • External DAC
  • PWM output
  • Digital Potentiometer
What is your maximum frequency if the output is not a constant DC signal?
The low voltage output can be amplified and the solution will depend on the voltage, current and frequency of the desired output.

Thank you for your reply. I am not sure what do you mean by maximum frequency?

To answer your question regards to how much current i need to drive - the current I require to drive is little as this is just control signal. I need to achieve 0-10V output for light dimming control.

Currently, I am looking into solution of using internal STM32F051C8 12-bit DAC and amplifying it by 3 which would result in 0 to 9.9V which is close enough I guess. I am looking into using LMC6081 op-amp for that as it would be able to reach rail to rail voltage without the need to supply negative voltage .
The circuit diagram see below:
upload_2019-6-25_14-35-47.png



Do you think that would work fine?
 

MrChips

Joined Oct 2, 2009
30,794
If you are attempting to control a lamp directly, the easiest method is to use a logic level MOSFET such as IRL510 controlled directly with PWM from a GPIO output pin.

If you are to use low current output to drive a linear controller, you can still use PWM output, smoothed and boosted to 10V.
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
I am using low current output. The 2 options I have considered is to use PWM from GPIO pins and amplify them by 3. Another options is to implement internal DAC to convert 0 -3.3V and amplify by 3 to achieve 0 to 9.9V. I would like to implement DAC. As it seems more simple
 
Last edited:
Top