What is the difference between bc547 and 2n2222A transistor. I have use bc547 for a project (Water level indicator). Can i use 2n2222A instead of bc547? How each transistors are selected for each project?
There is not much difference when it comes to electrical properties of the two transistors. You can have a look at the datasheets :
The two major differences that I find are:
the power dissipation (a measure of power that transistor can provide):
2N2222A - 625mW
BC547 - 500mW
collector current (output current in common emitter config):
2N2222A - 600mA
BC547 - 100mA
So your application defines your selection in such cases. If you need more current amplification for same biasing voltages you might want to go for 2A2222N.
Read the datasheets carefully and make your choice.