Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - embeddederic

2
Project development, ideas, and suggestions / Re: DIY Audio Function Generator Part 1
Hey arhi,

I was actually looking at buying a HP 3310A very seriously on ebay, but i still wasn't able to find one for under $200. My function gen isn't really going to be an less expensive by the time I buy the precision LT opamps and order some raw PCBs.... but design and build something form scratch will be fun and I'll learn a few things. Also if it works will I may offer it as a OSHW kit.... I got to get it built up and working first though :)
3
Project development, ideas, and suggestions / Re: DIY Audio Function Generator Part 1
Hey Honken,

My original idea was to use a AD9850 125 MHz Complete DDS Synthesizer and hook it up to an Atmel micro running some Arduino code, but I didn't think I could get as good of THD from this DDS solution so I was always going to still have a separate BNC output for the wien-bridge oscillator. I also wanted to hook up an SD card and DAC IC to the Atmel micro and have a "wav" file programmable wave form generator. I used Scilab to create a bunch of sine, square, ramp and ECG wave forms in a wav file format. the Arduino would then play the wav file out one of the Outputs of the function gen and produce a programmed signal..... but the project was getting too big in my head, so inorder to do more than think about it I broke the project up into a "Analog" function gen and I'll later build up the DDS Arduino based programmable function gen.
4
Project development, ideas, and suggestions / Re: DIY Audio Function Generator Part 1
I built up the LT1037 Wien-Bridge Osc a few months ago and got 0.024%..... the noise floor of my uncalibrated HP 331A Distortion Analyzer is at 0.01%; Jim Williams stated he got 0.0025% (an order of magnitude better than my results) with the exact same circuit. So either my construction isn't as good as his, or my HP 331 is just not the right tool for measuring the THD of this circuit.

It is fun pushing the limits of my test gear though. Once I get the function generator built up I may have to send one off to someone with a better Distortion analyzer than me to get a second opinion.
5
Project development, ideas, and suggestions / DIY Audio Function Generator Part 1
Most of my Blog posts involve short 3-4 hour projects/hacks that I just build up for learning and fun. I thought it was time to develop something a bit more involved and share my design process in a series of posts over the next few months.

I have lots of test equipment in my home lab from O-scopes, RF Signal Generators, a Spectrum Analyzer, RF Power Amps to a slew of Multimeters and DC Power supplies, but one piece that is missing is a simple low end Audio Function Generator. I searched eBay and anything worth wild was in the $200+ mark and to be honest I wasn't that impressed with their specs. Most $200 Function Generators only have a Sine Wave output spec'd at 1% THD....... 1% is ok for most uses, but I just got done building up Jim Williams Wien-Bridge Osc. and was able to get 0.024%.
http://http://embeddederic.blogspot.com/2012/01/sine-waving-into-new-year.html
I want to be able to use the Sine Wave output to test ADC resolution and as a base band signal for RF projects and having very Low Total-Harmonic-Distortion (THD) would be nice.

So I've decided to build my own Function Generator. Most DIY Function Generators I found online start out with a Square Wave Oscillator feed into an integrator to get a triangle wave, then you feed the triangle wave into a wave shaper and you get a rough Sine Wave output. This is similar to a project I built up last year.
http://http://embeddederic.blogspot.com/2011/08/remembering-jim-williams-dead-bug-style.html
 
This method works, but the wave shaped Sine wave isn't going to have the low THD I was looking for, so I am taking the opposite approach and starting with a Sine Wave Generator based on the #327 Lamp Wien-bridge Circuit to get the low THD. I'll then feed that into a Comparator to produce the Square wave; I am then using the Square Wave to turn on/off a ramp generator circuit. I would rather have a ramp output vs a triangle wave. The ramp circuit will let me play around with different single & dual slope ADC concepts later on.

Below is a block diagram of my proposed design:
[attachment=5]
I've added a +3.3V Square wave output to be feed into a frequency counter, so I don't need to bother to add a display to the function generator. Mine as well make use of the Frequency counter I have for a display, also having a +3.3V square wave output would be nice for any micro projects later on.

I'll have a Freq. Adjust Pot, Freq. Range switch, Ramp Current Source Adjustment Pot, and an Output Amplitude Adjustment potentiometer. Below is a rough layout of the proposed design:
[attachment=4]
I really like the layout of the CEE Source Measurement unit, so I'll be mounting the PCB in a similar looking plexi top and bottom when it is all done.

After sketching out the concept drawings my next step was to test the Wien-Bridge Oscillator circuit I was basing this whole design around. I prototyped up the circuit with the Frequency Range Select switch and 10K pot and was pleasantly surprised to see everything worked well.
[attachment=3]
[attachment=2]
[attachment=1]
The three switch selectable frequency ranges I have are: 16Hz to 600Hz, 160Hz to 6kHz, and 1.6kHz to 60kHz with the 10K potentiometer adjusting the output frequency continuously through the ranges. The one downside with this Lamp based implementation is there is a settling time of several seconds needed after each major adjustment to allow time for the Lamp to thermally settle.... this is an ok tradeoff for me given I should be able to achieve very low 0.05% or lower THD.

The next step was to draft up the rest of the circuitry in LTSPICE to see if I could create the Square Wave and Ramp functions successfully.
[attachment=0]
After an afternoon of playing I settled on this circuit. It works well in simulation and now I'll have to build it up and see if it works for real.

More Testing, DesignSpark PCB Layout, and prototyping to come...........................
6
Project development, ideas, and suggestions / Arduino Battery Monitor Part II
In my last blog post: http://http://embeddederic.blogspot.com/2012/01/arduino-based-battery-discharge-monitor.html
I took an Adruino Uno and a Protoshield and made a simple battery monitor, so I could measure the voltage of a discharging 9V battery when it was drained through a constant 100mA load. Below is the 9V battery discharge curve:
[attachment=3]
The 100mA constant load was chosen because my ProtoStack Arduino Clone with LCD draws about 92mA and I wanted to write a sketch to display a battery bar and the approximate hours battery life left. Since all batteries have an internal equivalent series resistance (ESR), it is important to take that into account when only using a battery's voltage to monitor its state of charge. Since we discharged the battery through a load that is similar to the ProtoStack board with LCD, the ESR of the battery has automatically been accounted for in the voltage measurements.

With the plotted excel data from the discharge monitor I created a look-up table in software to approximate the battery life:

Battery Voltage,              Hours Life Left ,                Displayed Battery Bars
7.87V > Batt ,                      4.5hrs,                                        4
7.45V > Batt <= 7.87V,          4.0hrs,                                        4
7.23V > Batt <= 7.45V,          3.5hrs,                                        4
7.08V > Batt <= 7.23V,          3.0hrs,                                        3
6.94V > Batt <= 7.08V,          2.5hrs,                                        3
6.77V > Batt <= 6.94V,          2.0hrs,                                        2
6.56V > Batt <= 6.77V,          1.5hrs,                                        2
6.30V > Batt <= 6.56V,          1.0hrs,                                        1
5.71V > Batt <= 6.30V,        0.5hrs,                                        1
              Batt <= 5.71V,        mins left,                                    0

Here is the sketch I wrote: http://http://www.divshare.com/download/16665949-ab3

I tied the input voltage through a resistor divider (220K Ohm series and 100K Ohm shunt) to the A0 pin on the micro.
[attachment=2]
One issue I ran into was the 9V battery can go down as low as 5.71V before it is completely dead. The ProtoStack board has a 1N4004 reverse polarity protection diode and a 7805 Linear Regulator to generate its 5V rail. These components require that the input voltage be greater than 7.8V in order to create the 5V rail properly.
[attachment=1]
So I replaced the 1N4004 diode with a schottky diode that has a much lower 0.2V forward voltage and used a L4941 5V linear regulator to replace the 7805. The L4941 has a drop out voltage of less than 0.45V when sourcing 1Amp. With these mods I was able to go down to 5.30V input voltage before the LCD stopped functioning.
[attachment=0]
I used the Parallax 16x2 LCD commands to create the custom characters for the "EH" and Full & Empty Battery Bar Segments. Here is a link to the spreadsheet I used to calculate the values for the custom characters. http://http://www.divshare.com/download/16666179-f87

This was a fun project to get myself familiar with the Arduino Analog pins. Now my ProtoStack Board is all ready for a future portable battery powered electronics project. http://http://embeddederic.blogspot.com/2011/11/protoshack-atmega328-kit-review-arduino.html
7
Project development, ideas, and suggestions / Sine Waving into the New Year!
I have been slowly reading through Jim Williams "Analog Circuit Design" book. Not slowly because it is boring, it is actually very interesting and a good read; I just get easily distracted and it has been a few weeks since I picked it up. I am about 200 pages or so into it and my favorite chapter so far has been the one where Jim Williams describes the steps he took while recreating William Hewlett's Model 200A Wien Bridge Oscillator. It is essentially the same project described in Linear Tech's AN43 Appnote, but with a lot more background and Jim describes the inner workings very conversationally in the book.

Jim's first iteration of the circuit consisted of a RC Wien Bridge, an LT1037 Opamp and a #327 Lamp. The Lamp is used as a variable resistor that starts out at a very low 98 Ohms DC resistance that helps get the Opamp oscillating (because of the increased gain) and ends up stabilizing at around 235 Ohms once it heats up (thus servo-ing the gain down to an equilibrium point that keeps the circuit oscillating).

I thought this would be a fun circuit to build up and recreate.
[attachment=1]
[attachment=3]
I hooked everything up on the breadboard just to prove out the circuit then I transferred the circuit over to a more permanent FR4 copper PCB.
[attachment=2]
[attachment=0]

There is more detail about this project on my blog. http://http://embeddederic.blogspot.com/2012/01/sine-waving-into-new-year.html
8
Open 7400 Competition / 7400 Logic Prize Review - ProtoStack ATmega328 Kit
I managed to get my 7400 Logic PLL Based Switcher in the third place category of the Dangerous Prototypes Open 7400/4000 Series Logic Contest. Dangerous Prototypes had the neat idea to let the winners pick their own prizes from the many sponsor donated kits & parts; that way everyone gets something they want. I picked out one of the 3x ProtoStack ATmega328 Developments Kits they donated. I've been messing around with my Arduino Uno for a while and was looking to expand my Atmel AVR knowledge a bit and thought building up this kit and turning it into an Arduino clone would be a fun project. I figured I'd give a little review of the kit as I went along as well.

For the rest of my review and detailed build and programming description go to my blog here:
http://http://embeddederic.blogspot.com/2011/11/protoshack-atmega328-kit-review-arduino.html

Overall I am pretty happy with the ProtoStack ATmega328 Development Kit and would highly recommend anyone getting one. I am excited to build up a few new projects with this board; having the extra prototyping space without having to stack a proto shield is a huge plus. Thanks ProtoStack for sponsoring the 7400 contest and getting me this kit and USBasp programmer!
[attachment=1]
Also Thank You Dangerous Prototypes for putting on the contest! It was a lot of fun seeing all the cool project ideas.
[attachment=0]

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01452419448session_write_close ( )...(null):0
20.01482551024ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01482551800Database_MySQL->query( ).../DatabaseHandler.php:119
40.05722690520Database_MySQL->error( ).../Db-mysql.class.php:273