Guilherme GM
Posts: 10
Joined: Wed Dec 23, 2015 3:34 pm

Help with YwRobot 545043

Fri Jan 29, 2016 10:50 pm

Hi,

I'm trying to use an infrared sensor connected to the YwRobot as power supply but I'm getting always 1's when reading the sensor.

And when I connect the ground and 5v pins direct on raspi it works correctly.

What m'I doing wrong? =(

Thank you!

The test code:

Code: Select all

import time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)

PINO = 12

GPIO.setup(PINO, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
  print GPIO.input(PINO)
  time.sleep(0.1)
Image

Image

Image

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Help with YwRobot 545043

Fri Jan 29, 2016 10:54 pm

You need to connect the GNDs, otherwise your single wire is floating.

Return to “Beginners”