Giter VIP home page Giter VIP logo

doorlockd-pcb-bbb's Introduction

doorlockd-PCB-BBB

Kicad drawing for doorlockd electronics on a Beagleboard black cape. Preview doorlockd-PCB-BBB Rev0.02

Schema doorlockd-PCB-BBB Rev0.02

component list

Ref Value
C1 C 1uF
C2 C 1uF
C3 CP 470u
D1 LED LED
D2 1N4007 1N4007
D3 LED LED
D4 1N4007 1N4007
J1 Conn_01x02 LED 1
J10 Conn_01x03 Duo LED
J11 Barrel_Jack_Switch Barrel_Jack_Switch
J12 Conn_01x08 RFID RC522
J13 Conn_01x02 Solenoid 12V
J14 Conn_01x02 jumper
J2 Conn_01x02 Button 2
J3 Conn_01x02 LED 2
J4 Conn_01x02 Button 1
J5 Conn_01x02 Buzzer 12V
P8 Conn_02x23_Odd_Even BeagleBone_Black_Header
P9 Conn_02x23_Odd_Even BeagleBone_Black_Header
Q1 Q_NMOS_GDS STU60N3LH5
Q2 Q_NMOS_GDS STU60N3LH5
R1 R Ω LED1
R14 R Ω DuoLED
R15 R Ω DuoLED
R16 R 100
R17 R 2k2
R2 R pull_up
R3 R 220
R4 R Ω LED2
R5 R pull_up
R6 R 220
R7 R 100
R8 R 2k2
U1 TSR_1-2450 TSR_1-2450

LED resistor notes

Choose the resistors based on the LEDs you use.

Led resistors
red 100 ohm
green 60 ohm
yellow 48 ohm
blue 4 ohm

connected IO ports

port chip,line*1 name
IO P8_17 gpiochip0 27 Button1
IO P9_12 gpiochip1 28 Solenoid
IO P9_14 gpiochip1 18 UILED1
IO P8_18 gpiochip2 1 Button2
IO P9_17 gpiochip0 5 RC522_SDA
IO P9_22 gpiochip0 2 RC522_SCK
IO P9_18 gpiochip0 4 RC522_MOSI
IO P9_21 gpiochip0 3 RC522_MISO
IO P9_15 gpiochip1 16 RC522_IRQ
IO P9_23 gpiochip1 17 RC522_RST
IO P8_13 gpiochip0 23 UI_DuoLED1r
IO P8_19 gpiochip0 22 UI_DuoLED1g
IO P9_16 gpiochip1 19 UILED2
IO P8_9 gpiochip2 5 Buzzer

*1): GPIO Chip+line for gpiod, reference taken from https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec

doorlockd-pcb-bbb's People

Contributors

wie-niet avatar

Watchers

James Cloos avatar

Forkers

stahta01

doorlockd-pcb-bbb's Issues

rev 0.01 bugs: wrong pins used.

Some pins are already used by the onboard hardware. to enable these pins you need to disable the onboard harware in /boot/uEnv.txt

To enable UILED1 and 2, and the bicolor LED disable HDMI support:
disable_uboot_overlay_video=1

To enable button1 and 2 , disable internal Flash disk, you need to boot from SDcard:
disable_uboot_overlay_emmc=1

To enable Tricolor LED , disable internal audio:
disable_uboot_overlay_audio=1

Perhaps use other GPIO pins which do not conflict with onboard hardware.

Card reader using RS485

The PN532 reader supports serial, so it would be useful to support RS485 for longer distances. This issue is intended to collect some thoughts.

RS485 needs special transceivers that translate from TTL serial to RS485 and back. RS485 uses a differential signal over a twisted wire pair for a single direction. Easiest would be to have two transceivers at each end (TX and RX) and use two wire pairs for full duplex operation. More economical is to use a single wire pair for both TX and RX for half-duplex operation. Typically, a RS485 transceiver has a "driver enable" (DE) pin to put it into TX mode, so for proper operation transceivers should be in RX mode normally and switch to TX only when sending, and some care must be taken that only one is in TX mode at a time. This is typically done by making a single master in charge and having the slave only speak when spoken to, which seems would be possible using the PN532 protocol.

On the Beaglebone side, the DE pin can be driven directly by the beaglebone. The linux kernel even supports using the RTS handshaking pin for a serial port as a DE pin, meaning it is controlled by the hardware or low-level drivers directly, so the timing is very exact (i.e. DE switches on and off closely around the actual transmission). See https://www.kernel.org/doc/html/latest/driver-api/serial/serial-rs485.html These serial pins (RX/TX/RTS) are assigned to specific pins, see http://beaglebone.cameon.net/home/serial-ports-uart for a table (the rest of that page is outdated, though).

The PN532 does not support driving a DE pin unfortunately, so this would need some additional electronics to implement a DE-autodetection. In practice, this means DE would be asserted whenever the TX signal goes low, and then a timer (RC or 555) is used to keep it low for a little over 8 bit times after the last transmision. This means that the beaglebone must wait for some fixed time after receiving a message before sending a new message, but this should be easy to implement in software.

One challenge is that the PN532 will not wait for a while before replying, so that means the DE on the BBB-side should be disabled very quickly after the end of the transmission (user manual says an ACK follows within 15ms max response time, but does not seem to specify a minimum response time). If the BBB is still in TX mode when the reply starts, it will miss the start bit of the reply and the stream gets out of sync, which probably messes up the entire message (there is a 0x00 preamble byte that could be acceptable to drop, but if you miss the start bit, the next stop bit will look like a start bit and the entire message becomes garbled, hopefully resyncing again in the pause after the message...).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.