Wednesday, January 18, 2012

Reviews of things that suck: KCl

Summary:

OK, SO! My ex was deeply offended when I stated that I did not like the salt free ketchup. I now know why.

Instead of salt, the ketchup uses a substitute: Potassium Chloride. Innocuous, food safe, but dangerous if you're on a potassium sparing diuretic. I'm not. My blood pressure stays just fine unaided (even on a CNS stimulant like Adderall), but, for kicks and because, I don't have very many salts of potassium, it was a cheap addition to my reagents collection (and I'm ALL about the cheap right now!) so, I decided to do a little taste test this morning. This strongly reaffirmed my belief that the addition of KCl to ANYTHING will render it unfit for human consumption.

OK, so, in my usual spice/seasoning tasting procedure, I shook out a small amount onto my hand. The crystals were just as cubic as our friendly NaCl salt that we all know and LOVE ♥. That, my dear friends, is where the similarity ends.

I wet my index finger, dipped it in the small pile to pick up a few crystals. I then placed my finger in my mouth and onto my tongue. For about the first 10ms it was kind of like salt, then it hit, an acrid, cloying, and gag inducing sensation of, "OH MY GOD, SOMETHING IS SERIOUSLY WRONG WITH this substance in my mouth" Yes, I gagged. Yes, my eyes squeezed down tight and my feeble brain tried to process this horror-inducing sensation in my mouth. I swallowed. The small amount won't actually hurt me, WILL IT? No, I'm reasonably sure it won't. The aftertaste, an impossible to describe, somewhat bitter, medicinal aftertaste permeated my mouth. If I didn't do something quick to neutralize the horror building in my mouth, I was sure to lose my breakfast. I grabbed the nearest drink. A freshly poured glass of cola, and chugged it down, to remove the ionic nightmare from my mouth.

I will never EVER ingest such a vile substance again. Into the reagent cabinet it goes, never to soil another morsel of food ever again.


Pros:
  • It won't raise your blood pressure
  • I'm sure it would be just as neat as sodium chloride for growing pretty cubic crystals
  • It looks just like salt
  • Has a nifty warning to consult your physician before using any sort of salt substitute
  • Makes a fine addition to my reagents. I don't have any potassium compounds, and now I do
  • An excellent source of potassium.
  • A great way to pull cruel pranks on unknowing friends when they go to salt up their delicious fries.
Cons:
  • May induce vomiting
  • Looks can be deceiving. It looks like salt, it shakes like salt, but unlike salt, it tests your gag reflex. 
  • It might kill you if you are on certain medications for the blood pressure you're watching so closely.
  • It's not iodized like sodium chloride. Your thyroid will be angry. 
  • It has a highly disagreeable medicinal aftertaste that will leave you wishing you were dead. 
In short. It looks great on paper, but the reality is it isn't the real thing, and it's not really a substitute. If you're watching your blood pressure, you're probably much better off either going really easy on the NaCl salt, or just skipping the salt all-together. Most food already has enough salt already, so leaving a bit off will leave you better off. 

Sunday, January 15, 2012

An update -- What is happening, projects, and stuff...

So, I discovered Monday that I'm no longer employed; that's always fun. On the bright side, it's an opportunity to find work closer to me, and possibly better pay.

I at one point started the design for a CPU, it's still in the back of my mind, and I'll get back to it.... eventually. And, I'm currently having a bit of fun trying to figure out how to separate copper sulfate from what appears to be a binder to keep it from crystallizing out of the solution. It's this that I want to talk about.

So, I picked up a bottle of algaecide at a store because it contained copper sulfate. I immediately knew something wasn't quite right, because the solution was green, rather than the characteristic blue that copper sulfate has. So, I looked on the ingredients, and most of the contents of the bottle are "stabilizers", polyacrylate, and another chemical that's escaping my memory at the moment. I went ahead and attempted to drive off the water, and see what happens. What I wound up with was essentially a useless green goo that smelled similar to something I had played around with as a kid, friendly plastic. I've given up on this being a useful form of copper sulfate to work with, the goo binds everything, I had a little luck with acetone, but the yield made it pointless.

There's a lesson here: If you're an amateur chemist looking for copper sulfate to grow blue crystals, buy the root killer stuff. It's already crystalline, and doesn't have the binders.


Tuesday, December 20, 2011

The sad state of science

This post illustrates in so many ways what is wrong with our world today. To continue stereotyping, and to continue to engrave the idea of blatant consumerism rather than real discovery and science simply disturbs me on so many levels.

