Take a fet and connect a resistor, or for set up purposes a variable resistor (trimmer), between gate and source. The drain is your "anode" and the gate your "cathode" of the resulting "constant current diode". If you require pretty accurate current you will need to adjust each one for the correct current and then replace the trimmer with a suitable fixed value resistor. The sample variation between fet's in IDss is quite wide hence the need to adjust each one on test. Try a 1K trimmer and for lower currents increase from there. With no resistance (trimmer at one end of track) you have the IDss of the fet itself and this is the max CC for that fet. Obviously you can leave the trimmer in if you want a variable CCS.
The commercial J501 etc are generally just exactly as described above but in a 2 pin package. I guess they make them with say 100R, 500R, 1K etc resistor and select them afterwards for correct current ie ones found to be within 0.9 and 1.1mA would be given the type number of a 1mA part. The higher the resistor the lower the constant current and the more "ideal" the CCS....
To test/adjust it put + 12V or so (9 - 20 fine) on the anode and a DMM set to measure current in the expected range (use 20mA or so range) from cathode to ground.
Now put the red lead of your DMM back into the normal socket on your DMM before you forget and try to measure a voltage and blow either the fuse in your DMM or something else!!! It's the most commonly made mistake with a multimeter and we've all done it... several times DOH!
If you need a really good CCS
and don't need it to be a two terminal (floating) device then other CCS types will easily outperform the "CCS diode" or home made version as above, especially for higher currents. Outperform? Yep, in terms of output impedance. A perfect CCS has infinite output impedance as it's a pure current source but if you're trying to get as much as say 5mA from a CCS of the type above it will have an impedance of say 10 - 100K... perfectly fine for many uses but other non floating types can give >1M quite easily. If you only want <1mA the fet type becomes much better. Don't fret over it as d
epending on the application 10K or more may be perfectly adequate. The beauty of the fet type CCS is it is floating