Activity Discharging The Batteries

The first thing we'll do is discharge the batteries. If your batteries are brand new, from the kit, and have never been charged before, then they will probably discharge quite quickly.

The small DC motor with the propeller will act as a load for the batteries. As the fan runs and the batteries discharge, we'll plot the batteries' voltage using StampPlot. Furthermore, let's time how long it takes for the batteries to discharge.

V Connect power to your board, and look at your watch and note the time.

V Download the code into the BASIC Stamp module. The Debug Terminal should pop up with the RX LED flashing.

V Note the COM port being used, then close the Debug Terminal

V Open StampPlot Pro by clicking on Start ^ Programs ^ Parallax Inc ^ StampPlot ^ Experiments with Renewable Energy ^ sic_ewre_exp_1.spm.

V Set the COM port in StampPlot to the same one that was being used by the Debug Terminal.

V Click on the Connect button, and make sure Enable Plotting is checked.

V Now take a look at the LEDs.

No LEDs illuminated:

V Go back and recheck your wiring and parts placement.

More than one LED on at the same time:

V Your LED leads are probably touching and making a short circuit. Recheck your wiring.

Red LED flashing:

V This is the correct state we want to be in.

Red LED Steady, Green LED Steady, Green LED Flashing, or Yellow LED Flashing:

V Switch to discharge cycle by pressing the reset button until Red LED starts to flash.

V The fan motor should now be spinning. Observe your StampPlot graph!

V Use your watch to time how long it takes the discharge to complete. The Red LED will come on steadily when finished.

f} What do I do if my fan is running backwards? Simply swap the leads clipped to the back of the DC motor!

If your batteries start from the fully charged state, it could take over two hours for them to discharge. However, if your batteries are brand new, it could take only a few minutes - or even seconds! If your fan ran for more than a few seconds, at least a portion of your StampPlot graph would look similar to what is shown in Figure 2-5.

Figure 2-5: Discharging the Batteries with a Fan Motor Load

The main part of the display, including the grid plotting area and the rectangular buttons below it, you've seen before. However, the right side of the display is new. It consists of four vertical gauges that display the measure of voltage and current generated in the battery and load during the charge and discharge cycles. Then below each vertical gauge is a small rectangle that displays the numerical value of the vertical gauge above. And below that is a two or three letter indicator of the parameter itself. From left to right these stand for...

BCI Battery Charge Current (in amps)

BV Battery Voltage (in volts)

BLI Battery Load Current (in amps)

BLV Battery Load Voltage (in volts)

During the battery charging cycle, only the BCI and BV gauges are active, however during the discharge cycle the BV, BLI and BLV gauges are active. Along with the plotted lines, these gauges give you an exact real-time indication of the voltages and currents involved in each charge, discharge and replay cycle.

Also note that the colors of the rectangles just below the vertical gauges match the colors of the plot lines. This makes viewing the plot and gauges a snap to understand and comprehend.

We'll come back to the StampPlot screen soon with even more information about it, however while allowing the batteries to charge, it would be a good time to start to understand what's happening with the circuit and the code that makes it work.

V First examine the variables in the Declarations section. The comments after each variable indicate the variable's function.

V Next, look at the code and again examine the comments after each line of code, including the label names.

Can you figure out what is going on? Check your guesses by following the detailed explanation in the section below. It explains how both the hardware and software work together to make the programmable battery charger a neat experiment.

Now that the first part of the battery charger program (Exp_1_Init) has been explained, let's explain the Exp_1_Drain subroutine.

By installing the motor-fan load and entering into the battery discharge cycle, several things will become immediately apparent. First, note that the left-most vertical gauge (BCI or Battery Charge Current) is at zero. This is because we have switched to the discharge cycle so no charge current is being generated. Then notice that the right-most two vertical gauges (BLI or Battery Load Current and BLV or Battery Load Voltage) are now active, along with the BV the battery voltage, again.

Let's look at the Exp_1_Drain code that makes this happen.

Exp_1_Drain:

IF (doneDraining = True) THEN GOTO Exp_1_End

LOW ChargeBatt HIGH DrainBatt TOGGLE DrainLED LOW ChargeLed LOW ReplayLed a2dMuxId = a2dMuxId0

GOSUB A2D

ch0 = a2dResult a2dMuxId = a2dMuxId2

GOSUB A2D

ch2 = a2dResult a2dMuxId = a2dMuxId1 GOSUB A2D

ch1 = ch2 - a2dResult

IF (ch2 < MinVolts) THEN doneDraining = True HIGH DrainLed LOW DrainBatt ENDIF

GOTO Exp_1_End

The first line of code checks the doneDraining flag. If it's True, the program simply exits. Since all variables are initialized to zero, the flag will initially not be True. Otherwise, a low ChargeBatt deactivates the Charge transistor, so no charging current flows into the batteries. Instead, the high DrainBatt activates the Discharge transistor, enabling the batteries to drain or discharge. The toggle instruction causes the red discharge LED to flash each time through this part of the subroutine. And finally, the last two instructions deactivate the other two LEDs.

The next six lines of code sample the battery load voltage (BLV) as cho, followed by sampling the battery voltage (BV) as ch2. The following three lines of code sample the battery load current (BLI), which is really the voltage drop across the 10 Q resistor that ties the emitter of the Charge transistor to the collector of the Discharge transistor. In this case the voltage drop across this resistor is the difference between ch2 and the a2dResuit value, which we assign to chi for the Piot_it routine.

Finally, the battery discharge program ends with a test of the battery voltage (ch2) against MinVoits. If the batteries have been discharged below MinVolts, then they are drained. The doneDraining flag will be set true, the red DrainLed turned on, and the battery charging transistor, DrainBatt, turned off.

DIY Battery Repair

DIY Battery Repair

You can now recondition your old batteries at home and bring them back to 100 percent of their working condition. This guide will enable you to revive All NiCd batteries regardless of brand and battery volt. It will give you the required information on how to re-energize and revive your NiCd batteries through the RVD process, charging method and charging guidelines.

Get My Free Ebook


Post a comment