I couldn't agree more with Bree. We should cultivate the culture of discovery in all kids, whether they are boys or girls. Arguably, one of the most significant discoveries in the 20th century was made by a woman, and that discovery brought about the nuclear age. (Whether it was a good thing or a bad thing is another matter all-together. That's what the governments did with the discovery...) which among other things helped broaden our understanding of physics, brought about a powerful new source of energy, and gave us life-saving cancer treatments.

Mock Ramblings

Some shameless promotion of a friend's blog:

Mock Ramblings

He's a writer, and posts some rather clever series. If you haven't read any of his writing, you really should! It's good. Real good. One of my favorite (though they haven't made an appearance recently) is Reflections of a Deranged Cultist. Formatted as hijacked blog postings, the deranged cultist, and no sometimes his love interest make postings about the goings on in a secret Cthulhu worshiping cult. What could be more fun? A steel sphere filled with angry porcu-bats, that's what!  

Wednesday, December 07, 2011

Lab Notes: Elemental Iodine - wrap up

In my previous experiment I extracted elemental iodine from Tincture of Iodides. Now to explore how it happens. I knew that the mixture of hydrogen peroxide and hydrochloric acid caused elemental iodine to precipitate from the solution, but didn't understand the mechanism. Now, after a bit of exploring and research, I understand the reaction mechanism. Starting with what is known:




You can see the potassium is left as a positive ion, as the iodine is no longer combined with it. Also note the Iodine was in the -1 oxidation state, but is now in the 0 oxidation state. This means it has been oxidized, not reduced. So, an oxidizer is needed to move the state up one. Hydrogen peroxide is readily available, and at low concentrations is relatively safe to work with. No oxygen was evolved in the reaction between the hydrogen peroxide and potassium iodide, so what is hydrogen peroxide reduced to?



Water and an oxygen radical? Not quite. I'll get to why in a moment.Since no oxygen is evolved from this reaction, I know that oxygen is not generated, so the hydrogen peroxide must be reduced to water. In order for that to occur, there must be hydrogen ions available to balance the equation. So, this pair of half-reactions is most likely:




Adding an acid allows the hydrogen peroxide to decompose to 2 water molecules. After combining the 2 equations, you obtain this equation:



Which is the mechanism behind the reaction. It is a redox reaction, where the Iodine is oxidized, and the hydrogen peroxide is reduced. In my reaction I used hydrochloric acid, so putting everything together, this is the resulting reactants and products:



As you can see, the result is elemental iodine precipitating out of a solution of potassium chloride.

Tuesday, December 06, 2011

Lab Notes: Iron Oxides

For fun, I had this idea: the classic grade-school experiment: making rust. Good ol' iron oxide. So, I grabbed a small row of staples, added some salt, and dropped them in the water.... and waited.

I'm not the most patient person in the world, so I grew tired of how long it was taking to turn steel into rust. Thinking to myself, "Hydrogen peroxide is an oxidizer, therefore, hydrogen peroxide should make the rust faster", and it did. What I ended up with was iron hydroxide, no iron oxide, but with heat it dehydrates, which yielded the black iron oxide, magnetite. Not surprisingly, it's magnetic and quite fun to play with, but it wasn't what I was after, I wanted the deeply red Iron (III) Oxide. When rust forms, it's a mix of oxides and hydroxides. I was hoping to separate the two by somehow driving one into solution, while leaving the other alone. The idea occurred to me by way of a mistake. I had a vial of what was left over after attempting to get a purer form of acetic acid through heat distillation, instead of grabbing the empty vial, I grabbed that one instead, pouring  the magnetic iron oxide into that instead of an empty vial. I noticed that the brown portion was gone, leaving behind only the black. I also noticed that the solution took on a very strong orange coloration. So, I set out to attempt this. Reacted more of the oxide with vinegar (acetic acid), and filtered. To my surprise what came out was a stunningly bright orange solution. What I'm not sure of right now is if it is iron acetate, or iron oxide dissolved in acetic acid. I'm in the process of evaporating the liquid from the solution, and I will see what I get when I rinse the dry product with water.

On another note about the oxidation with hydrogen peroxide, it seems to go much faster with the introduction of sodium chloride (table salt), I don't know the mechanism behind this, but it was very interesting to observe.

Tuesday, November 29, 2011

Lab Notes: Introduction, Element Collecting and Elemental Iodine

First, an introduction to a new feature of this blog: Lab Notes

