Andy Fletcher Homebrew

Ramp Generator

This is a ramp generator to be used mainly as the sweep input to my AimTTI TG120 function generator. The ramp generator is an analogue generator based on a 555 timer and a couple of single rail op amps, monitored by an Funduino Nano displaying waveform period and frequency range on an LCD display. The picture shows the ramp generator being used to sweep my 40m LPF. Looks similar to my earlier LPF tests. The code does not assume the TG120 sweep frequency is linear wrt voltage and uses measured frequencies, interpolating between them.

on the bench
on the bench

This picture shows a screenshot from the scope with annotations added manually to show some of the frequencies.

40m-lpf-fr-sweep
40m-lpf-fr-sweep

Circuits

The Analogue Schematic shows the circuit used to generate the waveform. Based on a W2AEW design – thanks again Alan! The Digital Schematic shows the circuit used to interface the analogue part to the Funduino and the interface between the Funduino and the LCD. Note: The voltage regulator is supplying 4.66 V (not 5 V as shown in the diagram) to the Funduino and LCD and both seem happy even though they are both rated for 5 V input.

Code

The ramp generator code is written in the Arduino C variant using the LiquidCrystal library. Pulses from the 555 timer are vectored to either a falling pulse ISR or a rising pulse ISR. Each ISR stores the voltage of the waveform. The falling pulse ISR also calculates the period of the ramp. The non-interrupt functions just display the results to the LCD. Two indications are shown if the voltage goes outside the bounds expected by the TG120. ‘^’ for too high, and ‘_’ for too low.

Inside the box

This picture shows the inside of the ramp generator box. If I were to rebuild the generator I would put the pots and display on the bottom of the box rather than the top. The ‘motherboard’ could be mounted on the side. This would allow me to avoid having lots of long digital wires whose square waves tend to be picked up by the sweep output. I have been lucky to get away with this by tucking them away from that side of the box. At least I realised that I needed to allow enough space for a mini-USB plug for re-programming – they stick out a long way from the Funduino.

Inside the ramp generator box
Inside the ramp generator box