FunHouse + IR Break Beam Sensors Not Working
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
FunHouse + IR Break Beam Sensors Not Working
I have tried with two separate sets of sensors and still get "No Mail" showing even when I cover the sensors. I'm using 7x and it appears I have it wired correctly.
- Attachments
-
- funhouse.jpeg (47.36 KiB) Viewed 169 times
- dastels
- Posts: 15828
- Joined: Tue Oct 20, 2015 3:22 pm
Re: FunHouse + IR Break Beam Sensors Not Working
Exactly which break beam sensor product are you using? Product ID or link to product page, please.
Dave
Dave
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
Re: FunHouse + IR Break Beam Sensors Not Working
https://www.adafruit.com/product/2167
I believe these. They were the ones that came in the funhouse box (018? I think)
I believe these. They were the ones that came in the funhouse box (018? I think)
- dastels
- Posts: 15828
- Joined: Tue Oct 20, 2015 3:22 pm
Re: FunHouse + IR Break Beam Sensors Not Working
OK. How do you have them wired up. I mean, what is each wire from the sensor pair connected to?
Dave
Dave
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
Re: FunHouse + IR Break Beam Sensors Not Working
I dont follow? It should hopefully be clear in the picture. They are connected to A0 and A1 using plugs with female ends for the sensor the plug into. It's whatever the kit provided and whatever the guide for the mail detection says
- jerryn
- Posts: 1890
- Joined: Sat Sep 14, 2013 9:05 am
Re: FunHouse + IR Break Beam Sensors Not Working
Just an observation, In your picture, I cannot see if the White wire on the IR sensor is actually connected to Pin A0.
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: FunHouse + IR Break Beam Sensors Not Working
The white wire is the output of the sensor. You need to connect it to the FunHouse to read the state of the sensor.
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
Re: FunHouse + IR Break Beam Sensors Not Working
Op I misread the guide. It says ONE white wire will remain unused. I'm an idiot. Sorry and thank you
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
Re: FunHouse + IR Break Beam Sensors Not Working
Actually, that didnt fix it
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: FunHouse + IR Break Beam Sensors Not Working
Please post some photos that clearly show all of your connections. And also please post the code that you are using.
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
Re: FunHouse + IR Break Beam Sensors Not Working
The one with white connected goes to A0
The other goes to A1
The other goes to A1
Code: Select all
# SPDX-FileCopyrightText: Copyright (c) 2021 John Park for Adafruit
#
# SPDX-License-Identifier: MIT
# FunHouse Mail Slot Detector
import board
from adafruit_debouncer import Debouncer
from digitalio import DigitalInOut, Pull
from adafruit_funhouse import FunHouse
beam_sense_pin = DigitalInOut(board.A0) # defaults to input
beam_sense_pin.pull = Pull.UP # turn on internal pull-up resistor
beam_sensor = Debouncer(beam_sense_pin)
AMBER = 0xF0D000
BLUE = 0x00D0F0
RED = 0xFF0000
WHITE = 0xFFFFFF
GRAY = 0x606060
funhouse = FunHouse(default_bg=None, scale=3)
funhouse.peripherals.dotstars.brightness = 0.05
funhouse.peripherals.dotstars.fill(AMBER)
# Create the labels
funhouse.display.show(None)
mail_label = funhouse.add_text(
text="No Mail yet", text_position=(4, 14), text_color=AMBER
)
reset_label = funhouse.add_text(text="reset", text_position=(3, 70), text_color=GRAY)
funhouse.display.show(funhouse.splash)
def send_io_data(mail_value):
funhouse.peripherals.led = True
funhouse.network.push_to_io("mail", mail_value)
funhouse.peripherals.led = False
send_io_data(1)
while True:
beam_sensor.update()
if beam_sensor.fell:
print("Mail is here!")
funhouse.peripherals.set_dotstars(RED, WHITE, BLUE, WHITE, RED)
funhouse.peripherals.play_tone(2000, 0.25)
funhouse.set_text("Mail is here!", mail_label)
funhouse.set_text_color(BLUE, mail_label)
send_io_data(0)
if funhouse.peripherals.button_down:
print("Mail is not here!")
funhouse.peripherals.dotstars.fill(AMBER)
funhouse.set_text("No Mail yet", mail_label)
funhouse.set_text_color(AMBER, mail_label)
send_io_data(1)
- Attachments
-
- funhouse.jpeg (49.99 KiB) Viewed 120 times
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: FunHouse + IR Break Beam Sensors Not Working
Please post some photos that clearly show ALL of your connections - end to end.
- jammininmypjs
- Posts: 40
- Joined: Wed Oct 21, 2020 10:42 pm
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: FunHouse + IR Break Beam Sensors Not Working
OK. So now you need to mount the sensors so that the emitter is facing the detector part of the sensor. The emitter is the source of the beam and the detector needs to be in a position where it can detect that beam.
The sensor works by detecting when the beam is broken. You can't break the beam if there isn't a beam to break.
The sensor works by detecting when the beam is broken. You can't break the beam if there isn't a beam to break.
Please be positive and constructive with your questions and comments.