As a kid, I was very interested in chemistry. I begged and begged for a chemistry set, finally mom and dad relented and purchased a rather nice one. I spent many, many hours doing the experiments with the set. As I got further along, I found a book that had some more advanced chemistry experiments. Many things fascinated me in the book, but they all looked to be a bit complex, but I saw something that seemed simple, and produced an exciting result; a chemistry class classic, the reaction of potassium permanganate and glycerin. Somehow I convinced my mom to procure KMnO3, and the glycerin. I then did the experiment in a tuna tin. Mom was quite shocked at the result. I was quite satisfied with the 1ft high violet flame. I was also hooked.

I dabbled a bit in reading about chemistry online. It was interesting, but was missing the practicality. I'm finally in a situation where I can do a lot of the stuff I've been wanting to do with chemistry. Now I've bought some glassware (as I get into more stuff that could be potentially toxic, I do not want to use my dishes!) and set about with some experimentation. And with that, I realized I need to keep lab notes, hence, the new blog subject: Lab Notes.

First experiments


A couple of my first experiments were some basic kitchen chemistry, producing sodium acetate out of vinegar and baking soda, concentrating it to the hydrated crystals, and creating a super saturated solution to play with instant crystallization. after a few failures, I had some success, but the product was impure and rather finicky, but did get the instant crystallization I was looking for. I wanted more, and I had been watching a lot of YouTube videos, and found an interesting one to try. It required hydrochloric acid (available at any hardware store as muriatic acid) and hydrogen peroxide. Essentially extracting the bismuth metal from Pepto-Bismol. I haven't done this one yet, but I am planning it. I experimented with a small amount of the HCl and aluminum metal, which dissolved the metal to make a solution of aluminum chloride. It really wasn't surprising and totally expected, also expected was the exothermic nature of the reaction, I was careful to only add small amounts of aluminum at a time to prevent it from heating the plastic cup too much and causing a nasty spill. I eventually moved this outside because of the HCl fumes.

Element collecting


One of my hobbies which started a couple of years ago and inspired by Theodore Gray is the practice of element collecting. I started with coins stamped in various metals (I will one day photograph the coins and share them here), there are elements that aren't currently available as a coin. I added mercury to my collection by harvesting the small glass ampoule from an old thermostat, but aside from the coins (which are most of the transition metals, alkali earth metals, rare-earth metals and some of the non-metals) I was still short on my collection. I wanted more, especially the alkali metals and halides. Neither of which companies are willing to ship due to the reactivity. This is part of the reason for my desire to get chemistry gear, and start doing some home chemistry. The other reason is to investigate was of purifying various substances, such as acetic acid from vinegar, sodium acetate, and so on. I also wanted the lab gear for another hobby of mine: electronics, which to make printed circuits requires some etching chemicals which are rather nasty, toxic and corrosive. I wanted proper handling for these reagents, rather than using something that could potentially be confused with kitchenware.

Preparing Elemental Iodine

So, at Walmart, I was purchasing hydrogen peroxide for the bismuth experiment, when I spotted a tiny brown bottle: Tincture of Iodine! The first thought that ran through my head was elemental iodine. So I bought it and brought it home with me. Last night, while catching up on Youtube, I came across a video, coincidentally, which explained how to isolate the iodine from the tincture. It was simple, and used chemicals and items I already had, so off I went. That's when I noticed something disheartening: It was not tincture of iodine, but tincture of iodides. Hmm. I remember seeing a video on how to extract iodine from potassium iodide (which this contained, along with ethanol, ammonia(!), and ammonium iodide) Ok, so its the same procedure, just a different starting point. No big deal, the ammonia however posed a problem: Iodine reacts with ammonia to produce nitrogen triiodide, which is a contact explosive. I can't have that! So, I started with tiny amounts of everything. a couple ml of the tincture, HCl and hydrogen peroxide. This way, If I do make the nitrogen triiodide accidentally, it will be a small enough quantity that it can be easily dealt with. So, I begin pouring the HCl into the beaker, and (with a bit of dread) noticed it start to fume as I brought the beaker over the one that contained the tincture. Oh, no... not HCl vapors again. I'll have to go out in the cold to finish it. It then occurred to me: I have 2 substances which are giving off a gas, HCl and ammonia. the two combine to form ammonium chloride, the substance of a smoke! This also allayed one of my fears, the HCl would react away the ammonia and prevent the triiodide from being produced. This was good, so I finished the reaction, and proceeded to filter the iodine precipitated from the reaction.

