Help Interpreting Oscilloscope Measurements

Using spice and eagle I designed a circuit for a battery charger for a set of 4 AA batteries. I had PCBs produced and manually assembled one. It’s working fine, just like the breadboard.

I don’t yet know how to interpret the oscilloscope measurements to know if my circuit is suitable from a frequency standpoint, and would appreciate some help. The charger takes 12 Vin, and charges the battery at around 6.20 Vout- exactly my goal. The frequency I’m seeing when I hook up Vout to the batteries is around 4.5Mhz. Not sure if that’s OK or not?

I’ve attached a spice jpg, and provide this link to a video I shot showing the circuit and oscilloscope (sorry for the low quality): http://carpenterdev.com/files/batterych … hookup.mov

Please let me know what you think.

Thanks,

Bob

The least thing we would need to know is where you held the probe tips.

Please try to make steady images of the oscilloscope, pcb-setup and wiring. A grainy shaky fuzzy movie is not helping anyone. Despite your best efforts. What helps me usually is resting my elbows on the table and leaning my hands against some static object as I hold the camera. Or use my own upper body (while sitting) and shoulders to be a somewhat stiffer bio-tripod. If neccessary tensing my musscles. Much better than keeping you arms hanging in the air with a (heavy) camera.

p.s. In the simulation I see the ground symbol missing, signifying the reference 0 volt. (not that this would explain the waveform on the oscilloscope.) As that looks like LTSpice it should be the downward pointing triangle. Odd that it didn’t warn you of it. As it does when I neglect to add it in the circuit. Maybe it takes the minus of the voltage source as the implied 0 volt reference.

I believe we concluded in this thread, which is on the same topic https://forum.sparkfun.com/viewtopic.ph … er#p176645 that the LTSpice model for the NiMH batteries does not work for charging.

That said, there are two obvious problems with the circuit. It lacks the required capacitor on the output of the LM317, and if left connected to the batteries while unpowered, will discharge them through R8 and the LEDs.

Valen:
p.s. In the simulation I see the ground symbol missing, signifying the reference 0 volt. (not that this would explain the waveform on the oscilloscope.) As that looks like LTSpice it should be the downward pointing triangle. Odd that it didn’t warn you of it. As it does when I neglect to add it in the circuit. Maybe it takes the minus of the voltage source as the implied 0 volt reference.

Yes, neg on voltage source provides the ref zero. I’m not getting any spice errors.

Valen:
The least thing we would need to know is where you held the probe tips.

Please try to make steady images of the oscilloscope, pcb-setup and wiring. A grainy shaky fuzzy movie is not helping anyone. Despite your best efforts. What helps me usually is resting my elbows on the table and leaning my hands against some static object as I hold the camera. Or use my own upper body (while sitting) and shoulders to be a somewhat stiffer bio-tripod. If neccessary tensing my musscles. Much better than keeping you arms hanging in the air with a (heavy) camera.

The probes are connected to Vout.

jremington:
I believe we concluded in this thread, which is on the same topic https://forum.sparkfun.com/viewtopic.ph … er#p176645 that the LTSpice model for the NiMH batteries does not work for charging.

That said, there are two obvious problems with the circuit. It lacks the required capacitor on the output of the LM317, and if left connected to the batteries while unpowered, will discharge them through R8 and the LEDs.

You think I need another cap? Placed between LM317 Out and ground? The circuit has an on/off switch that opens the circuit to prevent discharge. I wouldn’t mind adding one if it would improve the circuit.

How about the 4.5Mhz frequency at Vout - would you consider that acceptable? I primarily worry about interference with other nearby electronics.

Thanks,

Bob

First, I’d address issues with the schematic. I will assume it’s correct, but badly formatted.

I assume Q1 and R6 are supposed to bias the LM317? In either case, there is a standard format for drawing circuits. Base is normally on the left, or in a few cases, on the bottom. Placing it on the right is confusing.

Likewise, process normally is shown flowing from left to right. The input of the LM317 should be on the left, its output on the right, and the ADJ top or bottom.

I’m not making these comments to be nitpicky. An experienced designer sees things in terms of patterns, not individual components. If you break the pattern, it makes it more difficult to understand what you’re doing and to find errors.

That said, this looks like a bad choice for charging NiMH batteries. They normally need a temperature controlled shutoff or end of charge knee detection. You can charge them at slow rates, but there should be a timer to avoid overcharge in that case. D2 appears to be unnecessary. D2 & D7 appears to be there to avoid discharging the battery through the charger, but as noted earlier, the LED circuit will discharge it anyway. I’m not sure why you need them if you have a switch to prevent discharge.

The LM317 should have a decoupling capacitor at it’s output. I’m sure that’s the reason for the high frequency oscillation you’re seeing.

FWIW: you can make a copy of the LTSpice .asc file, change the extention to be a .txt file and then post that on the forum. That way others can analyze/improve the circuit more easily.

lyndon:
First, I’d address issues with the schematic. I will assume it’s correct, but badly formatted.

I assume Q1 and R6 are supposed to bias the LM317? In either case, there is a standard format for drawing circuits. Base is normally on the left, or in a few cases, on the bottom. Placing it on the right is confusing.

Likewise, process normally is shown flowing from left to right. The input of the LM317 should be on the left, its output on the right, and the ADJ top or bottom.

I’m not making these comments to be nitpicky. An experienced designer sees things in terms of patterns, not individual components. If you break the pattern, it makes it more difficult to understand what you’re doing and to find errors.

That said, this looks like a bad choice for charging NiMH batteries. They normally need a temperature controlled shutoff or end of charge knee detection. You can charge them at slow rates, but there should be a timer to avoid overcharge in that case. D2 appears to be unnecessary. D2 & D7 appears to be there to avoid discharging the battery through the charger, but as noted earlier, the LED circuit will discharge it anyway. I’m not sure why you need them if you have a switch to prevent discharge.

The LM317 should have a decoupling capacitor at it’s output. I’m sure that’s the reason for the high frequency oscillation you’re seeing.

Thanks for explaining the circuit design best practice, I’ll redo the LM317 orientation on the Spice circuit.

The original circuit design came from EEWeb: http://www.eeweb.com/blog/extreme_circu … nimh-cells - I do believe I followed the designer’s circuit faithfully. The fact that my circuit is charging correctly tells me that the design is valid. Maybe another cap between LM317 Out and grnd would be helpful, as you and others have pointed out, but it turns out that the problem with the oscillations was due to C1 not being soldered well to one of its pads. When I originally soldered C1 down I used a 4V cap, which blew the minute power was applied. This took the pad with it. I thought I had soldered the replacement cap into the wire run adequately, but when I looked closely I could see it wasn’t attached. When hooked to the scope and C1 tapped the oscillations nearly disappear.

I will be soldering another board together soon, and I expect it will perform nearly same as the breadboard.

I appreciate everyone’s help.

Thanks,

Bob

Mee_n_Mac:
FWIW: you can make a copy of the LTSpice .asc file, change the extention to be a .txt file and then post that on the forum. That way others can analyze/improve the circuit more easily.

Another topic was used for the circuit design, and there I included the .asc file. See: https://forum.sparkfun.com/viewtopic.ph … er#p176645

I started this new topic, instead of continuing the design topic, because I felt the frequency oscillations warranted a fresh look.

Thanks,

Bob