Go to advanced search

by Wangmaster
Mon Mar 02, 2020 12:38 am
Forum: Beginners
Topic: Current flow in bi-directional level shifter?
Replies: 4
Views: 287

Re: Current flow in bi-directional level shifter?

The MOSFET in the level shifter includes a built-in diode which will conduct whenever the Pi side (normally 3.3V) of either signal is more positive than the Arduino side (normally 5V). So a current can flow into the Arduino's I/O pins, and then through its protection circuitry to its power supply w...
by Wangmaster
Fri Feb 28, 2020 7:52 am
Forum: Beginners
Topic: Current flow in bi-directional level shifter?
Replies: 4
Views: 287

Current flow in bi-directional level shifter?

I'm using a bi-directional level shifter to enable serial communication between my Pi3 and an Arduino Uno board (Link to level shifter details:https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide) through the GPIO pins. My pin connection is exactly like the image be...
by Wangmaster
Thu Jan 23, 2020 5:47 am
Forum: Camera board
Topic: Image brightness drops over time
Replies: 5
Views: 628

Re: Image brightness drops over time

I realized I'm having the same problem as in the link below: https://raspberrypi.stackexchange.com/questions/82684/picamera-v2-1-exposure-cant-be-locked-python-picamera-1-13 A bug in the Picamera module results in camera.exposure_speed constantly decaying over captures despite exposure_mode being "o...
by Wangmaster
Thu Jan 23, 2020 2:30 am
Forum: Camera board
Topic: Image brightness drops over time
Replies: 5
Views: 628

Re: Image brightness drops over time

Thanks 6by9, I checked the jpg metadata and there was indeed a drop in exposure corresponding to the dip I observed. Analog gains were fine. Previously I followed the following line in the documentation, it may have caused the problem: camera.shutter_speed = camera.exposure_speed camera.exposure_mod...
by Wangmaster
Wed Jan 22, 2020 2:03 pm
Forum: Camera board
Topic: Image brightness drops over time
Replies: 5
Views: 628

Re: Image brightness drops over time

Thanks for your reply! Note that im currently running a few diagnostics tests to narrow down the problem, by changing the capture rate etc like you suggested. I posted here hoping its caused by something obvious i missed out, but sounds like it isnt... - The RGB was taken whole-image average, but it...
by Wangmaster
Wed Jan 22, 2020 9:43 am
Forum: Camera board
Topic: Image brightness drops over time
Replies: 5
Views: 628

Image brightness drops over time

Hi all, I'm having problems with my PiCamera being unable to take consistent timelapse images. I'm using a V1 Pi Camera to take a timelapse of fluorescence occurring in a well plate. You can see an example of such an image below. I need the images to remain as consistent as possible to detect small ...
by Wangmaster
Wed Dec 11, 2019 4:05 am
Forum: Python
Topic: signal.pause() cannot detect SIGINT
Replies: 3
Views: 281

Re: signal.pause() cannot detect SIGINT

Both programs seem fine. Are you running inside IDLE, or some other integrated development environment? IDLE does not allocate a terminal (presumably because that would not be portable to Windows). So, instead of Linux signalling your process as soon as you press Ctrl+C, you have to wait until the ...
by Wangmaster
Tue Dec 10, 2019 5:47 am
Forum: Python
Topic: signal.pause() cannot detect SIGINT
Replies: 3
Views: 281

signal.pause() cannot detect SIGINT

I'm following a stackoverflow answer (https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python) and I'm trying to run the following simple code to trigger a signal handler on pressing ctrl-c: import signal import sys def signal_handler(sig, frame): print('You pressed Ctrl+C!') s...
by Wangmaster
Mon Dec 09, 2019 7:09 am
Forum: Beginners
Topic: How can I safely feed a GPIO input by a GPIO output?
Replies: 7
Views: 285

Re: How can I safely feed a GPIO input by a GPIO output?

To confirm I get it correctly, did you mean that when the pin is set to input, the resistance (high impedance) of the input pin is even much higher than that 1000 ohms resistor, so the input pin can almost take all the 3.3V from the output pin? Yes, it tends to be significantly higher for IN pins, ...
by Wangmaster
Mon Dec 09, 2019 6:32 am
Forum: Beginners
Topic: How can I safely feed a GPIO input by a GPIO output?
Replies: 7
Views: 285

Re: How can I safely feed a GPIO input by a GPIO output?

I think your confusion comes from assuming the IN pin is at 0V, which is why you think there is a huge voltage drop across the resistor. In reality, the IN pin closely follows whatever voltage it is connected to it, due to the high impedance of the IN pin. This is why when the IN pin is connected to...
by Wangmaster
Mon Dec 09, 2019 3:00 am
Forum: Beginners
Topic: Connecting 5V pullup to Pi GPIO
Replies: 39
Views: 2033

Re: Connecting 5V pullup to Pi GPIO

Thanks for the replies all. I actually tried it out and Pi successfully transmitted without sustaining any (immediate) damage. In any case I will switching to a more reliable method of communication, maybe serial. I think you've misunderstood some of the details of input pins. The 100 MΩ resistor yo...
by Wangmaster
Fri Dec 06, 2019 3:16 am
Forum: Beginners
Topic: Connecting 5V pullup to Pi GPIO
Replies: 39
Views: 2033

Connecting 5V pullup to Pi GPIO

I want to use a GPIO pin on my Pi to send a simple on/off signal to my Arduino board. My approach would be to connect the GPIO to an Arduino analog pin (to get around the 3.3V max of the Pi GPIO) pulled high, and signal it by setting the GPIO as required. I heard many warnings that connecting 5V dir...
by Wangmaster
Fri Nov 29, 2019 7:46 am
Forum: Python
Topic: Multitasking in Python
Replies: 17
Views: 1107

Re: Multitasking in Python

Thanks for the replies all. I think like what paddyg mentioned I probably need some form of "closed loop" timer to get the least drift over time. Its probably impossible to get zero drift purely through sleep() or timer(). I've tested out the following code which seems to meet my requirements: from ...
by Wangmaster
Thu Nov 28, 2019 1:12 am
Forum: Python
Topic: Multitasking in Python
Replies: 17
Views: 1107

Re: Multitasking in Python

Thanks thagrol, looking at the Python documentation on Timer: The interval the timer will wait before executing its action may not be exactly the same as the interval specified by the user. Am I right to say Timer is still be vulnerable to drift over time? I'm assuming Timer will still be affected b...
by Wangmaster
Wed Nov 27, 2019 2:38 pm
Forum: Python
Topic: Multitasking in Python
Replies: 17
Views: 1107

Re: Multitasking in Python

Threading is exactly what I needed, thanks both. Have a look at the threading module (speifically threading.Timer) but read up on the global interpreter lock too. From what I understand, GIL seems to impact only execution speed, not timing accuracy right? Since each of my threads will be sleep()ing ...
by Wangmaster
Wed Nov 27, 2019 7:12 am
Forum: Python
Topic: Multitasking in Python
Replies: 17
Views: 1107

Multitasking in Python

I've recently moved from using the Arduino to the RPi 3 for my prototyping needs, and I'm getting used to working with a computer instead of a uC. On an Arduino, when I want to "multitask" several regularly occurring processes like reading the value of a pin or running a function every x seconds, I ...

Go to advanced search