Skip to the content
PCBKitNew board
2 layers101.6 × 79 mmFunctiongeneratorMK3Frequency, the printed circuit board in 3D

FunctiongeneratorMK3Frequency

pstimpel/waveformgenerator14

A waveform generator based on XR2206 and Arduino

Size
101.6 × 79 mm
Copper layers
2
Thickness
1.6 mm
Parts
43
Nets
45
Pads
144
Tracks, vias
515, 10
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
25 Mar 2020
Updated
10 Jan 2023

Overview

FunctiongeneratorMK3Frequency is an open-source printed circuit board by pstimpel, from the pstimpel/waveformgenerator repository on GitHub. It is a 2-layer board of 101.6 × 79 mm with 43 parts on 45 nets, routed with 515 tracks and 10 vias.

It is built around the NE5532, 74HC14 and LTV-847. Its parts include 14 resistors, 13 connectors, 7 capacitors and 5 ICs.

Main components

3

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

43
QtyValueFootprintReferences
61kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2, R5, R6, R8, R13, R14
310kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7, R17, R18
320kPotentiometer_THT:Potentiometer_Bourns_3266Y_VerticalRV1, RV5, RV6
2100Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR11, R12
2100pFCapacitor_THT:C_Disc_D9.0mm_W5.0mm_P7.50mmC1, C8
2220uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC6, C7
247kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR15, R16
2NE5532NE5532P:DIP254P762X508-8U4, U5
110uCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC3
110uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC2
112V-GND-5VConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3
11uCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC4
12k2Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR9
150 Ohm OUTTerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ10
150kPotentiometer_THT:Potentiometer_Bourns_3266Y_VerticalRV2
174HC14SN74HC14N:DIP254P762X508-14U3
1FreqCoarse 1MConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ8
1FreqCounterD5 Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ4
1FreqFine 10kConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ9
1FreqRangeConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1
1LTV-847Package_DIP:DIP-16_W7.62mmU1
1MOConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ13
1OUT Gain 10kConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ11
1PulseWidth 100kConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ7
1SIN-TRI-SQU-PWMConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6
1TTL OUTTerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ5
1WaveA1Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ2
1WaveA2Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ12
1XR2206CP-FXR2206CP-F:DIP254P762X533-16U2

Questions

How big is the FunctiongeneratorMK3Frequency PCB?

It measures 101.6 × 79 mm and has 2 copper layers, 1.6 mm thick.

What parts does the FunctiongeneratorMK3Frequency use?

43 parts, built around the NE5532, 74HC14 and LTV-847. 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 FunctiongeneratorMK3Frequency KiCad files?

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

Can I use the FunctiongeneratorMK3Frequency 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 layers90 × 45 mmPEKG, the printed circuit board in 3D

    PEKG

    ostojaatanasijevic/EKG

    132 parts
  • 2 layers46.4 × 60.3 mmYatabaza synth, the printed circuit board in 3D

    Yatabaza synth

    ycwn/yatabaza

    An 8bit synthesizer based on YM3812

    32 parts1GPL-3.0
  • 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