How To create a circuit using ardino which will discharge a battery

I am creating a circuit which will be used to monitor the discharging of a battery. I can do this using a push button by directly connecting the positive and negative leads directly to the push button however I would like to remove the push button and control the on/off of a circuit such as this with the arduino. I tried transistors but they don't seem to work or maybe I did not configure them correctly.

Any ideas or sample diagrams?

I can do this using a push button by directly connecting the positive and negative leads directly to the push button

That is an exceptionally bad idea, as the current is limited only by the internal battery resistance. You can destroy the battery and even weld the pushbutton contacts together.

Always use a resistor or other load to control the battery discharge current to safe levels. The battery manufacturer states the maximum discharge current.

I am open to using resistors but my ultimate goal is to modify the current to discharge the battery using a range of settings. A stress test of sorts.

Use a resistor or a constant current circuit element to limit battery current.

Ohm's Law is your guide for choosing resistors.

Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

What sort of batteries are you testing?
What voltage and capacity are the batteries?

Thanks.. Tom... :slight_smile:

A voltage-controlled constant current sink circuit is what you want. If you take a PWM signal and low-pass filter
it to produce an analog voltage, then you can control the circuit from an Arduino.

Figure 1 in this page shows the basic circuit: Nullor - Wikipedia (ignore all the nullor stuff, the circuit diagram is the important point here)

The circuit uses a shunt resistor, Rr, to measure the output current and an opamp+transistor to control
the current according to the control voltage. Rc is not needed. For very large currents a darlington
transistor would be used.

For instance if the shunt resistor is 1 ohm, then a control voltage of 0.5V would mean 0.5A flows to ground
through the transistor and shunt. The transistor dissipates most of the power and will need a good heatsink.
The shunt resistor will probably also need to be sized for the power it dissipates (power = I^2 x R)