OBD 2 started in 95 cali and 96 federal Sentras. I'm asking because this is a general GA16DE forum which covers 91-99. If its OBD 2 you can have a parts store or garage run an emissions readiness scan that can tell you the condition of the EGR, O2s, EVAP, and other emissions systems. Is its OBD1, you're on your own.
If it passed at idle, but not at 40 km/h, I'd rule out the cat, since it should be equally effective at any speed (provided the engine it warmed up). The piston engine is very inefficient at idle (which is why most hybrids shut the engine down at idle). The systems that come into effect at a cruise are the EGR and EVAP. From what I've read since my last post, I'm leaning toward a lean condition, which could be a number of things. I'll try to remember to ask my teacher about your problem on Monday and see if he has any input. As I've said before, the O2 and CO2 readings will be very helpful in determining your problem, since they act as indicators of the real problem. There is a chart in one of my books that shows the relationship between the 5 gasses and the AFR.
If you have OBD2, see if you can get a free emissions readiness scan. If you have OBD1, check the EGR system and the O2 sensor first. Do you have a multimeter? Since my '93 Sentra has a one wire O2 sensor, I'm assuming its a zerconia (voltage generating) type (if I'm wrong, someone please correct me), which sends a variable voltage to the ECM. This voltage ranges from 0V to 100mV DC. Back probe the connector closest to the O2 (stick a sewing needle into the back of the connector alongside the spade contact so you can get readings while to ECM does. Take the positive reading from here and run the negative lead to the negative terminal of the battery). Look at the voltages and make sure it doesn't go out of the specified ranges. Then set the meter to hertz and look for 2-5 Hz (again, please correct me if I'm wrong, I'll look in my books and confirm the range on Monday). If your O2 fails either test, it needs changed.
There are several things to check on the EGR valve. The easiest is to let the engine idle and to manually pull up on the diaphragm and see if the engine sputters or stalls. If nothing happens, the passages are clogged, if the valve doesn't move under hand pressure, its stuck.
Try these things and let me know what you get. I'm a tad drunk, so I may have left something out. Feel free to ask questions.