You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two LEDs mounted on the front of the PCB. I'm guessing that they're connected to Pin 20 from the Pixart datasheet. I didn't see any other mention.
Looks like it's an open-drain pin capable of sinking the current requirements of the LEDs- our schematics show the LEDs connected to 3.3v via a 150R current-limiting resistor and then directly to the LED_N pin in parallel.
I've been using this sensor with an Arduino. To get the LEDs to turn on I needed to add the following to the initRegisters routine in the PMW2901 library: delay(200); registerWrite(0x7f, 0x14); registerWrite(0x6f, 0x1c); registerWrite(0x7f, 0x00);
you may need to do something similar in the python library
On Mon, 24 Feb 2020 at 14:23, DigitalSamU ***@***.***> wrote:
I've been using this sensor with an Arduino. To get the LEDs to turn on I
needed to add the following to the initRegisters routine in the PMW2901
library:
delay(200);
registerWrite(0x7f, 0x14);
registerWrite(0x6f, 0x1c);
registerWrite(0x7f, 0x00);
you may need to do something similar in the python library
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4?email_source=notifications&email_token=AAPTNBDAJHUNGQ5QJVVRN5LREPJ5VA5CNFSM4JSLIJ6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMX62CI#issuecomment-590343433>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPTNBC52DW4TBYG6HKCOMDREPJ5VANCNFSM4JSLIJ6A>
.
I should probably mirror this functionality in the Python library. Does the above work to give the user manual control over the PMW3901 LEDs @dave-hillier?
I should probably mirror this functionality in the Python library. Does the above work to give the user manual control over the PMW3901 LEDs @dave-hillier?
No, but I was thinking of creating a separate routine that set them on/off in the library, rather than including it in the initRegisters routine. Unfortunately the registers are kept secret by the manufacturer so it's very much trial and error.
Unfortunately the registers are kept secret by the manufacturer so it's very much trial and error.
You're not wrong, the amount of cloak and dagger "write these values to these registers we wont tell you what they are/mean" with this chip is absurd.
For example, enabling Raw Frame Grab mode (mentioned here #5) takes about 11 successive, minimally documented register writes. And that's to say nothing of the init sequence.
I had a special scenario where I just wanted to measure short bursts then pause thus the LED does not have to be on all the time. I added this function to Bitcraze_PMW3901.cpp
void Bitcraze_PMW3901::setLed(bool state)
{
if(state){
// trying to switch on the LED
delay(200);
registerWrite(0x7f, 0x14);
registerWrite(0x6f, 0x1c); // DEC 28
registerWrite(0x7f, 0x00);
}else{
// trying to switch off the LED
delay(200);
registerWrite(0x7f, 0x14);
registerWrite(0x6f, 0x00);
registerWrite(0x7f, 0x00);
}
}
What a pity that there seems to be no details about all the registers available. I have the feeling that this chip has a lot more features like Low Light mode.
@MartinSpengler does the "switch off" command return control of the LED to the PMW3901 for normal operation, or does it disable/turn off the LED completely?
The state of the datasheet for this part makes me outright angry, I can't fathom what dark secret they're trying to protect by being so obtuse but they're basically sticking a big "HA! No, you don't get to play in our garden" sign right at the big end to their customer conversion funnel.
@Gadgetoid I had to reverse engineer this in a way. Only thing I know is the LED are off after calling registerWrite(0x6f, 0x00);.
Do you think there is a mode where PMW3901 controls the LED by itself, like switching it on in low light conditions or so?
Given the fact that switching it on is done by sending a DEC 28 its possible that the brightness could also be controlled.
Activity
Gadgetoid commentedon Nov 28, 2019
As far as I'm aware, the LEDs are entirely under the control of the flow sensor. Looking over the datasheet doesn't seem to indicate otherwise.
dave-hillier commentedon Nov 28, 2019
https://datasheetspdf.com/pdf-file/1309999/PixArt/PMW3901MB-TXQT/1
There is no appendix B 🤷♂️
Any ideas? not sure how they're even connected to the chip - that is actually an input
Gadgetoid commentedon Dec 18, 2019
Looks like it's an open-drain pin capable of sinking the current requirements of the LEDs- our schematics show the LEDs connected to 3.3v via a 150R current-limiting resistor and then directly to the LED_N pin in parallel.
DigitalSamU commentedon Feb 24, 2020
I've been using this sensor with an Arduino. To get the LEDs to turn on I needed to add the following to the initRegisters routine in the PMW2901 library:
delay(200);registerWrite(0x7f, 0x14);registerWrite(0x6f, 0x1c);registerWrite(0x7f, 0x00);you may need to do something similar in the python library
dave-hillier commentedon Feb 24, 2020
Gadgetoid commentedon Feb 25, 2020
I should probably mirror this functionality in the Python library. Does the above work to give the user manual control over the PMW3901 LEDs @dave-hillier?
dave-hillier commentedon Feb 25, 2020
I havent had chance to test it sorry! I parked my project after a recent house move
DigitalSamU commentedon Feb 25, 2020
No, but I was thinking of creating a separate routine that set them on/off in the library, rather than including it in the initRegisters routine. Unfortunately the registers are kept secret by the manufacturer so it's very much trial and error.
Gadgetoid commentedon Mar 16, 2020
You're not wrong, the amount of cloak and dagger "write these values to these registers we wont tell you what they are/mean" with this chip is absurd.
For example, enabling Raw Frame Grab mode (mentioned here #5) takes about 11 successive, minimally documented register writes. And that's to say nothing of the init sequence.
MartinSpengler commentedon Nov 2, 2020
I had a special scenario where I just wanted to measure short bursts then pause thus the LED does not have to be on all the time. I added this function to Bitcraze_PMW3901.cpp
What a pity that there seems to be no details about all the registers available. I have the feeling that this chip has a lot more features like Low Light mode.
Gadgetoid commentedon Nov 2, 2020
@MartinSpengler does the "switch off" command return control of the LED to the PMW3901 for normal operation, or does it disable/turn off the LED completely?
The state of the datasheet for this part makes me outright angry, I can't fathom what dark secret they're trying to protect by being so obtuse but they're basically sticking a big "HA! No, you don't get to play in our garden" sign right at the big end to their customer conversion funnel.
MartinSpengler commentedon Nov 2, 2020
@Gadgetoid I had to reverse engineer this in a way. Only thing I know is the LED are off after calling registerWrite(0x6f, 0x00);.
Do you think there is a mode where PMW3901 controls the LED by itself, like switching it on in low light conditions or so?
Given the fact that switching it on is done by sending a DEC 28 its possible that the brightness could also be controlled.
dave-hillier commentedon Oct 8, 2021
Closing since my PR was merged and solved my problem. There's been no further comment
bablokb commentedon Dec 3, 2024
See https://forums.pimoroni.com/t/control-white-leds-on-paa5100je/26694/3
That post has working code for a
set_illumination()method.