• N&PD Moderators: Skorpio | thegreenhand

Purifying codeine CWE by extracting with diethyl ether, please help!

MrBadExample

Greenlighter
Joined
Jan 9, 2018
Messages
8
Hi guys,

I went to the pharmacist to buy some codeine tablets, and the pharmacist told me that they only had soluble ones with caffeine (32 tablets). Instead of being sensible and going elsewhere, I overestimated my chemistry skills, and decided to buy them, figuring that I could "easily" extract the codeine :D

Each tablet contains 500mg paracetamol, 30mg caffeine, 12.8mg codeine phosphate, and 400mg of sodium :(
The tablets also contain sorbitol.

So I did a bit of research and found out that the tablets probably contain sodium bicarbonate and citric acid, this is how they effervesce; these compounds neutralize each other when they dissolve.

I figured that there would be no practical way of extracting the codeine without using water, so I ground up the tablets and added the 32 tablets to around 200mL of water, allowing the neutralization reaction to complete.
The mixture was then stirred thoroughly and filtered to remove the insoluble paracetamol.

I did a second extraction on the filtered residue, just for good measure.
At this point I had 250mL of water containing 410mg of codeine phosphate, 900mg caffeine, ~1g of paracetamol, and an eye-watering 150g of sodium citrate.

The plan, at this point, was to evaporate off all of the water, then do a second extraction using much less water, maybe 10mL, hereby getting rid of most of the caffeine (which is soluble to the degree of 16mg per mL).
However, sodium citrate is freely soluble in water, so the resultant filtrate would contain far too much sodium to be safely ingested! I tasted it, which confirmed my suspicion that I had a noxious heart-stopping salt solution with traces of codeine...

I needed a way to get rid of the sodium compounds, or separate the codeine, and the only way that I could come up with was to basify the solution, converting the codeine phosphate to freebase codeine.
From here, I could either try to precipitate the codeine base (which I decided was not really viable because it is far too soluble at 8mg/mL, so even using 5mL of water would result in the loss of 10% of my codeine), or extract the codeine using an immiscible non-polar solvent.

I looked up the solubility data, and found this page https://totseans.com/bbs/discussion/24209/extracting-codeine-with-acetone-or-other-solvents

Also I remember reading this on Rhodium:https://erowid.org/archive/rhodium/chemistry/codeine2morphine.html


Unfortunately, I don't have access to chloroform, so I decided to use diethyl ether (although it is considerably more soluble in water, which seems to be a problem)

Having gathered enough information, I evaporated off all of the water, and dissolved the residue in about 50mL of boiling water, allowed it to cool, and thereafter filtered any residiual precipitated paracetamol.
Next, I added sodium hydroxide to raise the pH to 12 as described on the Rhodium page.
Finally, I added about 5mL of ether and shook it up thoroughly with the water, thereafter allowing the ether layer to separate on top of the water.
A second extraction was done, and the ether combined with that from the previous extraction.

I began evaporating off the ether, and immediately noticed small white needles being precipitated.
Once the ether was completely evaporated, I had about 500mg of off-white goo, which tasted quite bitter, could this be codeine base?
Here comes the strange part...

After having been left in the light for a few days, the basified water (from which the codeine should have been extracted) has turned from clear, to yellow, to dark brown. The solution is now almost black!

So, have I failed after-all to extract the codeine base?
If I succeeded, why is the water turning brown, this can only be (I presume) due to the presence of codeine...

I suspect the decomposition of the codeine in solution has been accelerated by the presence of the strong base, sodium hydroxide.

Looking at the solubility data, I noticed that caffeine is far less soluble in ether than codeine, so I decided to do a second extraction on the off-white material, just to ensure that it was not caffeine that had been carried over into the ether somehow.

I dissolved the off-white goo in about 50mL of hot water, and this is where it gets interesting.
The substance melted and began forming clear, oily droplets atop the water.
As the water cooled, these droplets seemed to dissolve for the most part.
This is consistent with what the Merck Index says, that codeine, when heated in a small amount of water, forms oily droplets.

However, this is what confuses me:
Once the solution had cooled, I extracted it with ether, shaking it thoroughly as usual, and upon evaporating the separated ether layer... Nothing!
No codeine came over in the ether extraction.

So now I am very confused, everything points towards the off-white material being codeine, the bitterness, the oily droplets, and the fact that it couldn't be much else because salts, paracetamol, and caffeine are pretty much insoluble in ether, and the substance is not sweet so it isn't sorbitol.

But why didn't the codeine come over in the second extraction?
The only thing I can think of is that the pH was not alkaline, it was neutral (just dissolved the off-white material in plain water), so maybe the codeine base is too soluble in the water, and so it does not come over into the diethyl ether, maybe I need to basify the solution to reduce the solubility of the codeine base so that it is more inclined to come over into the ether?

Any suggestions you might have would be greatly appreciated.

I love you guys.
 
Codeine is only moderately soluble in ether, you need to extract the basified aqueous solution multiple times, probably at least 5-10x. Otherwise you leave the majority of the codeine behind in water. Codeine freebase is also more soluble in clean pure water than water saturated with salt or strongly alkaline solutions, due to the "salting-out" effect, explaining why you didn't extract any codeine the 2nd time around.

Also, because you did not dry the ether extract, your codeine will actually be a wet paste of codeine and water. Ether does of course dissolve some water (and water dissolves some ether), it's part of what makes it an effective extraction solvent. As a result the material certainly will not be pure. Pure dry codeine freebase is a white to off white crunchy powder.

Caffeine is also not stable in strongly basic solutions. As you noticed the solution will darken after a while. Codeine is actually pretty stable in alkaline solutions.
 
Last edited:
Thanks for the help.

I've tried a few things since then, i.e. basifying and adding salt to the codeine solution, then trying to extract it with ether.
This didn't work, I just have some oily stuff that doesn't taste bitter.

I have added some caffeine to a strongly basic solution of sodium hydroxide, just to see how long it takes for the solution to darken.

Does the darkening of the solution mean that it will become inactive quite rapidly, or is some equilibrium reached after only a small fraction of the alkaloids decompose?

According to the Merck Index:
"Even ampuled aq solns of morphine sulfate will turn brown on storage. No loss of analgesic potency and no increase in toxicity has ever been demonstrated for such discolored solns"

Further extractions of the original, darkened, solution seem to be yielding nothing so presumably most of the codeine has either already been extracted or it has decomposed beyond all recognition :D
 
Top