The iodine was then transferred to a small vial and heated to verify that it was indeed iodine, the purple vapor indicated it was what I wanted it to be.

So, now i have a vial of iodine to add to my element collection.

Sunday, June 20, 2010

Bypassing the Property Grid's Sort Order

While working on a programming project one of the things I wanted to include was the ability to list out the values in the collection in the same way the array lists its items.

Normally, the collection displays an ellipsis button, allowing the user to manipulate the collection, but does not allow the user to expand the list of items like an array does. I figured this would be very simple to add. The .NET framework provides a base class for an object called a TypeConverter. The TypeConverter allows objects of various types to be translated to and from various representations.


Beyond that, the TypeConverter can supply a list of standard values (Enumerators use this, which allows the property grid to display a drop-down list containing the various valid values.) The TypeConverter can also supply an editor class for the type (You see this in form designers all the time, the font dialog, the drop-down for colors, the drop-down for for docking, etc...) Finally, the type converter can also supply a list of properties that the object can display as child properties of a property. It is this that I will focus on:

public override bool GetPropertiesSupported(ITypeDescriptorContext context)
{
return true;
}
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
List<String> lst = (List<String>)value;
ListItemDescriptor[] props = new ListItemDescriptor[lst.Count];

for (int i = 0; i < lst.Count; i++)
props[i] = new ListItemDescriptor(i);

return new PropertyDescriptorCollection(props);
}

The above code demonstrates how the properties are provided by the TypeDescriptor. Using the above code results in the following list in the grid:
Far from optimal for dealing with a list of items. The list is sorted alphabetically. But arrays seem to sort by index. That was what I wanted, so I began spelunking through the reference source code of the .NET framework. Examining the Array code and ArrayConverter code revealed nothing. They were doing essentially what I was doing. I then explored the grid. It appears the PropertyGrid itself considers an array a special case and sorts the items by index. That is no use to me. 
Using the sort method of the PropertyDescriptorCollection object does nothing, since the grid will always override it with the user's sort preference. So, how to sort the items by index?
The secret is in the property descriptor collection. Replacing the return statement above with the following:


return new ListPropertyDescriptorCollection(props);

The following listing shows the ListPropertyDescriptorCollection class that does the magic:
private class ListPropertyDescriptorCollection : PropertyDescriptorCollection
{ 
    public ListPropertyDescriptorCollection(PropertyDescriptor[] props)
    : base(props)
   {
  
    }

    public override PropertyDescriptorCollection Sort
    (System.Collections.IComparer comparer) 
   { 
        if (comparer.GetType().Name == "DisplayNameSortComparer") 
       { 
            ListItemDescriptor.ListItemDescriptorSortComparer comp = 
             new ListItemDescriptor.ListItemDescriptorSortComparer(); 
            return Sort(comp); 
       } 
         else 
       { 
            return base.Sort(comparer);
       }
    }
 }


The code that performs the trick should be rather self-evident:

ListItemDescriptor.ListItemDescriptorSortComparer comp = new ListItemDescriptor.ListItemDescriptorSortComparer();
 return Sort(comp);

Two lines of code in this function do all that is necessary to force the numeric sort. The comparer in this case compares the indicies of the descriptors, causing the sort function to sort by the numeric index. This completely replaces any sort function used with the desired sort, thereby forcing a sort by index. 


 

Wednesday, June 02, 2010

Building a CPU - Stalled

I'm currently stalled on the CPU project, mainly switching focus to writing my own logic simulation program with the hopes of bringing this project into a program that's a bit easier to use.

I've still be mulling over the program counter update issue and why it isn't syncing, but I just haven't given myself much time with that.

Wednesday, May 19, 2010

Building a CPU - Following instructions

Well, my first run through on the simulator with memory and a few instructions worth of microcode and... well, hmmmm.

The instructions seem to work fine until the instruction terminates, and goes back to the fetch instruction, then things fall apart. For some reason, the program counter doesn't seem to be advancing right, or the flip-flops holding each 4-bit word don't seem to be getting the appropriate instruction at the appropriate time.

I'm going to need to do some more experimentation and thought on this one to figure out what went wrong. I have a feeling what I really need to do us use latches instead of flip-flops. More things to play around with. It may make sense to make the registers D-Latches as well, so data is written instantaneously, rather than on a clock tick. Another possibility is using more than one clock, possibly by using some sort of delay line or a secondary clock source.