Finally, I have managed to design a PCB for my DIY generator based on an AD9833 with additional analog circuity and controlled by an ESP32 MCU with a touchscreen-based user interface.
Because everything that I have used in this design were more or less mentioned in the earlier posts, this one will be a short one.
Whole thing was designed with a free PCB design software KiCAD. In my opinion it is one of the greatest free tools out there and it is quite easy to start with for a beginner.
Links to project’s all posts
- VCA822 Gain Amplifier Circuit
- LM7171 Offset Circuit
- Gain and Offset Control Filter Circuit
- Dual 5V Power Supply
- Dual 12V TPS65131 Power Supply
- Battery Charging Circuit with BQ24295
- Basic WEB Interface
- IPS Capacitive LCD on an ESP32
- IPS LCD, ESP32 with eSPI library and Touch screen
- Final PCB Design for the DIY Waveform Generator (this post)
- Custom Design PCBs and How To Get Them Manufactured
- Soldering the PCB
- AD9833 Library and Further Output Noise Reduction
- Arduino BQ24295 Battery Charger Library
- LCD GUI with LVGL on ESP-32
- 3D Printed Enclosure
- Finished DIY generator
The schematics are put together from previous posts looks like this:
As you can see, there are three parts of the schematics: analog, power supply and others (MCU, LCD connectors etc.). The schematics has several additional capacitors on power rails. Also, now there is a switch to turn everything off.
Battery voltage measurement circuit was added to the PCB. It was used because the battery charging IC doesn’t report battery voltage and without these reading it would be hard to tell the batteries percentage shown on the LCD screen. To lower the current drain from the battery, this circuit uses a MOSFET which is turned off when main power is cut off with a switch.
The analog part has two output SMA connectors. The first one is used to output waveform after gain and offset control circuits. The second SMA connector outputs square wave directly from the MCU. This output could be used to connect to other digital circuits which use 0-3V voltage signals. Both outputs can be turned on/off with an onboard relay.
SMA connectors were used not because it is some kind of high frequency device, but because these connectors are smaller than regular BNC and are more suitable to this portable application.
Also keep in mind that some parts and/or their values might change during assembly and/or final PCB testing.
Finally, a fun fact. All ESP32 pins (except one – input only pin) were used. So, it seems that parallel LCD + I2C and some output pins can be used in one project. Note, that even RX and TX were used as SPI pins for the AD9833.
And finally, here are the pictures of the PCB:
For unknown to me reason 3D viewer showed only two models of the footprints, so I made a screenshot with no models on the PCB.
The PCB itself is smaller that the LCD which is going to be used for the generator, so whole device shouldn’t be bigger than the bezels of the LCD (of course except for the device’s thickness).
I probably will go with thinner PCB (~1mm) to save some space.
Also, because there are a lot of traces on both copper layers, the ground planes are scattered all over the PCB instead of being one continuous peace. We will see how it works out in the final PCB.
As I have the design, final thing to do is to order the PCB to be manufactured and see if it will work as expected.