Raspberry Pi Advice - HID and Motion Sensor

  1. last year

    Brock N

    29 Nov 2018 Pre-Release Testers, Xojo Pro

    I'm looking into trying to build my first RaspberryPi hardware solution and just wanted to get some advice before I purchase everything. Feedback on what hardware to get would be especially helpful.

    GENERAL DETAILS:
    Our new office building is under construction and we have 3 slides going into the building (3rd to 2nd, 3rd to 1st, and 2nd to 1st).
    Employees have access throughout the building using HID Cards

    CONCEPT:
    I want people to be able to scan their HID Card at the top of the slide (or for guests simply press a button instead) and then have the slide track their time from top to bottom. After they get out of the slide they should be able to see stats like:
    • Slide A done in 10.5 Seconds!
    • Your Best time of the day!
    • Your 5th best time ever!
    • 3rd Best time of the day out of everyone!
    • 50th Best time ever!
    As well as some overall stack rankings etc...

    HARDWARE:
    RaspberryPi(s)
    HID Reader (3x)
    Push Button (3x)
    Red LED Light (3x)
    Green LED Light (3x)
    MotionSensor (6x)

    SETUP:
    HID Reader at the top of the slides
    Each Slide has a red and green led light above their entrance with a motion sensor at the start and the finish

    IMPLEMENTATION:

    1. The user either scans their HID or they push a button at the top of the slide they wish to ride.
    2. The green light turns on
    3. The user triggers the motion sensor at the top of the slide
    4. The green light turns off and the red light turns
    5. The user triggers the motion sensor at the bottom of the slide
    6. The red light turns off
    7. The display is updated with the latest stats

    QUESTIONS:
    What RaspberryPi's should I get? Is the built in GPIO board enough or do I need to purchase something for that?
    Is it cheaper/easier to do separate red and green lights or is there an LED that I can just set the color I want it to be?
    Is there any complications with reader the HID data into XOJO, I can resolve from a database what user it should be. What is a compatible HID Reader?
    What kind of push button hardware to use?
    What kind of motion sensor to use and what should it be based off of? (Heat, motion, laser)
    How many RaspberryPi's do I need? How far can I do the wiring? Can I wire the entire system using one RaspberryPi or should I do one on each floor of the building to reduce wiring distance and have them communicate through the network to a central application?
    Is the HID too complicated and I should do like a pin pad instead?
    Anything else I'm missing or could either simplify or improve?

    Curious to hear what you all think. All input is welcome. Thanks in advance!

  2. James D

    29 Nov 2018 Pre-Release Testers, Xojo Pro Europe (Switzerland)

    The only thing I can offer is a failed experience of card reading with a PI. When someone walks up to a card reader and presents their card they expect an immediate response, sometimes this did not happen because the PI was doing something else at the time. The delay was almost negligible, but long enough for the user to have pulled away the card without it having been read.

    In the end we went with two Arduinos in each station - one to read the cards and the other to accumulate the data and send it back the command tent via SMS. The stations were spread out over a 5K area, so free local SMS was the best option.

    Instead of wiring everything up you might want to look at WIFI or Radio.

  3. Mark C

    29 Nov 2018 Pre-Release Testers, Xojo Pro Spain 03170

    I would like offer a similar experience to James with regard to the Pi.
    While the Pi is a capable and widely used device it has some serious disadvantages for many applications where a more modest micro controller based project is going to be far more 'user friendly'.
    the Pi is limited by the OS quite seriously when it comes to time based projects.
    it simply can not be relied upon to be consistent in operation for SOME uses.
    it is very useful as a quick development device to prove a logical process, BUT may be unfriendly when put into operation with the great Joe public.
    I have a current project that I have a simulator running in the iMac and it works perfectly.
    in the Pi it is a dog as the system is always busy doing other stuff which stops it responding as expected.
    my solution to this, for this project, is to make it read only and disable all network based events, which is fine to run the application but a nightmare for developing and updating.

    the Pi has some great uses, and it will always have a place where it excels, but it is by no meant the panacea to solve all.

    This 'quick' project undertaken at the behest of my customer is now going well beyond the time I offered as an estimation for a bespoke PIC base solution as the customer believed the Pi hype and had zero understanding that more computing power is not necessarily better, like 'upgrading' an OS, mmmmm win8 anyone?

    to answer your question:-

    'which Pi should I get'
    this depends on a couple of things, if you want immediate response to the card and give the user an experience they might expect(quick and unhindered) then the answer is none, use another device.
    if you want to develop the logic and process then get the Pi3+ as it is the fastest available and has WiFi plus Bluetooth onboard.
    the downside is that it is VERY power hungry and gets very hot even in standby, it requires at least a 2 Amp supply with short cables.

    from your post:-

    QUESTIONS:

    "Is it cheaper/easier to do separate red and green lights or is there an LED that I can just set the colour I want it to be?"
    use an RGB led which can be PWM modulated to give any colour, or each of the three led in the device can be switched on and off to produce a number of discrete colours which would likely give you more possibilities than you might need in this project.

    "Is there any complications with reader the HID data into XOJO, I can resolve from a database what user it should be. What is a compatible HID Reader?"
    I would look at a device that produces a serial output that can be connected to any control device, Pi or bespoke hardware, if its serial then Xojo will have no issue at all dealing with the data using the 'Serial' class, this is something I use extensively in most of my commercial projects similar to the one you are outlining.

    "What kind of push button hardware to use?"
    that question is too wide ranging to answer, there are millions of buttons in all suppliers that might work, it all depends on the actual use.

    What kind of motion sensor to use and what should it be based off of? (Heat, motion, laser)
    a slide, do you actually mean a slide like a child uses? if so I would suspect a light beam (infra red, laser....) which is broken as the usr moves past a certain point, would likely give a good amount of reliability and easily available.

    "How many RaspberryPi's do I need? How far can I do the wiring? Can I wire the entire system using one RaspberryPi or should I do one on each floor of the building to reduce wiring distance and have them communicate through the network to a central application?"
    I am not sure from this question if you might be able to develop this project without some help from someone who has experience in similar projects (without wishing to offend in any way!), if the intention is to have a number of units which connect to a central system then they would need some form of multi drop communications (with a Pi or other processor unit at each access point), wired would be ethernet, or for a simple and inexpensive bespoke system, RS485, WiFi is also another method, but less reliable possibly.

    "Is the HID too complicated and I should do like a pin pad instead?"
    personally I would start with a simple solution, keypad entry, develop the project structure in separate modules (keypad, display, communication method, central data collection etc) which can all be designed and tested entirely separately before bringing them all together, then add something like a card reader when all else has been seen to work fine.

    "Anything else I'm missing or could either simplify or improve?"
    if someone keeps coming last then you might have an automatic opening pit at the end of the slide which drops them into a pool of slime, although I am not sure how legally you might justify what is a perfectly good idea!

    the project sounds great fun and I hope you get it all implemented!

  4. Ivan T

    29 Nov 2018 Pre-Release Testers

    @James D the PI was doing something else at the time

    @Mark C in the Pi it is a dog as the system is always busy doing other stuff which stops it responding as expected.

    Of course it is not reliable if you try to emulate a hardware protocol (like Wiegand) using software. But.

    Actually the Pi3+ is a QUAD core and can handle very well a LOT of things, I have actually an app reading a card, showing the info of the user and even a picture on screen, updating a local database, sending the info to a remote server, sending the info to a remote database, controlling some external devices with relays and also some leds on the GPIO. All at the same time and in real time. It just need to use all the cores, as Xojo SUCKS in real multithreading, you have to use "helper apps" for that.

    As fot the implementation, to make it easier, why not use a Pi3+ with an official touchscreen, make a GUI with the keypad, Green light, Red lights and Push Button on screen.

    As for motion, for the distance you cant use the GPIO, you need a separate circuit, maybe a PIR with an arduino and a conection with RS-485 and a RS-485/USB in the Rasp

  5. Mark C

    30 Nov 2018 Pre-Release Testers, Xojo Pro Spain 03170

    Hi Pedro,
    Use of helper apps is always good for multitasking, unless the operation undertaken is on a single thread, which for me is the issue, it is only animating the screen with moving areas that simulate the action of a rotary encoder, not very sophisticated code or needed to operate all that quickly, but it is not great to look at,
    having tried several methods I am in the process of ignoring it and getting the rest of the code working!.

    the idea of the touch screen is good and would make a modern UI, I found the Pi official screen very nice, but a bit expensive.

  6. Ivan T

    1 Dec 2018 Pre-Release Testers

    @Mark C Use of helper apps is always good for multitasking, unless the operation undertaken is on a single thread,

    Never underestimate Multicore operation, in my case, I use one app just for the GUI, and other for all the processing (just 2 apps/cores) For the GUI, I use a full screen window with just 1 canvas, use cache graphics and only redraw the area that is needed.

    @Mark C but a bit expensive.

    That is relative, consider the fact that you can save in another I/O hardware and create way better user experience.

or Sign Up to reply!