loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

INFRARED CAM non working Pi NOIR - raspicam problem

Tue Nov 06, 2018 6:34 pm

Hi
I have a camera module v2
with no ir filter and two LED lights attached.
I am trying to run some test for the infrared function using raspivid
unfortunately, when in complete darkness or low lit settings the IR function appears to be OK for 1 sec and then the camera goes back to normal mode and I can't see anything.

I think there might be some setting problem which does not allow the camera to detect the IR signal
could you please help ?

HermannSW
Posts: 830
Joined: Fri Jul 22, 2016 9:09 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 10:01 am

> and two LED lights attached.
>
attached where? The offical v2 camera does not allow to attach LEDs.
What LED lights? You need infrared LEDs.
Take a video of the LEDs during a raspivid test. On smart phone cameras infrared LEDs can be seen as different (visible) color.
After 1s of recording, are the infrared LEDs still on?
NoIR camera recording in total darkness (besides a single 3W infrared LED) works fine for me:
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/fork-raspiraw      https://github.com/Hermann-SW/userland
https://github.com/Hermann-SW/wireless-control-Eachine-E52-drone      https://twitter.com/HermannSW

User avatar
bensimmo
Posts: 3502
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 10:23 am

The official NoIR camera has no 'normal' mode.
It always picks up IR light, in the dark (it grey scale) or light (you see a pink tinge).

If you are talking about a 3rd party camera, a link to it will be needed to see what you are talking about.
I don't think 3rd parties can make the V2 camera though, just the V1.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 10:30 am

If the 3rd party Waveshare cameras with IR LEDs mounted on the side, then they aren't made by Raspberry Pi Trading, and draw far too much current from the Pi 3.3V line up the flexi. It's probably browning out the sensor and causing it to be reset.
In that case complain to Waveshare or your supplier.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 12:10 pm

Thanks for the replies, I made a mistake, my camera module is version 1.

these are the specs
Chip: OV5647
resolution: 5 Megapixel
size: 2952 x 1944
view angle: 75,7°
focal length: 3,6 mm
Sensor: CMOS

given the name of the chip, it could be the "omnivision" chip of the camera module 1, according to this https://raspberrypi.stackexchange.com/q ... ght-1550nm blog post.

this is a datasheet with the specs of the camera
https://cdn-reichelt.de/documents/daten ... _DB-EN.pdf

this is a link to the official documentation. I now confirm, this is the camera module 1
https://www.raspberrypi.org/documentati ... re/camera/
Last edited by loboti on Wed Nov 07, 2018 12:30 pm, edited 1 time in total.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 12:26 pm

Confirmed then that this is a 3rd party camera module, and the bane of my life as they draw far too much power from the 3.3V rail.

Disconnect at least one of the IR LEDs and you will probably find it behaves better.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 12:32 pm

6by9 wrote:
Wed Nov 07, 2018 12:26 pm
Confirmed then that this is a 3rd party camera module, and the bane of my life as they draw far too much power from the 3.3V rail.

Disconnect at least one of the IR LEDs and you will probably find it behaves better.
Well, thanks for the advice, at the moment the problem is the IR sensitivity, not really the power. But I will think about it.
My questions are now the following (to get IR on this camera):
1) is it a software/setting problem ?
2) should I remove some filter from it ?
3) should I get another camera ?

DirkS
Posts: 9524
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 12:38 pm

loboti wrote:
Wed Nov 07, 2018 12:32 pm
6by9 wrote:
Wed Nov 07, 2018 12:26 pm
Confirmed then that this is a 3rd party camera module, and the bane of my life as they draw far too much power from the 3.3V rail.

Disconnect at least one of the IR LEDs and you will probably find it behaves better.
Well, thanks for the advice, at the moment the problem is the IR sensitivity, not really the power. But I will think about it.
My questions are now the following (to get IR on this camera):
1) is it a software/setting problem ?
2) should I remove some filter from it ?
3) should I get another camera ?
4) try @6by9's advice before doing anything else. Takes very little effort and if it does not help then at least you know that's not the problem. (AKA basic troubleshooting)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 1:03 pm

loboti wrote:
Wed Nov 07, 2018 12:32 pm
6by9 wrote:
Wed Nov 07, 2018 12:26 pm
Confirmed then that this is a 3rd party camera module, and the bane of my life as they draw far too much power from the 3.3V rail.

