Automatic Battery Charger

Many thing in our daily need that can be easily by implement a simple applied technology. So our life become easy and comfort. We can make anything work automatic, or work without our intervention so if we forget to run it, or to turn off it, they will be done by their shelf.

By a simple applied technology, such as electronics, we can solve many simple problem as mentioned above. With the small dimension of electronic component and small power too, we can realize our need, such as automatic lamp, remote controller, water tank level controller.

Beside all that mention above, we can make many device that valuable to our need, such as decorative lamp, amplifier, detector etc. The simple applied electronic circuits are divided in to two groups, analog and digital circuitry.

Analog electronic circuits are those in which signals may vary continuously with time to correspond to the information being represented. Electronic equipment like voltage amplifiers, power amplifiers, tuning circuits, radios, and televisions are largely analog (with the exception of their control sections, which may be digital, especially in modern units).

In digital electronic circuits, electric signals take on discrete values, which are not dependent upon time, to represent logical and numeric values. These values represent the information that is being processed. The transistor is one of the primary components used in discrete circuits, and combinations of these can be used to create logic gates. These logic gates may then be used in combination to create a desired output from an input. In this page you can find one of the circuit.

Basically, battery charging has mean to flow DC current in to battery continue for several hour (depends on battery capacity and charging current). Charging process is stopped if the voltage of battery reached the maximum rating. At this voltage, if charging is not stopped then can make battery damage because of over heating ( battery get shorten life).

To avoid this condition, it will be better if we use automatic battery charger. System will charge the battery if its voltage drops to the lower voltage level and stops the charging process if its voltage reaches the upper voltage level.

Figure 1 is the simple example for automatic battery charger. This circuit work by the principle of voltage comparing that done by two op-amps. The low voltage level is detected by op-amp 2 and op-amp 1 detect the up voltage level. These op-amps work complementary, at a time only one op-amps has low voltage output. This low voltage (approximately zero) is used to set or clear the D flip-flop that same meaning with charging and stop charging. The lower and upper voltage level is tuned by VR1 and VR2.


Figure 1. Automatic Battery Charger Circuit.

To Microchip or Not to Microchip, That Is the Question

I saw three news articles this morning where authorities are searching for Alzheimer’s patients who have wondered away. Of course, this brings up the debate again – should Alzheimer’s patients be handed a microchip along with their diagnosis? I personally don’t like the thought of injecting someone who can’t rationally give consent for the procedure, but if my loved one was lost and freezing on a cold winter night, perhaps I’d feel differently.
The problem to me is that a microchip can be read by identity thieves, it can be tracked by people who are nosy or collecting information on your movements that you don’t want them collecting and it does seem a very alien idea in a country that is based on freedom. Any technology that has the potential to be misused by power hungry people makes me a bit nervous. So, to microchip or not to microchip? What do you think?

PIC 16F627 Based EQ-5 / CG-5 Dual Axis Hand Controller

One particular night, after a few weeks of not using my telescope, I found out the hard way why the 6v EQ-5 hand controller should not be connected to 12v by accident. It only took, literally half a second to kill my hand controller. After some examination it became obvious that I had destroyed the large 40 pin micro controller, the "brains" of the handset. Upon further examination it became obvious that the controller has no form of either, overvoltage protection or reverse voltage protection. It doesn't take much to kill that chip.
So I thought, surely if the hand controller is that easy to destroy, a simple Google search would reveal a source of either replacement hand controllers or even better (thinking of the environment) just the programmed micro controller. It turns out that you have to buy the lot, at full price. The hand controller and steppers, everything!

Well, I thought... there must be another way! And I am happy to say there is. Build your own hand controller. I could even protect it from over voltage, unlike the poxy standard chinese hand controller. The only down side was I had to learn to program a micro controller from scratch. Using a 555 timer circuit wasn't an option because the stability of the 555 isn't accurate enough. However a PIC micro controller running off a 4MHz crystal ought to be quite accurate.

So here for your benefit is what I did...





















The image opposite is the hand controller I came up with. The project box and switches etc you choose use are entirely up to you. I chose these because they are what I had to hand.
The total cost to build the unit will be between £20 and £30 depending on where you source the parts. Over and above that, if you don't already have one you will need an PIC programmer. I used the Velleman K8048 kit. This was a relatively cheap option but you have to build it yourself. Take a look at www.velleman.be, the kit is available in the UK from www.maplin.co.uk and do a search for K8048.

If you don't want to get into PIC micro controller programming then I can supply the PIC's at £7.00 each fully programmed up. The price includes postage and packaging. Contact me at astro(dot)bloke(at)ntlworld(dot)com for more details. I have a pay pal account or I will accept a cheque. Alternatively you could get a friend to program you chip for free if they have a PIC programmer.

What it does

The image below shows the functions of the hand controller.
You are able to select the slew speed. These are faster than the standard hand controller. The source code is available if you want to change this speed. If you ask nicely I might provide a second HEX file with a different slew rate for the switch positions. There are Slew buttons provided for each direction and also a stop button which will stop the RA drive.
I have also provided two switches to swap the directions of the slew buttons. One for DEC and one for RA. These are useful if, for example, you swap from using an eyepiece to webcam imaging, flick the switches and the buttons move the object in the direction you expect. It also allows you to use the controller either way up according to your preference. Please note that the RA direction switch does not affect the RA drive direction.

The Circuit

I decided at the beginning to use two PIC's. One for the RA drive and one for the DEC drive. The main reason for this was that the RA drive timing has to be accurate. If I have to start running DEC code on the same Chip as the RA drive, it would be very difficult to keep the timing right. Over and above this, there simply aren't enough in/out pins to go around on a PIC16F627.

Here is the circuit diagram.

I've split the diagram into three parts, hopefully that way it is easier to read.
The RA Drive, the power supply and the
DEC drive.
The RA drive circuit and the DEC drive circuit are essentially the same. However the DEC circuit omits the crystal oscillator. This is because timing isn't critical for the DEC drive, I've used the PIC's internal 4MHz oscillator instead. Note: that the internal oscillator of the PIC16F627A is also 4MHz.
The DEC circuit also omits the indicator LED.

The basic circuit consists of the PIC micro controller and a L293D which is an H-bridge driver. There are very few extra components needed for the circuit to work.

How it works

The stepper motors supplied with the EQ-5 drive are bipolar. This means that they have 4 wires connected to two coils. To drive the motor, step by step the coils have to be exited in the right order. For a bipolar motor this involves reversing the voltage across each coil in the correct order. Rather than me reinvent the wheel, take a look at this document for the L297 stepper driver for more information about how this is done. To reverse the voltage across the coils requires a circuit called an H bridge driver. Fortunately for me there is a relatively simple H bridge driver readily available in the form of the L293D. The L293D documentation is available here. The L293D has 6 inputs, 4 are the logic inputs that determine how the coils are driven and the other 2 determine whether the coils receive any current at all. They are the enable inputs. Enable 1 is associated with inputs 1 and 2. Enable 2 is associated with inputs 3 and 4. Also make sure you get the D version. This has diodes that route the back EMF from the motor coils safely away from the sensitive electronics of the chip. without these you would need to add the diodes to the circuit.
The PIC micro controller is used to supply the correct logic to the six inputs to the L293D, to drive the stepper motor at the correct rate.

The Logic

There are three ways to drive a bipolar stepper motor. They are shown below.
Two Phase drive: All the coils are always enabled. This is the method I initially chose to use, I've since produced a half step version of the code. Two phase has the advantage of the simplest logic because the enable is always, err... enabled. It also provides the highest torque for the motor. The disadvantage is that it uses more power and runs the battery down more quickly.

Input
1

Input
2

Input
3

Input
4

Enable
1

Enable
2

i

1

0

0

1

1

1

ii

1

0

1

0

1

1

iii

0

1

1

0

1

1

iv

0

1

0

1

1

1

Wave Drive: This method only energises one coil at a time. It creates less torque than the two phase method, the advantage being that it also uses less power so you batteries last longer.

Input
1

Input
2

Input
3

Input
4

Enable
1

Enable
2

i

1

0

0

0

1

0

ii

0

0

1

0

0

1

iii

0

1

0

0

1

0

iv

0

0

0

1

0

1

Half Step: This is a combination of the Two Phase and Wave Drive methods. It doubles the number of steps by halving the distance the motor travels per step. The advantage is that the motor turns in a less jumpy manner. This ia a good way to run at the RA drive rate. I have now implemented this in code. The RA rate uses half step, while the slewing uses two phase. It also uses a little less power than the Two Phase method without any major sacrifice to torque.


Input
1

Input
2

Input
3

Input
4

Enable
1

Enable 2

i

1

0

0

0

1

0

ii

1

0

0

1

1

1

iii

0

0

1

0

0

1

iv

1

0

1

0

1

1

v

0

1

0

0

1

0

vi

0

1

1

0

1

1

vii

0

0

0

1

0

1

viii

0

1

0

1

1

1

The Circuit board.

The diagram below shows how I wired up the circuit onto veroboard. Be careful to note the orientation of the chips. I also went a little overboard with the 0v to the L293D, you may omit, if you wish some of those links.

The Yellow circles are external connections to the circuit board.

  • Numbered circles are switch connections
  • "L" is the LED connections.
  • "A - A" and "B - B" are the connections to the stepper motor coils.
  • "+" & "-" are the power connections.