Jump to content
Electronics-Lab.com Community

Function Generator + LCD (Design Idea)


Recommended Posts

Nobody should be without a function generator.

I know there are chips that you can use, but it is still good to learn how these things work.
The stand alone chips have very limited output power and the lower spec parts may have quite high sine wave distortion.

Here is a design I did using one of my previous posted ideas. That is the triangle to sine converter based around Q1.
http://www.electronics-lab.com/forum/index.php?topic=7405.msg59625#msg59625

Well in short, U1,2 is a comparator-integrator combination to provide square and triangle wave outputs on pin 1 and 7. Frequency is set in 3 ranges with R6 and (C1,2,3). R8 set the output level of the triangle wave to 8Vp-p at pin 7(U1B). Due to resistor tolerances, R8 might need slight adjustment to set the level at 8Vp-p on this pin. This level is important to get lowest sine distortion from Q1.

This triangle wave is then converted by the circuit around Q1 to a sine wave output at about 2Vp-p. R3,5 will be adjusted for minimum sine wave distortion. The values indicated in (%) were the settings for minimum distortion during simulation.

U2 plus D3,4,5 and Q2,3 forms a low distortion output stage. This output is capable of driving 10Vp-p into 600 Ohm load or around 8Vp-p into a 50 Ohm load. R11 will adjust the output level. Output stage distortion is only 0.002% at 20kHz with 10vp-p into 600 Ohm. The figure with 8Vp-p into a 50 Ohm load is 0.087%

Switch J1 when opened allows us to set the DC offset of the output. In the closed-cal position, the offset will be very close to 0V.

Design shows good performance with sine wave distortion only 0.7% THD at 20kHz
Up to 2kHz, distortion is about 0.35% THD, and then rising slowly to the 0.7% mark at 20kHz.

Although this circuit as a whole was only tested on a simulator, I have previously verified performance of the tri-sine converter and the output stage design on a bench with actual measurements.

Waveforms show the simulated results to expect at 20,200Hz and 2,20kHz.

From the table of %THD we see that the design perform well with 50 and 600 Ohm loads.

Link to comment
Share on other sites


I thought the generator should have some form of frequency readout to make it more user friendly. Also many members will not have a frequency counter making it difficult to set the frequency.

Driving LCD's is quite easy, so this was the obvious way to do this.

I used a PIC16F628A for this design. Why? Because I have them and use it a lot. With the 4MHz clock it will read up to 25kHz with 1Hz resolution. For best accuracy the crystal frequency should be measured and adjusted with aid of a frequency counter.

The diagram posted is with the add on modifications (inside the green box). The last diagram shows the green box expanded for better view.

If you don't want to build the counter section, then just build the circuit in the previous post.

I also uploaded the Counter.hex (Counter.zip) file so you can just program, or get someone to program the chip for you.

Hope members find my design useful  :)

Link to comment
Share on other sites

Here is the Bill-Of-Material.

I also found these free evaluation programs that uses your PC sound card as a distortion analyzer. This may help you to adjust the triangle to sine stage for minimum distortion if you don't have access to a distortion meter.

http://romacsoftware.com/MeterDefault.asp

distortionmeter.jpg

or http://shmelyoff.nm.ru/

Link to comment
Share on other sites

  • 2 weeks later...

That's a very good idea!  I don't know if I should be surprised that is not standard equipment.

Many years ago I paid too much by today's standards for a frequency counter, and I'm not always confident that it is working correctly.  Considering how minimal the function would be for a microcontroller to do the job, I'll probably make six of them when the house is done and I can unpack my hobby stuff.  As for the function generator, that may take longer for the need to drive me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...