Build A Camera

From Global Meteor Network
Jump to navigation Jump to search

Parts and Tools needed

Annotated Parts List

Click on the image to the right to see a larger version with the parts labelled

  1. IMX291 sensor board
  2. Lens with the lens holder - 4mm, 6mm are M16 mount as pictured, while other lenses might be CS which have a different holder
  3. 2x M2 screws
  4. Camera housing
  5. Small cable gland
  6. Large cable gland
  7. Camera PoE cable (sometimes called a network cable by the sellers)
  8. Camera board holder
  9. Holder metal plate
  10. 3x M2 screws, 12 mm long
  11. 1x M3-.50 screws, 6mm long
  12. Metal plate screws supplied with the housing
  13. Transparent weatherproof silicone
  14. Housing mounting bracket
  15. Waterproof ethernet cable protector
  16. Pair of PoE adapters (not shown) or a PoE injector (not shown), to supply 12v to the camera.
  17. 12V power supply for the camera (not shown)

Where should I get all this stuff, you say? Here the up to date list of sellers: LINK

Some cameras come with a slightly different cable with a separate 12v socket for power input as shown here. If you have this cable you will need a pair of PoE adapters (seen in that picture in the background). If your camera has a single cable as shown in the main picture, you will need a PoE injector or single adapter.

You will also need small wire cutters and various size screwdrivers, plus a drill and suitable screws to attach the bracket to a wall.

To test and focus the camera you will need VLC. This software is preinstalled on the Pi but is also available for Mac, Windows or Linux from here.

Notes on Purchasing

  • The Camera, lens and camera PoE cable should be bought together to ensure they're compatible.
  • The camera housing, board holder, plate, cable glands and mounting bracket normally come together too, but you may need to ask the seller to include the camera board holder and bracket.
  • The camera and housing can be bought from AliExpress. There may be other sources but we have yet to find any reliable ones.
  • Other items can be found in most hardware stores or your favorite online retailer.

Assembly

