Assuming you still have a current Apple ID, you would set up your old iPhone to send/receive messages on your Apple ID email address, rather than your mobile number.
- First you need to ensure you're logged into iCloud on your old iPhone.
Go to Settings > iCloud to do this.
- Second you need to set what 'addresses' you want to have your iPhone send/receive iMessages with. Go to Settings > Messages and tap on the Send & Receive option. You will see two sets of addresses, one you can be reached at and one you start conversations from. You will need to ensure that the Apple ID you use for iCloud is added and ticked.
NOTE: Your old iPhone can only send/receive iMessages while connected to the internet. Also, it will only work with the email address (people won't be able to send an iMessage to your mobile number as it's now on an Android device).
Should you run into any problems, post back using the comments function below.