Skip to the content
PCBKitNew board
2 layers118.1 × 67.3 mmFunctiongeneratorMK3PowerControl, the printed circuit board in 3D

FunctiongeneratorMK3PowerControl

pstimpel/waveformgenerator14

A waveform generator based on XR2206 and Arduino

Size
118.1 × 67.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
42
Nets
55
Pads
138
Tracks, vias
310, 0
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
25 Mar 2020
Updated
10 Jan 2023

Overview

FunctiongeneratorMK3PowerControl is an open-source printed circuit board by pstimpel, from the pstimpel/waveformgenerator repository on GitHub. It is a 2-layer board of 118.1 × 67.3 mm with 42 parts on 55 nets, routed with 310 tracks and 0 vias.

It is built around the LTV-847 and BC337. Its parts include 12 connectors, 10 resistors, 9 capacitors, 3 ICs and 2 diodes. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

Waveform Generator

Video on Youtube

Click to play video

First of all, the credit for creating the basic circuit goes to Scullcom Hobby Electronics Youtube channel, who is inactive meanwhile - sadly.

https://www.youtube.com/channel/UCDqryeq1kMDSEQwltWqASrA

Project page at Thingiverse: https://www.thingiverse.com/thing:4243526

Project page at Prusaprinters: https://www.prusaprinters.org/prints/27172-xr2206-waveform-generator

Why?

Someone said: when starting the hobby electronics, you will need to build 2 things, a power supply and a waveform generator.

Again, why?

I was keen to dive into electronics again, after 20 years of ignoring this hobby. To get some practice again, I thought building such a generator would be fun. It was fun.

What did you change on the original circuit?

Based on Scullcoms circuit I started creating an Arduino controlled waveform gegenerator. My goal was to control as much as possible by the Arduino. So I removed the following parts from the original circuit:

  • switch for changing from sine to triangle wave
  • switch for changing from sine/triangle to square wave
  • switch for enabling pulse width modulation
  • switch for changing the frequency range

I replaced them with a relay and some opto isolators.

Was there any challenge?

Uh, plenty of challenges.

Figuring out how to replace mechanical switches by opto isolators and relay was kind of a long way for me. First of, I tried to do it by simple transistors, and failed. So opto isolators were the next try, and I was able to replace 3 of 4 switches by these ICs. One left. So I tried a micro relay, and this worked out great.

Another issue I had was to balance out the whole circuit, so I would be able to select halfway decent frequency ranges. Finally, a big enough coarse frequency potentiometer combined with a trim poti did the trick. My goal was to have kind of smooth waveforms, not to hunt Megahertzes for the marketing paper.

I built the whole circuit at least 4 times on breadboards. And what to tell: those breadboards can be a pain in the ass, at least the cheapos.

What can you expect?

You will get a waveform generator able to generate sine, triangle and square waves. The frequency range is from about 1 Hz up to 100 kHz, split into 5 ranges you can switch between (1-10, 10-100, 100 to 1,000, 1,000 to 10,000 and 10,000 to 100,000 Hz, roughly). You can adjust the frequency within these ranges by two potis. The amplitude is about +5 to -5 V (adjustable) at the 50 Ohms output, and from 0 to 5V at the TTL output. There is a basic Pulse width modulation available as well. You can adjust the pulse width. By combining sine or triangle waves and PWM you recieve kind of a ramp modulation. The waveform is quite solid, but with 100kHz you will see some distortion and spikes. It seems this is kind of a typical behavior of the XR2206 chipset. There is a frequency counter used to display the set frequency. However, this is kind of an estimation, especially in very low Hz ranges.

What you will find in this repository

Folder enclosure

This folder contains the stl files to 3D print the enclosure. I was using PLA and my Prusa I3 Mk3 printer. On top, there are 2 PDFs containing labels. You could just print them, cut them out of the sheet of paper, use an exacto knife to cut the holes, and mount it to the front of your enclosure

alt text

Folder circuits

There are 2 circuits. One keeps all the control stuff and the Arduino, and the other creates the waveform and gets controlled by the control board. There are gerber files, the KICAD board file, and PDFs with the circuit scheme itself. In each subfolder you wil find a list of parts.

What to buy (BOM)

Beside the stuff from the parts lists in the circuit folders, you will need

  • potentiometer 10k linear, 6mm axle (gain control)
  • potentiometer 1M linear, 6mm axle (frequency control, coarse)
  • potentiometer 10k linear, 6mm axle (frequency control, fine)
  • potentiometer 1ook linear, 6mm axle (PWM control)
  • 3 push buttons, closing type, like in https://www.amazon.de/gp/product/B07MY2WVQ3
  • 1 switch, like in https://www.amazon.de/gp/product/B07MY2WVQ3
  • 1 smaller heatsink for TO220, LM7812
  • 1 midsze heatsink for TO220, LM7805
  • 15 V power supply with 5.5x2.1 connector
  • matching 5.5x2.1 socket for your power supply
  • 25 cylinderhead screws, M3x12
  • 16x2 I2C LED for Arduino
  • 2 BNC sockets
  • wires
  • Pinheaders 2.54mm
  • matching IC sockets if you dislike soldering the ICs to the PCB directly (2x 8pin, 1x 14pin, 3x 16pin)
  • 3 screw terminals, 2 poles, 5mm
  • dupont style wires or similar to connect to pinheaders

Howto

Fast lane