[Note: there's a longer version of the camera assembly section of this page available on Google Docs. Please refer to this if you need more information.]

Preparing the Lens

Punching out the filter
  • Start by removing protective covers from the sensor and lens. Take care not to touch the sensor after this is removed.
  • The cameras come with an IR Block filter in the lens holder. We don't want this.
  • If you have a lens like the one shown, unscrew the lens from the holder and using a screwdriver, carefully punch out the filter from the front as shown in the image on the right. If it shatters, make sure there are no shards left.
  • Some lenses come with two filters, one for day and one for night. You'll be able to tell because the lens holder will have a small cable to plug into the camera board. If your lens is like this DO NOT try to punch out the filter. Instead remove the cover from the lens holder and carefully remove the clear filter. You can leave the other, reddish, daylight filter.
  • Next look on the underside of the lens holder where you will see two plastic nubbins. These get in the way, so using the wire cutters snip them off. Make sure you get the base completely flat.
  • Then screw the lens back into the lens holder.

Attaching the Lens to the Camera

Attaching the Lens
  • Carefully unclip the circuit board from the plastic holder but do not detach the ribbon cable.
  • Using the supplied screws, attach the lens to the sensor.
  • Replace the circuit board in the plastic holder.

Preparing the Camera Housing

Glands in Place
  • Fit the small cable gland to the housing and pass the loose ends of the Camera PoE cable up through, but don't tighten it up yet. Remember to slip the cap over the cable first!
  • Fit the large cable gland in the other opening, and push a piece of plastic packing foam into it. Don't seal it up completely though this is to keep insects from getting in, but allow moisture out.

Attaching the Camera

Camera In Mount
  • Connect the metal camera holder to the metal plate using one 6mm M3 screw. Note the orientation of the plate as shown in the photo.
  • Using three 12 mm M2 screws, connect the camera board to the metal holder passing the lens through the square hole from the back.
  • Note that the writing on the camera board must be UPSIDE DOWN to get the correct orientation of the camera. In this orientation, the sockets for power and networking will be at the bottom of the rear of the camera board.
  • Finally, remove the plastic cap on the lens.

See image for the proper camera board orientation, so the video is not sideways or upside down.

Installing the Camera in the Housing

Camera In Housing
  • Remove the plastic plate from inside the housing and discard it.
  • Fit the camera on its metal plate into the housing, as close to the front glass as you can get it without actually touching. A few millimetres away should be good.
  • Looking at the camera from the rear, attach the largest connector (often with blue/green wires) to the right hand socket.
  • Attach the power connector to the left hand socket. This connector has several pins but only two are connected (red/black).
  • The third connector (two pins, red/black) is for a powered lens and is not used so tape it back out of the way.
  • Once you've secured the camera in position, you can tighten up the cable glands.

Testing and Focusing

At this point, your camera must be tested and focused. There's no point sealing up the housing and screwing it to the wall if its not working or isn't focused !

Testing the Camera

  • If your camera came with a single PoE cable, connect this to a netork cable and plug the other end of the network cable into your PoE injector.
  • if your camera came with a cable with separate network and power sockets, plug the "output" PoE adapter into the camera cable and plug a network cable into the PoE adapter, then connect the other end of the network cable into the other PoE adapter.
  • . Connect the PoE adapter or injector into a spare socket on your home router and connect the camera power supply to it.

The Camera PoE cable lights should come on, indicating traffic is flowing. After a few seconds, it should steady down to irregular flashing. If you don't see flashing lights then check the cable connections to make sure everything is plugged in properly.

Find its IP Address

Finding the Camera Address

The camera should now appear as a device on your network and to test it properly you will need to find its IP Address. The easiest way to do this is using a free piece of software called [IP Scanner]. Download and run it (no need to install). Click "Scan" and wait till it finishes. The camera can be identified by Manufacturer 'ICP Internet Communications' or 'Motion Control Systems' (see screenshot - i have five cameras!).

Checking the Connection

VLC Network Stream
  • Once you have the IP Address, open VLC on your Pi, Mac or Windows machine, and from the "Media" menu, select "Open Network Stream".
  • Enter the following into the address box, replacing 1.2.3.4 with the address you got in the previous step

rtsp://1.2.3.4:554/user=admin&password=&channel=1&stream=0.sdp

  • After a second or two, you should get a view through the camera. If nothing comes up, check you have got the right IP address, and that the cables are secure.
  • You can now double-check that you installed the camera the right way up...
  • Note that its entirely normal for the image to be very red and overexposed in daylight. We've removed the IR Block filter, so the camera picks up a lot of red light. This is exactly what we want.

Checking for Obstructions

Obstructions
  • You should also close the housing case up and check if it can be seen obstructing the view anywhere.
  • Move the camera around on the mount to minimise the obstructions, and if necessary bend or tilt the bracket to angle the camera down a bit.
  • However, don't worry if you can't eliminate all obstructions. Later on you will create a software mask to prevent these areas causing false detections.

Focusing the Camera

There's a whole separate section of the Wiki on focusing, but here's the short version !!

  • connect the camera to your network as above.
  • Open VLC.
  • Aim the camera at something at around 30-50 metres away.
  • Screw the lens in and out slowly to get best focus.

Note that there's a short lag due to the network, so you should wait a second or two after each adjustment to allow the change to be reflected in VLC.

Setting Camera Parameters

To operate at night, the camera must be reset to the correct gain, colour mode and video mode. There are two ways you can do this:

Using the CMS Software

CMS is a security camera software package you can download from the internet. You can use the CMS software as explained in this video by Denis Vida. Note however that you should reset the network as the LAST thing you do. The video does it a bit soon.

Using the RMS software (currently experimental and only for Pi4 systems)

Making sure the Pi can see the Camera

NB: this relies on code still being tested - contact us via the groups.io forum if you want to try this method

  • Install RMS on a Pi as explained here.
  • Open a Terminal window on the Pi and, using the address of your camera, first make sure the Pi can ping the camera:
ping a.b.c.d
  • Run this script to reset the camera IP address. You will lose connection to the camera and see a bunch of error messages. Thats normal.
 python Utils.SetCameraAddress a.b.c.d 192.168.42.10
  • Now plug the camera directly into the Pi's ethernet port and run the following script to update the camera gain, video mode, and other settings.
Setting Camera Params
Scripts/RMS_SetCameraParams.sh
  • Note: If you have RMS installed on your PC, you can change the camera address from your PC instead, then connect it to the Pi and run the 2nd script.

Final Steps

Sealing the Housing

Sealing the Housing

Depending on your climate, its usually advisable to seal up the camera housing against rain and snow.

From the outside, carefully go round the edge of the glass with silicone sealant. Also squirt sealant into any screw holes visible on the front of the camera housing, where it will be most exposed to rain.

But DONT seal up the hinged door because you will occasionally need to maintain the camera, and you don't want to have to prise it open with a chisel!

Mounting Outside

Mount the camera somewhere with a good view of the sky and without too many 'terrestrial' obstructions such as trees, hills and buildings. Take special care to angle well away from security lights. These lights emit infrared and without the IR Block filter, the IMX cameras are extremely sensitive to this.

When locating the camera, bear in mind that you will need to be able to get to the camera to maintain it. The cameras do not need to be high up as long as they have a good view of the sky. Mine are at eye-level on my observatory shed.

As before, don't worry if its not practical to eliminate all obstructions as you can mask off any that can't be avoided.

Aiming the Camera

Aiming the Camera

The cameras have a field of about 40-45 degrees vertically and 90 degrees horizontally so angle the camera upwards at between 35-45 degrees. This should maximise meteor detection.

If you can arrange so that the camera view overlaps with other RMS users, thats even better. Check with the network to get an idea of a good direction.

In this photo, the camera is aimed up at about 40 degrees, just above the top of the hill behind the camera location. The parts of the hill that are visible will be masked off in the software to avoid 'meteor-wrongs' due to dog-walkers with head torches!

Thats it!

Once the camera is installed, connect up the PoE adapter, attach a long network cable and run it to wherever you are going to keep the Raspberry Pi. Remember to ask permission before drilling holes in the walls... :)


Now install the Software

Now you can finish configuring the Raspberry Pi by installing a prebuilt image. This is covered in a separate guide here.