The AD9833 module is soldered on the copper side of the stripboard - on the opposite side from the Nano. I haven't shown the power and "signal" leads. Red lines are wire links on the stripboard or flexible wires joining the boards together. In my diagram, the copper of the stripboard is shown in cyan. Attach the boards together with soldered stand-offs. The boards are shown from the component side. There are two stripboards - one for the Nano and the AD9833 and one for the display. I've shown a stripboard layout for the circuit. If you have built my "Oscilloscope and Signal Generator in a Matchbox" and want to test this INO file with it, alternative pin numbers are enabled via a #define. The pin numbers used for the OLED are declared around line 70. (I don't want to upload another copy here and have to maintain two copies.) You should download and install the driver library SimpleSH1106.zip which is in Step 8. The proper name for the clock of I2C is "SCL" but on eBay the boards can be labelled "SCK" like my one in the photo.)Ī fuller description of the OLED library is in my oscilloscope Instructable in Step 8. (Some displays seem to have the pins in a different order. Choose one that looks like that photo, says "I2C" or "IIC" and has four pins labelled VDD GND SCL SDA. I don't want to recommend a particular seller as links quickly go out of date. The display is a 1.3" OLED running at 3.3V which is controlled by an SH1106 chip via an I2C bus. The AD9833 module can be added to my oscilloscope to produce an "Oscilloscope and Signal Generator in a Matchbox". Those of you who have read my oscilloscope Instructable will recognise the similarity. If you add an OLED and two buttons, the signal generator can work alone without a PC. You can download the Windows EXE program below which will send the required commands or you could write your own. If you're using the Serial Monitor, there's a box at the bottom right that might say for instance "Both NL & CR" which (I think) sends characters after your command. That extra character would terminate the loop. The loop stops when the Arduino receives another character so be careful not to send the command followed by carriage-return or line-feed. The frequency is changed every milliSecond. The frequency change is logarithmic so after 1 second the frequency will be 288Hz, after 2 seconds 833Hz then 2402, 690. It starts at "min" frequency and 5 seconds later is at "max" frequency. If you send an 'H' then the AD9833 repeatedly outputs a gradually increasing frequency over 5 seconds. If you send an 'M' then the "min" array is copied into the "max" array. The minimum frequency is 000001 and the maximum frequency is 999999. Will set the AD9833 output to a 2500Hz sine wave. If you send an 'S' then the "min" array characters are converted into a longint frequency and sent to the AD9833. If you transmit a digit then it is shifted into the "min" array. The Arduino program contains two 6-character arrays "min" and "max. 'I': sweep from "min" to "max" over 20 seconds.'H': sweep from "min" to "max" over 5 seconds.'G': sweep from "min" to "max" over 1 second.'M': copy "min" frequency array into "max" array.'Q': set frequency and produce square wave.'T': set frequency and produce triangle wave.'S': set AD9833 frequency and produce sine wave. '0'.'9': shift digit into "min" frequency array.The USB emulates a serial port running at 115200bps (8-bits, no parity). The simplest Signal Generator is controlled and powered over a USB lead from a PC. If you were being fancy, you might worry about "analogue ground" vs "digital ground" but if you were being fancy, you'd be spending more than £4. I've added a 100n decoupling capacitor because I thought I "ought" to but I couldn't see any difference - there is already a decoupling capacitor on the AD9833 module board. The AD9833 is powered from data pin D6 of the Arduino - the Arduino can supply sufficient current. I'm not saying that's the best or cheapest supplier but you should buy one that looks like that photo (or the photo above). The AD9833 module I chose is similar to this one. I am in the Open Source Hardware camp, and all of my projects I post on this blog are under the Creative Commons License.For the simplest Signal Generator, you just solder the AD9833 module onto the back of the Arduino Nano. This page contains the CadSoft Eagle PCB Design files, schematics, and Arduino files of the projects that I make.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |