The picture shows the circuit I am working on. A sinusoidal burst of 4 MHz (24 cycles) is generated from a waveform generator. This sinusoidal input is connected to a comparator IC through an SMB jack as shown in the schematic. This comparator IC is powered by a microcontroller that is connected to a PC through a USB cable. The idea is to convert this sinusoidal wave into a square wave.

Although I am getting a square wave, there is also a lot of noise/disturbance (shown in the red circle).

square wave

There are a lot of other components connected to the microcontroller as well. I am working on a perf board and the components are connected something like the third picture.

back of the perfboard

Since the board is connected with many overlapping wires, I suspect that is the source of this noise. The 3.3 V pin of the microcontroller is especially very noisy. Would that be the right way of thinking? If yes, what would be the correct way to rectify this issue on the perfboard itself?

  • 2
    \$\begingroup\$ The perfboard has a ground plane... are you using it? Is the chip on a SMD to DIP adapter? How many decoupling caps? \$\endgroup\$
    – bobflux
    Jul 15 at 12:17
  • 1
    \$\begingroup\$ So, inbetween sine wave bursts the signal is zero? If yes, then you need to bias the inputs slightly, or add hysteresis. \$\endgroup\$
    – Mattman944
    Jul 15 at 12:27
  • \$\begingroup\$ The ground plane and the decoupling caps are not being used. Yes, the ICs are mounted on SMD to DIP adapters. Would you say a decoupling capacitor between 3.3V and GND pin of the uC is sufficient or should they be connected between Vcc and GND of all the ICb eing used? \$\endgroup\$ Jul 15 at 12:36
  • \$\begingroup\$ As a total hack, could try placing a 100pF ceramic capacitor across the AC+ and AC-. This might clean up the signal somewhat, but it's going to make the signal generator work harder (more capacitive load) and possibly delay the signal slightly. At this point, I'd be considering designing a PCB with a ground plane; even a two-layer board would be better than fly-wiring. See OSHPark, JLCPCB, etc. \$\endgroup\$
    – rdtsc
    Jul 15 at 13:16
  • \$\begingroup\$ Two things to add to the good advice Andy aka gave in his answer. You could also try adding a bias to one of the comparator's inputs, so that in the absence of the 4 MHz signal the comparator is biased well away from its trip point. Also, look for a slower part. The comparator you chose is way faster than it needs to be for your application, which can lead to all sorts of unexpected problems. \$\endgroup\$
    – SteveSh
    Jul 15 at 14:08

2 Answers 2


A sinusoidal burst of 4MHz (24 cycles) is generated from a waveform generator.

Consider what the signals AC+ and AC- are when the 24 cycles are not being generated; they will be near enough equal in voltage (0 volts) and, your MAX999 comparator is going to "pick-up" on any tiny bit of noise difference between AC+ and AC- and make a digital signal out of it. This is alleviated by the internal hysteresis of the MAX999 but, that is countered by your really bad wiring scheme.

In other words, it's behaving pretty much how I would expect it to behave given the circumstances. I would try and engineer more hysteresis by using external positive feedback around the comparator to see if that stops the Q output flipping when the 24 cycles are not being generated.

The clear lack of supply decoupling capacitors in your schematic is also a big problem.

  • \$\begingroup\$ Thank you, I will try using the decoupling capacitors \$\endgroup\$ Jul 15 at 14:54

I'm sorry, but it has to be said...

Don't expect a board looking like this to have any form of deterministic behavior, since the solder job and wiring is very far from acceptable.

I don't think I can spot a single, correctly done solder joint. Solder isn't some "metallic hot glue" with the sole purpose of holding things together somewhat, it has to wet across both metal surfaces that are joined, to ensure a good electrical connection and to protect against oxidation.

And in case of through-hole vias, the solder should wet against the via as well. The entire via should be covered with solder and the solder should also cover the component side.

All wires are peeled too far and could easily short in unexpected places. There are lots of signs of melted insulation.

Also all these wires could easily create an EMC nightmare: signal overlap, long wires, wires acting as antennas.

You should get (someone with) basic solder training, then remake this from scratch. It might be easier using a perfboard without metal in between the vias, or alternatively one with "rows" instead of individual vias. Either is more beginner-friendly than your current board.

  • \$\begingroup\$ I agree, I will take some time and connect the components with fewer wires and better solder tracks. Thank you!! \$\endgroup\$ Jul 15 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.