Black Smoke from exhaust

I have a Hyundai accent with 114k, the check eng light comes on once in a while, depending on the type of gas I use or when it had been raining alot. I have not had an oil change in a while. Also I have replaced the air filter and added some engine cleaner so my car will pass emissions test in Delaware. But my car failed. Should I just get an oil change and a tune up so it will pass or do I need to do more drastic maintenance? Do you know about how much it should cost, I am a poor college student, not too expensive I hope, Thanks for any helpful responses

 In order to pass the emissions test you have to make sure that all systems are "up to spec", which will usually call for a tune up.  How has your maintenance been on this car?  I'm going to assume "poor maintenance" or worst case and suggest that you get the best spark to the combustion chamber . . . and suggest new spark plugs/spark plug wires/distributor cap & rotor.  I'm also going to suggest a fuel system cleaner to get the fuel injectors working properly . . . something like Techron or Seafoam.  I would also have the timing checked to make certain that it is in time.  You changed the air filter (recently?) so you should be good to go for another emissions test. I'm certain that others here might add a few more things to help you pass the test.   Good luck! Rocketman

The presence of the illuminated CEL is telling you that the engine is not happy. The way to make it happy, so to speak, is to bring its maintenance up to where it should be. While this will cost you some money, in the long run maintenance is far cheaper than the repairs that will result from not maintaining the car.

If you have the spark plugs replaced, there is a good chance that the CEL will go off and that your emissions will be in the passing category. While the car is in the shop for the spark plug replacement, you should also have the oil changed if you expect to keep this car for any length of time.