An early stage of the homebrew AD9833 sig gen. Using an Arduino nano and an AD9833/MC41010 DDS/attenuator module. I plan to trickle out status reports in a non-linear manner....
#electronics #diytestgear #siggen
Prior to actually drilling that case I prototyped the control part of of the generator, so there was at least a chance I'd end up with something working.
#electronics #diytestgear #siggen
I wanted to use an optical encoder of this type for the main control as I have used them before for a VFO and they are really nice. A ball race at each end make the action super smooooth. No clicky knobs here!
#electronics #diytestgear #siggen

The optical shaft encoder was not without problems.

It turns out that the bearings are so good that an inbalance in the knob is enough to cause the knob to turn slightly when released in certain positions. The heavy side was opposite the pointer so it tried to turn the pointer upmost

Gluing a nut under the pointer side balanced the knob. Problem solved.

#electronics #diytestgear #siggen

So next Issue- The board with the AD9833 DDS and the MCP41010 digital pot looks like the diagram, without the bits in red. The board I received had a 10k feedback resistor around the AD8051 rather than the 5k shown. The sine and triangle wave from the DDS has a swing from 38mV to 650mV . Feeding 650 mV into a non inverting amp with gain of 11 will give an output of 7.15V - clearly not going to happen on a supply of 5V . Changing from10k to 5 k feedback results in no more clipping .
Next issue DDS/digital pot board issue -
The output of the DDS swings from 38mV to 650mV, so the centre point is 344mV. However the bottom end of the digital pot is connected to ground . So if we switch the digital pot from full output to a setting that is say 20dB down, the whole output waveform shifts towards ground. This would be OK if we only want to change this once, but I want to generate a series of full/ -20dB pulses.

To fix the DC offset change when changing the level of the pot, I lifted the PB0 pin of the digital pot and connected it to a point that I set to around 344mV. This was also bypassed with an 820u cap so it was a low impedance down to a few hz.
Now there is no DC offset when the level is changed.
The mods fro this are in red in the schematic a couple of posts back.

A better solution than the resistive divider and bypass cap would be a resistive divider into a unity gain opamp feeding PB0,

Next DDS/digital pot board issue -
The AD9833 data sheet proudly claims that it is 'capable of producing sine, triangular, and square wave outputs.'
This is True, but....
The sine and tri outputs swing between 38mV and 650mV on the output pin. The square wave is a digital output on the same pin which swings from basically Gnd to Vdd. There is no way the following op amp won't clip this , which sort of doesn't matter as it clips it to a square wave. cont ...

#electronics #diytestgear #siggen

However the p-p output of the opamp will be 3.7V for a sin and 5V for a square which annoys me a bit. Because the digital pot is in the middle I used that to drop the level of the square wave so its comparable.
This works out to setting the pot at 24/255th for square waves

I can only ever see myself using a square wave with the straight sig gen function, not pulse, ramps etc, so losing most of the range of the pot to bring the level down isnt a problem

#electronics #diytestgear #siggen

If you set the AD9833 to tri wave(bypasses sin rom) and frequency to zero, writing to one of the phase registers will allow you to use the AD9833 as a (not so simple) DAC. If you write a pseudo random sequence, you can get white noise!

uint32_t x =0x02;

for(i=0;i<32000;i++){
/* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
AD.writePhaseRegister(0, x&0x0fff) ;
}

#electronics #diytestgear #siggen

So the Soanar 5VA transformer I bought has a magnetizing current (no load) of 45.7mA on 240V - that's about 11 Watts ~ Admittedly some is out of phase due to the primary inductance, but a good bit must be transformer losses as it gets quite hot doing nothing.

The Stadium 2155 15VA transformer has a magnetizing current (no load) of 11.9mA --2.86 Watts.

Seems a waste to use the bigger transformer, but it will keep things much cooler inside the box.

#electronics

#electronics #diytestgear #siggen

So I eventually entered the underworld (Under the house where the crate of transformers is ) and found another transformer, 12.6V CT 3.76VA Which doesn't get hot doing nothing, Using a voltage doubler cct it generates +/- 17V and +6.5V prior to the regulators.
6.5V seems a bit low for a 7805 , but it keeps regulating even with when I drop the mains input a bit. If its an issue I can replace the 1n4007 diode with a schottky which will give me an extra .4V

So the ad9833/MCP41010 siggen has actually been finished for a while. Its a bit of a tangled mess inside, but it works!
I measured the distortion at 0.15% or -56dB which is good enough for an agile sig gen on the bench( New side project - continue modifying the AWA G50 siggen I started on 30 years ago!)
Photos show the siggen in pulse mode testing attack/release of dbx163.
I bet it will spend 99.9% of time generating a simple sine wave!

#electronics #diytestgear #siggen

@vk3kri Ah, but if you...

Rue, its the same circuit...

@RueNahcMohr
Strangely enough that's how I visualised it, but not how I drew it after it was built.
@vk3kri If you use AD9834 instead of AD9833, you get current output and a FS Adjust input that can be fed from a DAC driving a current source, which allows you to adjust amplitude without the DC offset problems. See Circuit Note CN-0156 for details
@cliffordheath
Thanks for that, that is interesting. Also having the square wave out on a separate pin might be useful although would require external switching.
I probably should have done a bit more research before going 'that looks useful - I'll buy one' for the AD9833/MCP41010 module.
Given this is a one off project I'll keep going with what I have working so far - unless I change my mind again!
@vk3kri but there affordable small encoders "without clicks" so called "no detent"?
@ly2ss Yes, I've seen them, or at least have used them, but the type I've used just feel so good.
If my current bench audio sig gen is any guide, I will spend a lot of time twirling the dial back and forwards, so I think I'll get my moneys worth.