Disconnect at least one of the IR LEDs and you will probably find it behaves better.
Well, thanks for the advice, at the moment the problem is the IR sensitivity, not really the power. But I will think about it.
My questions are now the following (to get IR on this camera):
1) is it a software/setting problem ?
2) should I remove some filter from it ?
3) should I get another camera ?
1) If the sensor browns out and stops sending data then the Pi resets it and starts it streaming again. The timeout is about 1second. Remind me of your symptoms and their timeline again?
2) The Pi knows nothing of the IR leds or their switching, so it's not a software problem.
3) It's a third party camera, so in my role as a Raspberry Pi Trading employee I don't really care. We support the official cameras. Any issues with 3rd party products is the responsibility of the 3rd party to support. Feel free to go and ask them.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 3:56 pm

thanks
I have tried removing one LED
but it does not work.
What I noticed is that if I use raspistill the image looks good, but I can clearly see colors which means it was probably a result of the exposure (5 sec I think)
see here http://s000.tinyupload.com/?file_id=001 ... 5521566995

then I tried the video function
the first frame looks well lit
http://s000.tinyupload.com/?file_id=062 ... 9612568359
a moment later this is how it looks
http://s000.tinyupload.com/?file_id=884 ... 7060876971

The reason - correct me if I am wrong - might just be due to the way raspivid works on camera startup (long exposure), with the other frames of the video being faster and low lit.

However, one thing I have noticed is that in complete darkness the camera starts with a BW image, if I set the night exposure mode it goes dark after the first frame and then it tries to compensate by getting the image a bit more lit. This suggests me that the camera has IR capabilities but is just not used properly. Am I right ?

I know this is a third party camera and I should probably refer to the vendor. I would appreciate any advice in troubleshooting before eventually purchasing an official one. Thanks !
Attachments
frame2.png
frame2.png (241.53 KiB) Viewed 909 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 07, 2018 4:12 pm

Your still has an exposure time of 999.776ms (ie 1sec) with analogue gain of x8 and digital gain of x2.5. That's pretty much maximum on all 3 controls.

You don't give your raspivid command line, but the exposure time can not exceed the frame time (ie 1/frame rate). The default frame rate being 30fps means a max exposure time of 33ms. In which case the sensor can receive 1/30th the photons as in your still so your image will be darker.

Add the -set argument to raspivid and it'll print out the current exposure and gain settings on the console as they change.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
bensimmo
Posts: 3502
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Thu Nov 08, 2018 9:07 am

That is (from your link) known as a WaveShare IR-CUT camera.
Other than the sensor, it is different to the official Raspberry Pi v1 camera.

If there is a light sensor on the camera part itself (not the two on the LEDs) then the IR filter is controlled by that. try altering the little screw potentiometer (variable resistor) to when it removes it.

If it doesn't have that, then the IR filter is controlled by the Camera-LED gpio which means you have to reboot for the 'IR-CUT' (filter in use, filter not in use) to take effect with a disable led command in the config.txt file.
OR you wire up the camera to a different gpio That should be in your camera instructions (if not , see Waveshare link in an earlier post).

Are the LEDs glowing still, just look at them and if they are on they have a slight red glow.
Old phone camera can pick up the IR light much easier though.

User avatar
bensimmo
Posts: 3502
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Thu Nov 08, 2018 9:20 am

That first frame looks like the IR-Filter is removed but is using mostly daylight (white light) to see the image. (IR light may or may not be in use)
Pink tinge..., if it was IR light with the IR filter in place it would be greyscale normally, I could be wrong and that could just be my settings.

That second frame looks like IR-Filter is in place hence blocking the daylight (white light) but you do not have any IR lights in use.
or your LEDs have turned off.


How are you switching the filter in and out of the camera?
-Does it have a light sensor (picture of the camera if you are unsure)
-via a gpio and the gpio pin hole on the camera
-via disable_camera_led=1 in /boot/config.txt

Do the LEDs work ?
Their brightness/time they switch on is set by their one light sensors on each one, again adjustable.
If they work and it's a Pi Zero, it is easy to tell if they are in use. The Pi and Camera will be very warm, to hot ;-)


Anyway, I may have missed it but
Which Raspberry Pi is it.
What power source is it? V and A rating?


Test as mentioned though.
reseat the cables.
remove one LED.

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Fri Nov 09, 2018 4:19 pm

bensimmo wrote:
Thu Nov 08, 2018 9:07 am
That is (from your link) known as a WaveShare IR-CUT camera.
Other than the sensor, it is different to the official Raspberry Pi v1 camera.

If there is a light sensor on the camera part itself (not the two on the LEDs) then the IR filter is controlled by that. try altering the little screw potentiometer (variable resistor) to when it removes it.

If it doesn't have that, then the IR filter is controlled by the Camera-LED gpio which means you have to reboot for the 'IR-CUT' (filter in use, filter not in use) to take effect with a disable led command in the config.txt file.
OR you wire up the camera to a different gpio That should be in your camera instructions (if not , see Waveshare link in an earlier post).

