Arduino Forum
>
Using Arduino
>
Programming Questions
>
creating code for a square wave output and sine wave output
Print
Go Down
Pages:
[1]
Topic: creating code for a square wave output and sine wave output
(Read 3875 times)
previous topic
-
next topic
basementjacks
Guest
creating code for a square wave output and sine wave output
Feb 18, 2013, 04:18 pm
Last Edit
: Feb 20, 2013, 12:27 pm by basementjacks
Reason
: 1
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
KeithRB
Faraday Member
Posts: 3,888
Karma: 390
[add]
Re: creating code for a square wave output and sine wave output
#1
Feb 18, 2013, 04:46 pm
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.
AWOL
Global Moderator
Brattain Member
Posts: 48,855
Karma: 1479
[add]
I don't think you connected the grounds, Dave.
Re: creating code for a square wave output and sine wave output
#2
Feb 18, 2013, 04:56 pm
I hope your lecturer isn't a member here - many are
You can build a four or five bit DAC easily with an R-2R resistor ladder (useful Google search term)
"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.
I speak for myself, not Arduino.
DuaneB
Edison Member
Posts: 1,673
Karma: 38
[add]
RC Car Meets Arduino
Re: creating code for a square wave output and sine wave output
#3
Feb 18, 2013, 05:29 pm
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
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html
Rcarduino.blogspot.com
basementjacks
Guest
Re: creating code for a square wave output and sine wave output
#4
Feb 19, 2013, 03:10 pm
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
Print
Go Up
Pages:
[1]
Loading...