Honestly, I don't think the average kitchen is equipped to identify (with any accuracy) the presence of this molecule in pills that likely vary in impurities, fillers, etc. depending on the website you buy them from.
With that said, I don't think it's unreasonable that someone could develop an inexpensive testing kit that could at least give a "positive" or "negative".
The area of the molecule I would focus on is not the amide or sulfoxide, but the diphenyl group attached to the sulfoxide. These conjugated rings will absorb UV (literature suggests lambda max around 220-230 nm). So you have a molecule that absorbs UV and is hydrophobic, and you need to separate it from the other pill contents for analysis. One way to do this would be with a mini-TLC kit, where the Modafinil could be detected as dark spots under UV light.
- Small vial + cap
- Organic solvent (this would be determined by your
own testing) in dropper bottle
- TLC plate(s)
- Small glass capillary (for spotting plates)
- UV-LED Light
- Cool UV-protective glasses
- Crush pill, add to vial
- Add a few drops of organic solvent (provided by you in dropper bottle)
- Cap vial, shake well (trying to extract Modafinil into organic phase)
- Spot TLC plate, elute with appropriate solvent
- Compare Rf of spot to the Rf of Modafinil standard (alternatively, the presence or absence of the Modafinil spot may be enough to provide a positive or negative result).
If you are the person developing such a kit, calibration would need to be done using a known "good" sample of the Modafinil. I would be careful to watch for other UV absorbing impurities that may be found in the pills (e.g. reagents from synthesis). You could confirm these results using an HPLC with UV detector or NMR (or whatever other appropriate techniques you have access to).
If all else fails, do as the previous answer says and smell your pee!