Are the LEDs glowing still, just look at them and if they are on they have a slight red glow.
Old phone camera can pick up the IR light much easier though.
this is the camera I have
https://www.reichelt.de/raspberry-pi-ka ... D_BwE&&r=1

No, there is no light sensor on the camera itself. It seems to me that after the first frame (with higher exposure and "maybe IR" sensitivity) and following a "click" as when the shutter normally opens, the other frames appear (lower exposure).
Not sure if I got it right: should I remove a screw from the camera ? there are no screws on the board except 3 ones holding the base of the lens/objective.
Regarding the LEDs being ON, yes the LED are glowing still from when the raspberry turns on.

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Fri Nov 09, 2018 4:24 pm

bensimmo wrote:
Thu Nov 08, 2018 9:20 am
That first frame looks like the IR-Filter is removed but is using mostly daylight (white light) to see the image. (IR light may or may not be in use)
Pink tinge..., if it was IR light with the IR filter in place it would be greyscale normally, I could be wrong and that could just be my settings.

That second frame looks like IR-Filter is in place hence blocking the daylight (white light) but you do not have any IR lights in use.
or your LEDs have turned off.


How are you switching the filter in and out of the camera?
-Does it have a light sensor (picture of the camera if you are unsure)
-via a gpio and the gpio pin hole on the camera
-via disable_camera_led=1 in /boot/config.txt

Do the LEDs work ?
Their brightness/time they switch on is set by their one light sensors on each one, again adjustable.
If they work and it's a Pi Zero, it is easy to tell if they are in use. The Pi and Camera will be very warm, to hot ;-)


Anyway, I may have missed it but
Which Raspberry Pi is it.
What power source is it? V and A rating?


Test as mentioned though.
reseat the cables.
remove one LED.

I agree on the color part... however I tested it in absolute darkness and the first frame looks BW, I see no colors but a very good IR image (LEDs are ON). however it disappears shortly.
the raspberry is 3B+ powered by the right adaptor (If I remember right is 2.5A and 5V? however I am sure the one I have is the right one)
I reset cables and tried to remove 1 LED but there is no change.
I can't see a light sensor on the camera board... I think the filter switch might be occurring via software/settings... but I do not know where to look at and what to change eventually. I tried to use "Pi Vision" which is a GUI one could use to tweak many of the settings (simulating command lines) but I haven't found a solution (whatever exposure type I choose the problem persists).

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Fri Nov 09, 2018 4:28 pm

6by9 wrote:
Wed Nov 07, 2018 4:12 pm
Your still has an exposure time of 999.776ms (ie 1sec) with analogue gain of x8 and digital gain of x2.5. That's pretty much maximum on all 3 controls.

You don't give your raspivid command line, but the exposure time can not exceed the frame time (ie 1/frame rate). The default frame rate being 30fps means a max exposure time of 33ms. In which case the sensor can receive 1/30th the photons as in your still so your image will be darker.

Add the -set argument to raspivid and it'll print out the current exposure and gain settings on the console as they change.
Yes you are right, however it seems that it is not only an exposure problem but a filter problem: in the first frame, in complete darkness, I can see in BW with the LED mounted and turned ON. Quickly after I can't see a thing even using the "night exposure mode" of raspivid. in non complete darkness however this mode is able to retrieve some exposure and show me something... but is colored and not IR.
My interpretation is the following: the camera has IR sensitivity but this is shut down via software or due to wrong settings once raspivid starts (I guess after the initial "calibration" frame/s). I do not know if I am right or wrong, but this is what I conclude from my tests

User avatar
bensimmo
Posts: 3502
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Fri Nov 09, 2018 4:43 pm

Look at my post above and add the camera_led setting to config.txt
Or follow the Waveshare link for a step by step way to do that.
Reboot and see what happens.

The description say 'autonatic' but I don't know how that camera does it without a light sensor.

It is not a RaspberryPi made camera.
If that doesn't do anything talk to the supplier, as it may be faulty.
They should be able to help you.

loboti
Posts: 8
Joined: Tue Nov 06, 2018 6:29 pm

Re: INFRARED CAM non working Pi NOIR - raspicam problem

Wed Nov 14, 2018 10:51 am

How are you switching the filter in and out of the camera?
-Does it have a light sensor (picture of the camera if you are unsure)
-via a gpio and the gpio pin hole on the camera
-via disable_camera_led=1 in /boot/config.txt
Ok I will try to disable the LED (although intuitively I do not see the point, I am surely ignorant on the subject I will trust you)
for your question about the GPIO... I think the answer is yes, the only thing that connects the camera to the raspberry is the small "bus" cable
plus a pair of black/red cables connecting the camera board to the camera body

I will also try to contact the vendor as you suggested
I will post an update here below

Return to “Camera board”