Author Topic: Need to amplify a hardware filtered square wave  (Read 2619 times)

0 Members and 1 Guest are viewing this topic.

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Need to amplify a hardware filtered square wave
« on: October 25, 2015, 08:17:40 pm »
I'm outputting a square wave with one MCU pin.  I'm reading the peak values and using the duty cycle to calculate the RMS voltage of the output.  That works great with no issues.

What I'm trying to do now is to output a second square wave, filter it via RC filter and amplify that signal to match the actual RMS voltage that was calculated to be read with a standard 3 wire mini voltmeter.  These have about 500ms startup/refresh time, so there's plenty of time for some decent filtering.  The project is powered with a lipo pack and the actual load(resistive) is heavy enough that the input voltage can sag quite a bit if that helps.

PS, using any kind of display would go against the idea.  Trying to use a voltmeter.

Any ideas for this?
« Last Edit: October 25, 2015, 08:27:44 pm by MarkM »
 

Offline TheUnnamedNewbie

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: 00
  • mmwave RFIC/antenna designer
Re: Need to amplify a hardware filtered square wave
« Reply #1 on: October 25, 2015, 08:46:23 pm »
I'm quite confused as to what it is you are trying to do.

Why are you filtering the signal? do you want to produce a sine wave with RMS value equal to the RMS value of the of the square wave?
The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: Need to amplify a hardware filtered square wave
« Reply #2 on: October 25, 2015, 09:47:25 pm »
I want to produce as close to a flat DC signal of a calculated RMS voltage that was previously calculated.

The whole idea is I'm trying to read a higher DC signal with a mini voltmeter than the MCU(ATtiny) can output.  If it can work without filtering that would be great, but these voltmeters might have an issue with that.  Maybe not with some of them, though. Either way, the Attiny is running at 5v, so 0-5v(maybe filtered) PWM.  I need to amplify that PWM output to about 10v and hopefully filtered to the point where these little Chinese meters can read the signal with no problem.

It might be easier to think about with one output.  Think about a simple Attiny(5v) outputting a filtered signal that goes from 0-10v.

« Last Edit: October 25, 2015, 09:49:38 pm by MarkM »
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Need to amplify a hardware filtered square wave
« Reply #3 on: October 25, 2015, 09:52:10 pm »
I dunno if they're fundamentally different today, but almost every older digital meter has either +- 200 mV (for a display of +-2000) input scale and literally every other "range" is done by input dividers. So if you bridge/remove these, typically one or two, resistors, you can just divide your filtered PWM down.

Tip: The PWM output voltage in itself depends on the supply voltage, and the output after a RC lowpass depends on the loading. Feed the filtered PWM back into an ADC pin and servo the PWM. This way you eliminate both supply and load dependence.
,
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Need to amplify a hardware filtered square wave
« Reply #4 on: October 25, 2015, 09:54:26 pm »
Quote
I need to amplify that PWM output to about 10v and hopefully filtered to the point where these little Chinese meters can read the signal with no problem.

 That is usually done using the output pin to drive a npn or nfet (through a base or gate resistor) that is wired to the higher desired DC voltage. A collector (or drain) series resistor is also used. Then you will have a PWM signal having a larger amplitude that you can filter as desired.
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: Need to amplify a hardware filtered square wave
« Reply #5 on: October 25, 2015, 10:07:46 pm »
Quote
I need to amplify that PWM output to about 10v and hopefully filtered to the point where these little Chinese meters can read the signal with no problem.

 That is usually done using the output pin to drive a npn or nfet (through a base or gate resistor) that is wired to the higher desired DC voltage. A collector (or drain) series resistor is also used. Then you will have a PWM signal having a larger amplitude that you can filter as desired.

I can see this working, but the battery will going from unloaded to loaded while the heavy load is switching with a varying duty cycle.  I don't know about microcontrollers enough to make that happen, but I haven't actually tested it yet.  Any tips?

« Last Edit: October 25, 2015, 10:09:17 pm by MarkM »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf