Function Generator (AD9833 Based) : Step 1: Demonstration
Function Generator (AD9833 Based) : Step 1: Demonstration
Step 1: Demonstration
amplitude of output, maximum is 12 volts. On reaching the desired place, button(Rotary Encoder's
Push Button) is pressed, the pointer is locked at that
The middle knob (potentiometer) controls the o set position. Now scroll the encoder to increase or decrease
voltage of output. the number value at the place. Pressing the button once
again sets the value at the respective place and now the
The Red knob is attached to a rotary encoder which is encoder can be scrolled to move on any other place.
used to set the frequency, basically scroll the encoder
clockwise and anti-clockwise to move the pointer I know I couldn't explain the whole value setting process
(Decimal on 7-Segment :P) right and left respectively to properly :) The above video can help in visualizing the
a desired place. whole process.
Power supply circuit we just made in previous step doesn't really get rid of ripples completely. But when making such a
device, one should try to achieve the lowest possible noise.
Ground Loops! I prototyped everything on breadboards before soldering everything on a PCB and
breadboards are notorious noise lovers. Ground loops can be removed by using Star-Grounding and
using PCBs.
MAX7219 is also known to introduce high frequency noise(see pictures) in power rails.
I am no expert in designing PCBs neither did I have enough budget to get it fabricated from fabrication house. Thank
God! I found a video on "Capacitance Multiplier" by Dave Jones of EEVblog (I am his big fan!)
https://www.youtube.com/embed/wopmEyZKnYo
Using this method instantly solved all noise related problems. I was greeted by clean output.
I found an interesting read on allaboutcircuits forums about a gentleman who was able to solve noise issues with
MAX7219 by limiting current drawn by its data lines simply by using 2 resistors. Linked here.
The MAX7219 issue was solved by placing 2.2 k ohm delighted by it that I didn't touch it (fearing I would
resistors in DIN and LOAD pins. This was suggested by accidentally mess something up), until I was done with
helpful folks in this All About Circuits forum post designing PCB.
Also, I used two LM7805 Linear Regulators, one for the "The Fear" was born when AD9833 decided to stop
microcontroller and the other for the display. This too working for unknown reasons when I was busy
helped in reducing noise. removing noise. I had to order another module :(
This was the most fun part of the project! Designing PCB was bugged with noise and pretty unstable, instead after
and learning bits about "PCB Design Rules". I have no watching GreatScott! video I ended up using TL071 Low
professional training in this subject (Maybe in the future Noise Operational Ampli er IC. In fact, the Operation
I will, I am an EE student though) random youtube Ampli er Implementation is done identically to that of
videos and articles on the web helped me through it. GreatScott!'s
The schematic of the project is attached below as pdf His channel is just plain awesome, go check it out for
le, picture shown above isn't very clear though. more electronics-related videos.
https://www.instructables.com/ORIG/FDI/MWC7/KP5H88CB/FDIMWC7KP5H88CB.pdf
Step 6: Supplies
Capacitors :
Resistors :
10k ohm
47k ohm
Semiconductor Devices :
Misc. Components :
It's extremely important to remove stains and oxidation from Copper Clad PCB before proceeding. Isopropyl alcohol is
useful, but I used very ne-grit sandpaper. Don't overdo sanding as might just remove too much copper.
Print the attached pdf le on glossy paper using "Laser Printer". Please make it is Laser Printer only. Actually, this method
itself is known as the "toner transfer method".
When printing make sure quality is set to high and "Actual Size"option is selected.
Download
https://www.instructables.com/ORIG/FWD/8E4A/KP5H88EL/FWD8E4AKP5H88EL.pdf
Step 9: Peeling Off
Now drop PCB into cold water and let it soak for around 5 minutes this will make removal of paper easy.
Now carefully peel o paper, most probably it won't come o in single try.
Paper can be removed from inaccessible areas by rubbing using ngers gently.
Although toner sticks quite well to copper, you can use brute force but make sure you don't end up
removing traces instead.
In upcoming steps you are going to play with corrosive toner transfer isn't perfect. If you nd broken/missing
chemical like Ferric Chloride, and it stains really bad! To traces while visually inspecting, use a sharpie/Permanent
prevent dying your skin yellow for a week (Or possibly CD marker to correct it.
worse situation).Please make sure to wear gloves and
if possible use safety goggles too. These markers hold up pretty well in ferric chloride.
Take spoonful of ferric chloride and add su cient amount to water so that PCB is fully submerged.
A spoon of FeCl3 (Ferric Chloride) might not su ce, you can add accordingly, fortunately same solution can be used
multiple times.
After you see no copper except under toner (which you can't see anyways!), remove PCB from solution and rinse it in
water, make sure to clean it completely (Remainder chemical on board and corrode traces after toner is rubbed o )
Here comes the boring part, btw end result is somewhat After holes have been drilled use a ne grit sandpaper
satisfying. I used a cute hand-drill which is suitable for again to rub-o toner exposing shiny copper traces.
PCB drilling and other ne work. Isopropyl alcohol might be a better option as it removes
risk of over sanding.
0.8 mm bit was used for majority of components and
wherever it was too tight for components to t I drilled
with 1 mm bit.
Dremel/Rotary tool is widely used for PCB drilling but the problem is without dress press its very inaccurate and nicky to
use. If you have a drill press go for it. But I don't have any and ended up destroying one copper pad(Although it wasn't a
big deal)
Aha! The most fun part of build when you see your project coming to life. I spent much of my day meticulously soldering
components in place. Please maker sure you are placing components correctly keeping in mind polarity and pinout.
Please refer to Ki-CAD les provided when soldering. Double check when soldering capacitors and transistors.
By evening I was done with soldering. As you can see in the second picture I had reference board le opened in front of
me because I don't want to place capacitors in opposite polarity and end up getting hurt. You should also do the same!
The code attached below requires some libraries to be Go to sketch > Include Library > Add .ZIP Library and
installed, to make your work easy I have mentioned all navigate to where you have downloaded them
the links to their respective github pages below
Repeat this process for all three of them.
AD9833.h
Math and TimerOne are preinstalled in IDE I guess.
ClickEncoder.h
I got some idea about using ClickEncoder.h from this
LedControl.h youtube video. Precisely where I implemented the menu
kind of function for setting the frequency using Encoder.
Download them as zipped folders In fact, the same channel educ8s.tv has many great
videos about arduino projects.
After downloading them Open Arduino IDE
Download
https://www.instructables.com/ORIG/FK1/J6MN/KOFRB4Y5/FK1J6MNKOFRB4Y5.ino
3-D printed option is probably a better option but I don't have access to any currently.
Wooden frame is nothing but a quarter inch thick plywood cut according to make a box with 4 sides (3 attached
permanently to one another and the 4th one to be used a lid and held by screws).
This process doesn't require any xed parameters you can easily make it tting your requirements.
For making square cutouts, rstly drill large holes and then use le to make cutout square.
For safety, I added a fuse between AC Mains Electricity and Primary of our transformer. See above schematics for more
detail.
Function Generator (AD9833 Based): Page 17
Step 21: Packed Everything In
Please be careful, this project deals with AC mains power supply! Make sure you are a professional or make this project
under a professional's supervision! Accidents can be lethal!
Overall I am very satis ed with the build, after so many years I got to make a project. It is quite functional and so far I
haven't encountered any major issues. But this is not by any means perfect. A lot many things can be improved :
Thanks!
Hi Gursimran
If there is a short on the board that blows the J2.2 fuse, the hot lines (J2.1, J2.3) are still hot and,
if presented with a path to ground (I'm assuming your case is grounded) there will be a shock,
spark, damage to your circuit. If the transformer is something like a 12v CT, the voltage (24VAC)
will not be dangerous to you but would easily damage your circuit.
Yeah, that's a classic mistake! It would be better to add a fuse on hot lines instead! But I think a
fuse on primary side should suffice . Anyways I am modifying the schematics and PCB file.
Thanks a lot for letting me know!
Nice project, very well explained in all the steps.
Can I have the Kicad files?
Very nice project and construction! Whar is the tichness of thew plastic sheets? The neme is
really "bakelite"? I know bakelite as the denomination for avery old type of plastic. Congrats,
Paulo, Brazil
Yeah, you are right, bakelite is a type of plastic. The sheets I used are probably 3-4mm thick.
Thanks a lot :)