Setting long exposure on a Nikon D40?

So I have a Nikon D40, an older model, and I'm lost as to how to get long exposure times. A friend of mine suggested a 30-second exposure for photographing lightning with an ISO of 100. I'm not sure how to get the shutter speed that low. Do I keep cranking the wheel below 0 when I put the camera in shutter priority or manual? Or is this under a separate menu entirely? I have a tripod, so I'm not worried about camera shake.

Your shutter speed will show at 30" for 30 seconds. Manual is best, but if you don't know how to set the aperture appropriately then shutter priority.

Use manual
After you have the camera set to 30 seconds, adjust the aperture to get the best shots, neither over or underexposes. You will have to experiment to determine this
Usually shooting lightning is better done with the shutter set to bulb. Aim the camera toward the storm and hold the shutter open during two or three lightning events
Any exposure longer than about 1/60th second is best done with the camera on a tripod.