Pages: [1]   Go Down
Author Topic: creating code for a square wave output and sine wave output  (Read 1162 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi im just wondering about finding code to create a square wave output  and a sine wave input&output for the Arduino UNO rev3. i need to measure the voltages and currents going in and out of the board with an oscilloscope and signal generator. any help would be greatly appreciated
« Last Edit: February 20, 2013, 06:27:14 am by basementjacks » Logged

Offline Offline
Edison Member
*
Karma: 18
Posts: 1170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since the UNO has no DAC output, a sinewave is kind of tricky. You can filter the PWM output, but it might not be very clean.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24349
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hope your lecturer isn't a member here - many are   smiley
You can build a four or five bit DAC easily with an R-2R resistor ladder (useful Google search term)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For generating output waveforms you should try Direct Digital Synthesis, this project uses it for the waveforms you mention and also has some useful links -

http://rcarduino.blogspot.com/2012/08/the-must-build-arduino-project-illutron.html

Duane B

rcarduino.blogspot.com

Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You can build a four or five bit DAC easily with an R-2R resistor ladder (useful Google search term) 

is there a way to do it using the circuit i already have for my project? the schematic is below
  http://www.instructables.com/file/F6DPG7PGZMIUHMJ 
Logged

Pages: [1]   Go Up
Jump to: