IOS-Controlled Arduino Waveform Generator

by Annikken in Circuits > Arduino

18529 Views, 109 Favorites, 0 Comments

IOS-Controlled Arduino Waveform Generator

IMG_4401.JPG
53c351a6f92ea11a9b000021.jpg
iOS Controlled Waveform Generator with Arduino and Annikken Andee

This waveform generator is based on the work by Amanda Ghassaei. Waveform generators (or function generators) are used for testing and debugging circuits. e.g. frequency response of op amp or sensors. This waveform generator is powered by Arduino with Annikken Andee shield - a device that lets users create iOS/Android interfaces without iOS or Android programming at all. It outputs sine, triangle, saw and square waves. Frequency is controlled by means of a slider (on iOS/Android device) and wave type is selected using on screen iOS/Android button. With a iOS/Android interface, you can add certain features not possible with hardware buttons. E.g. displaying different ranges of frequencies for each wave type, displaying meaningful controls for certain wave types. For example, the pulse width modulation slider is only visible for square wave types, its not visible for sine, triangle or saw wave forms.

Parts List:

(1x) Arduino Uno or compatible board element14 #2075382

(1x) Annikken Andee for iOS or Android www.annikken.com

(1x) Prototyping Perfboad element14 #1536938

(25x) 10Kohm resistors element14 #9339060

(1x) 10-way female connector element14 #1815119

Wire/breadboard jumper wires. Soldering equipment.

Downloads

Build a Simple R2R DAC

Screen Shot 2014-07-14 at 12.10.08 pm.png
R2R.jpg

Build a R2R DAC using the schematic provided. Note that all the resistors used are 10Kohm.

Solder 10-way Connector

IMG_4412_names.jpg

Solder on a 10-way connector for jumper wires to attached to the R2R ladder. Make the correct connections from 10-way connector to the corresponding resistors. Leave pin 10 of the connector unconnected. Solder wires for OUTPUT and GND to make connections to an oscilloscope for viewing.

My setup here does not include the following:

  1. Low-pass RC filter.
  2. Voltage follower to buffer the output, you have to add this before using the output on any of your testing circuit.
  3. Gain control using LM386 - to adjust the peak-to-peak amplitude of the output waveform.OUTPUT and GND to make connections to an oscilloscope for viewing.

However, its enough to show a waveform on the oscilloscope.

Connect Annikken Andee and Arduino

IMG_4413.JPG

Connect Annikken Andee to Arduino by simply plugging it on top as a shield.

Connect Arduino and R2R Ladder

IMG_4415.JPG

Connect pins 0 to 7 of Arduino to pins 0 to 7 of the R2R ladder we soldered earlier. Connect Arduino GND to R2R's GND.

Arduino IDE Setup - Part 1

Screen Shot 2014-07-14 at 1.29.01 pm.png

  1. Download and install Arduino IDE (if you have not)
  2. To use Annikken Andee, you need to install a library containing helpful functions for you to draw interfaces on iOS/Android. Get it from www.annikken.com
  3. Click on the link "Click here to download zip file". The library is in the form of a zip file. E.g. Build_18.zip.

Arduino IDE Setup - Part 2

Screen Shot 2014-07-14 at 1.31.29 pm.png

  1. Unzip and copy the folder named "Andee" found inside the unzipped folder.
  2. Paste it inside the Documents->Arduino->libraries folder.

Step 4: Arduino IDE Setup - Part 3

Screen Shot 2014-07-14 at 1.36.41 pm.png

Start or restart Arduino IDE and you should see Andee examples installed.

Download Arduino Code

Download the Arduino code "function_generator2.ino".

You need to create a folder named "function_generator2" inside your Arduino sketchbook folder. The location is usually found at Documents/Arduino.

Paste the "function_generator2.ino" inside "function_generator2" folder.

Start or restart the Arduino IDE.

You should be able to open the code from File->Sketchbook->function_generator2.

Connect USB to your Arduino, compile and upload the code.

Annikken Andee App

IMG_4416.JPG
IMG_4420.JPG
IMG_4421.JPG
IMG_4422.JPG
IMG_4423.JPG
IMG_4425.JPG

Download the free Annikken Andee app from either the Apple App Store or Google Play Store.

I will be showing the iOS example in this instructable.

  1. Install and launch the app.
  2. Press the MENU button (3 horizontal lines) .
  3. Press "Scan new devices"
  4. You should see your Annikken Andee after some time. In this case, it has the name "New Andee Device"
  5. Press on the "New Andee Device" and you will be prompted with a connection dialog.
  6. Press "Connect". Some time later your screen (as defined in your arduino code) will appear.

Connect Output to Oscilloscope and Have FUN!

IMG_4403.JPG

Connect output of your R2R ladder to an oscilloscope. On your iOS screen, select "SINE" and shift frequency to about 20, and see the waveform appear on your oscilloscope.

On iOS, choose waveform by pressing on the buttons, and also adjust frequency using the sliders!

HAVE FUN!