This enclosure is not 100% waterproof but can reasonably survive rain while protecting your smartphone. This enclosure was used over a 5 day period including two days of rain and easily kept the camera dry.
Using this enclosure, you can take time lapse videos like this.
Step 1: Parts you will need
2. A few scraps of 1" thick wood or plywood
3. A smartphone with a time lapse application and built in camera
4. Small tripod
5. Charger cord for the smartphone
6. Miscellaneous screws
Step 2: Build the main box
Using a router, cut a slot on the inside top and inside bottom that is approximately the thickness of the smartphone. The phone will slide into the box in these slots.
Some smartphone cameras are very close to the edge of the phone. You may need to chisel out a bit of the slot to prevent obstructing the camera's view.
Use plexiglass for the front and back so the camera has a good view and so you can see the smartphone's screen to aim the camera.
Attach the front and back plexiglass to top and bottom wood pieces using the screws. Be sure to size the opening using the smartphone so that it slides smoothly into the routed slots.
To ensure the enclosure is waterproof, use some silicon between the wood and the plexiglass.