MBED Function Generator

Georgia Tech ECE 4180 Final Project - Fall 2015

Group Member: Xuefeng Jin, Yuqing Peng, Qiuyang Tao, Hanjie Xie

Overview

Function generators are significant equipments for electrical engineers. There are lots of kinds of function generators in market already. The common benchmark function generators in labs are heavy, bulky and not affordable for students and amateurs. The National Instruments MyDAQ is a lightweight and convenient choice for students, but it is not cheap enough and requires PC end software to operate. Therefore, the idea for MBED function generator comes up and it will be a good start point for potential application. It is cheap, and users could directly use it only with a protoboard, which could be used for simple and general experiments.

Project Description

The MBED Function Generator uses MBED and Arduino Pro Mini to achieve two modes of operation. It can work both with or without computer connection.

When the function generator is powered without a computer connection, users can interact with the functions using menu displayed on the uLCD through keypad on protoboard.

In PC connection mode, a GUI with RPC is built to provide more intuitive control and more accurate visualization on function wave generations.

Table 1 shows the specifications of the project.

WaveformSine, Square and Triangle
FrequencyUp to 3 MHz
AmplitudeUp to +/- 12V

Table 1. Specifications of the MBED function generator.

The Fig. 1 is a concept diagram showing the basic function modules of the projects.

/media/uploads/fengspot/simpleconceptdiagram.png

Figure 1. The block diagrams of the MBED function generator. The GUI and Keypad control the output of the function generator.

Overall Structure

The Fig. 2 is a block diagram showing how the output waveform generated.

/media/uploads/fengspot/functiondiagram.png

Figure 2. The output waveform generation schematic.

As shown in the Figure 2, the Arduino Pro Mini is in serial connection with MBED to control the DAC module for digital-to-analog conversion. The potentiometer is applied to adjust the output voltage. The output of the potentiometer is sent to the inverting amplifier to produce the 5V output waveforms.

Digital-to-Analog Conversion Using DAC

To acquire the analog output voltage from digital input, the SparkFun MiniGen is applied as the DAC. It is a 10-bit DAC with good accuracy, and has 2 frequency registers operating 3.3 V. It is connected to the Arduino using SPI interface with 40 MHz.

/media/uploads/fengspot/dac.png

Control Voltage Using Digital Potentiometer

To adjust the output voltage from DAC, a digital potentiometer is used to control the voltage. The one used in this prototype is AD5206, a 6-channel, 256-position digital potentiometer. It has three terminal resistances we can choose, 10K ohm version is used in this demo.

/media/uploads/fengspot/digitalpotentiomtere.png

AD5206 has 3-wire SPI-compatible serial data input, the wiring is shown in the Wiring part below.

Keypad & LCD: MBED-ended Control

LCD is a control panel display that instructs users to perform tasks. It has 2 modes: MBED mode and PC mode.

In the PC mode, the computer-ended GUI is applied, which will be illustrated in next part. For the MBED mode, keypad is used for users type options for which waveform desired and values for amplitude and frequency.

As shown in Fig. 3, the users can select the type of the waveform and set the amplitude and frequency directly with Keypad.

/media/uploads/fengspot/mbedmode.png

Figure 3. Waveform selection on LCD in MBED mode.

GUI: PC-ended Control

The GUI interface for this project has 2 parts: the web application part and the python container part.

The web part provides users the options selecting the waveform and set amplitude and frequency. If the invalid value is entered, warning will be shown. The web application is written using standard front end language: HTML, CSS, Javascript, and JQuery.

To transfer data, the GUI needs to talk over serial port. It is very hard to do serial communication with normal web browser, so a container is added to compensate for this deficiency. After testing, python is found to perform the best for serial communication , so the container is written using a python GUI framework called PyQt. PyQt has a web interpreter so that the website no longer has to be opened by a browser. It also provides a way to enable Javascript and Python to pass data between each other. To sum up, the web container combines the easiness to code graphic power of web front-end language and low-level serial communication.

Fig. 4 displays a GUI for this project.

/media/uploads/fengspot/a01c777e1e779b3f9e72853c30dbfb4f.png

Figure 4. PC-ended GUI display.

On-Board Implementation

/media/uploads/fengspot/onboard.png

Figure 5. On-board design of the MBED function generator.

Video Demo

  • MBED Keypad & LCD Control
  • PC-ended GUI Control

Results

Fig. 6 displays a maximum 3 MHz sine wave display, and Fig. 7 displays a 2 kHz square wave with 2 V amplitude.

/media/uploads/fengspot/3mhz_sine_out.jpg

Figure 6. 3 MHz sine waveform display.

/media/uploads/fengspot/2khz_square_out_2v_amplitude.jpg

Figure 7. 2 kHz square wave with 2 V amplitude.

Challenges

There are several challenges and key points through the project:

  • The output voltage of the DAC is only positive, and its range is limited(0 - 3.3V). Negative voltage output is needed for most function generators, so it had better generate negative signals for common applications.
  • A PC-end GUI application is required which displays and communicates with MBED using RPC.
  • Menu and other interactions are designed to operate MBED without PC. For example, the functions of selecting waveform, setting amplitude and frequency are operated.

Future Work

  • Increase the range of the output voltage to higher peak-to-peak voltage.
  • Reduce the glitch and offset and acquire more stable and accurate output.
  • More kinds of waveforms could be implemented such as pulse.

Components

  • MBED LPC1768
  • Arduino Pro Mini
  • uLCD-144-G2 128 by 128 Smart Color LCD
  • 10-bit DAC (SparkFun MiniGen)
  • Keypad
  • DC-DC boost converters
  • TL071 Low-Noise JFET-Input General-Purpose Operational Amplifier & Resistors
  • BNC connector & Acrylic case

Wiring

  • Arduino to MBED
Arduino pinMBED pin
TXDfloat
RXDp28
5V5V = VU
GNDGND
RESETp11
  • Keypad to MBED
Keypad pinMBED pin
SCLp10
SDAp9
  • uLCD to MBED
uLCD pinMBED pin
TXp14
RXp13
5V5V = VU
GNDGND
RESETp15
  • Digital Potentiometer to MBED
mbedAD5206
VINVDD
GNDGND
p5SDI
p7CLK
p8CS'
  • DAC to Arduino
DAC pinArduino pin
SCLKp28
SDATAp27
VIN3.3 V
GNDGND
RESETp15

Program

Import program4180_proj

Basic_sine_wave_generator


Please log in to post comments.