As a general rule, a voltage divider such as you have drawn appears as a source of voltage V0 in series with a resistance R0 such that:Pijus_magnificus wrote: I think I will keep the first circuit, that I hope is safe enough
Thanks for the answers again
Yes level shifting is generally overkill!Metatronin wrote:So any 5v signal to the GPIO's need just a 1k resistor...is level shifting overkill(like in attached pic)?
Code: Select all
#!/usr/bin/env python from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(7, GPIO.IN) while 1: print GPIO.input(7) if GPIO.input(7): print "BUTTON PRESSED" sleep(0.2)
Thof, did you ever resolve this? I've got the same issue. When I run my DS18B20 temp sensor through the voltage divider, I get no input to the Pi...thof wrote:Hi all,
I have a question in line with this one. I want to use a 5V PIR sensor on a GPIO pin... so the output of the PIR is a 5V pulse.
I tried connecting a 10k resistor in line with the output and connect this to the GPIO. This works, but I feel it is not the safest way to deliver this input to the Raspberry.
From this topic I tried applying a 2k2 and 3k3 voltage divider, but now the Raspberry does not see the input.
Thinking the output might be too low I also tried a 10k and 20k voltage divider, but no luck either.
Any thought how I can safely use the 5v input?
edit: this is the sensor circuit I'm talking about, maybe it helps to understand how to connect it: http://www.produktinfo.conrad.com/daten ... 12V_FG.pdf
Neitsabes wrote:I would like to connecte arduino MEGA to my raspberry using SPI interface. Could i use the kind of diviser discribe above ?
And if yes, on wich pin i have to connect it : MISO, CC and CLK is enough or i have to put it on MOSI too ?
The master will be the raspberry and slave arduino.
Thanks for your answer,
Users browsing this forum: No registered users and 6 guests