Order PCBs and parts, solder all the stuff together, patch the Arduino using the sketch provided, 3d Print the enclosure, put PCBs inside enclosure, mount LCD, potis and switches to the front, solder dupont style wires to them, connect with the PCBs, mount BNC sockets to the front, use some cable to connect them to the PCB, insert 5.5x2.1 soocket in its pocket, lock it using the lock, connect it to the PCB. Lock the PCBs using the pcblock, secure it using one of the screws. Close the enclosure. Connect power, switch the device on, and have fun.

alt text

alt text

alt text

alt text

alt text

alt text

alt text

Remarks, hints

Arduino

To run the display you will need to add library LiquidCrystal_I2C by Frank de Brabander.

To have frequence counting, you will need to add library FreqCounter by Martin Nawrath.

Breadboarding

I highly recommend testing the circuit on a breadboard before you go for the soldering stuff. You will learn much more that way than by just following this rough guide.

alt text

Pricing vs functionality vs fun

If you look for a decent waveform generator delivering Megahertz samples, buy one.

If you look for the cheapest of all solutions, by such a chinese XR2206 kit for less than 10 USD.

If you want to enjoy DIY, start buying parts and follow the guide I provided. Good luck, wish you well.

Credits

'rine 77' https://github.com/rine77 contributed updated circuit data, compatible with Kicad6

CORONA

This project was finished during the spare time provided by Corona. If someone reads this in the future, I really hope Corona is no issue anymore. Until then: stay safe, wash your hands, and take care of your family.

Parts

42
QtyValueFootprintReferences
4390RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R9, R10
3100nFCapacitor_THT:C_Disc_D8.0mm_W5.0mm_P7.50mmC1, C5, C6
310kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR6, R7, R8
21N4007Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1, D2
2330nFCapacitor_THT:C_Disc_D8.0mm_W5.0mm_P7.50mmC3, C4
2390Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3, R5
250kPotentiometer_THT:Potentiometer_Bourns_3266Y_VerticalRV2, RV3
110nFCapacitor_THT:C_Disc_D8.0mm_W5.0mm_P7.50mmC9
110uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC7
112V GND 5VConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ10
114VTerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ9
11nFCapacitor_THT:C_Disc_D8.0mm_W5.0mm_P7.50mmC8
11uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC2
1270Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR4
1500Potentiometer_THT:Potentiometer_Bourns_3266Y_VerticalRV1
1Arduino_Nano_v3.xModule:Arduino_NanoA1
1BC337Package_TO_SOT_THT:TO-220-3_VerticalQ1
1BTN FormConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ3
1BTN PWMConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ4
1BTN RangeConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ2
1DisplayConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ8
1FreqCountConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ7
1FreqRangeConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5
1G6S-2Relay_THT:Relay_DPDT_Omron_G6S-2K1
1LM7805_TO220Package_TO_SOT_THT:TO-220-3_VerticalU3
1LM7812_TO220Package_TO_SOT_THT:TO-220-3_VerticalU2
1LTV-847Package_DIP:DIP-16_W7.62mmU1
1MOConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ12
1SIN-TRI-SQU-PWMConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ1
1WaveA1Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ6
1WaveA2Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ11

Questions

How big is the FunctiongeneratorMK3PowerControl PCB?

It measures 118.1 × 67.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the FunctiongeneratorMK3PowerControl use?

42 parts, built around the LTV-847 and BC337. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the FunctiongeneratorMK3PowerControl KiCad files?

From the pstimpel/waveformgenerator repository on GitHub, at the commit this page was made from: the board is circuits/control/FunctiongeneratorMK3PowerControl.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the FunctiongeneratorMK3PowerControl design in my own project?

Its repository states no licence, so its author keeps all rights: ask pstimpel before reusing the design.

More from pstimpel/waveformgenerator

1

Similar boards

  • 2 layers85.6 × 56.5 mmBottom HAT, the printed circuit board in 3D

    Bottom HAT

    PetervanderMeij/train-controller

    Raspberry Pi model train controller

    59 parts
  • 2 layers160 × 100 mmMPCNC Nano Estlcam Shield, the printed circuit board in 3D

    MPCNC Nano Estlcam Shield

    tnn85/MPCNC-Nano-Estlcam-Shield

    Ein CNC Shield für die MPCNC in Verwendung mit Estlcam

    96 parts70
  • 2 layers83.8 × 120.7 mmAtu100wifi, the printed circuit board in 3D

    Atu100wifi

    ftl/atu100wifi

    A wifi adapter device for David Fainitski's ATU-100 antenna tuner (https://github.com/Dfinitski/N7DDC-ATU-100-mini-and-extended-boards)

    31 parts28MIT
  • 2 layers63 × 80 mmBrakeOutBoard, the printed circuit board in 3D

    BrakeOutBoard

    gmoccapy/T4-MFA

    This is a color MFA designed to be used in a Volkswagen T4 Van

    65 parts9
  • 2 layers155 × 108 mmOpenPlc Rpi, the printed circuit board in 3D

    OpenPlc Rpi

    FOSSEE/openplc_v2

    115 parts5MIT
  • 2 layers320 × 81.3 mmDisplay and controls board, the printed circuit board in 3D

    Display and controls board

    411568/Atmega8_FM_radio

    Simple FM radio based on Atmega8 and TEA5767 module

    103 parts3MIT
  • 4 layers157.5 × 130 mmJv thesis, the printed circuit board in 3D

    Jv thesis

    JhonVelasquez/Embedded_system_Synchronize_Plant

    Project of a embedded system that synchronizes signals in a plant. There is electronic (PCB) and software design (FreeRTOS for STM32F7).

    233 parts2
  • 2 layers228.6 × 152.4 mmMainPCB, the printed circuit board in 3D

    MainPCB

    0x9ONU/BOREALIS

    71 parts1