> For the complete documentation index, see [llms.txt](https://dahl-design.gitbook.io/ddc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dahl-design.gitbook.io/ddc/1.-project-planning/pwm-circuit-control.md).

# PWM / Circuit control

DDC allows you to use PWM to control analog circuits, including motors, fans, generic LEDs, buzzers, etc. You can also use it as a on/off switch for a different circuit.&#x20;

<figure><img src="/files/23Vt6nUXpY8ZL43aN5ha" alt=""><figcaption></figcaption></figure>

PWM (Pulse Width Modulation) is a way for you digital microcontroller to emulate an analog signal. It can't really produce any voltages other than 0V and 5V (or 3.3V in some cases), but it can do some magic with those voltages. Switching the voltage from 0 to 5 and back again, repeatedly, really fast, will mimic something inbetween 0 and 5 volts.&#x20;

Think of it like a spinning ball which is half blue and half yellow. If it spins fast enough it looks green. At the same time, if the ball is 1/4 yellow and 3/4 blue, it will appear as teal. And if it is 3/4 yellow and 1/4 blue it will appear as moss green.&#x20;

To mimic 2.5V, the PWM signal will be 0 half of the time and 5V half of the time (50% duty cycle). To mimic 3.75V, the PWM signal will be 0 25% of the time, and 5V 75% of the time (75% duty cycle).&#x20;

<figure><img src="/files/6oHD4kZwKNitnf3dxZwq" alt="" width="375"><figcaption></figcaption></figure>

In DDC you'll set up PWM channels, one PWM compatible microcontroller pin per channel. You'll be able to manipulate the PWM signal with your buttons, toggles, rotary encoders and just plain software - having the PWM change or trigger when certain conditions are met. Not all microcontroller pins can offer PWM, so read the pinout for your controller.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dahl-design.gitbook.io/ddc/1.-project-planning/pwm-circuit-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
