• Event inputs

    Sean4 hours ago 0 comments

    I've been pursuing the python path for reading input events directly. Initially, this seemed like a dead end as cat wasn't giving any output for my ir devices. However, I found a suggestion to enable the nec driver on the devices. Mine only had lirc enabled, and I'm going to use the nec protocol for my Blaster. So I enabled nec on both my devices and suddenly the cat /dev/input/... worked for both devices! This bodes very well for pulling device input into python using evdev.

    Next steps are reading inputs with evdev and making a script that can monitor multiple event devices simultaneously. Then I need to use that to trigger the light changes.

  • MQTT?

    Sean3 days ago 0 comments

    Rather than using 4 sensors on one pi, I might be forced into using one sensor per board. This means I would need 4 more dev boards of some sort. What can I do to make this fancier and more elegant? Use ESP8266 boards and set up a MQTT server on my pi! Each ESP would publish messages to the server and the server could, presumably, run python scripts or somehow trigger inputs to a persistent python script when messages are received. It would also give me a fancy user interface. I've never used ESP boards before but they look amazing. It kind of makes me want to do the whole project as a single MQTT connected network so I could trigger everything from my phone as an alternative. I'll save that for future projects though. Part of my goal here was to use a many parts as possible that I already have. That means lots of arduino. 

  • Lirc vs ir-keytable

    Sean7 days ago 0 comments

    Running multiple IR receivers on a single raspberry pi is not particularly difficult. Adding another dtoverlay to the config.txt works just fine and the lirc documentation explains how to add the second device. My issue is that I need the same command to map to a different keypress depending on which device picks it up. This is not an expected use of the software, so it isn't easy to do and it isn't documented. 

    As far as I can tell, lirc does not allow different mapping for each device. I think ir-keytable might, but it's lacking in documentation. I'm hoping that I can use ir-keytable to convert received signals to keypresses, then use lirc to turn those keypress into keyboard button presses. This will take some experimentation and might not even work. 

  • Relay Controlled hot air (Dragon)

    Sean7 days ago 0 comments

    Not much to say here. It's exactly the same as the blacklight, just with a slightly different relay and different load. I'll be getting a 120V compatible relay with standard plugs that I can plug either a hair dryer or heat gun into. 

  • Mobile

    Sean10/13/2021 at 21:45 0 comments

    A mobile with themed paper cutouts will spin when triggered by IR. The motor will be a brushless motor, geared down and powered by a lipo. The brushless esc/bec will interface with and power an arduino. From a code perspective this is identical to the servo one. 

    Next steps are to build it. 

  • Secret Door

    Sean10/13/2021 at 21:41 0 comments

    This creation will use a fake wall to create a room under my stairs. The door to this room will be hidden, and open/close by way of a motor when the IR signal is received.

    This is still in the planning stages. An arduino will reciever the IR signal and trigger a brushless motor to drive using the servo library to control the esc. A four bar mechanism will drive the door back and forth through 90 degrees of rotation for each full rotation of the drive gear. The drive gear will be 3d printed with bumps on one side, offset 90 degrees from the connection point for the drive rod. When one of these bumps triggers a limit switch, the motor will be stopped and the door will be in the fully opened or fully closed state. 

    The motor will be geared down heavily since the motor I have are all designed for high speeds and low torque. Gearing will be accomplished with lego gears that I have hanging around already. 

  • IR controlled smart lights

    Sean10/13/2021 at 21:32 0 comments

    This is my pet project within the larger project. The goal is to have the house crest of each HP house hanging on a wall. When one of them is blasted with IR, the smart lights on either side of the wall will change to the house colors of that house. I previously created a python script to change the smart lights when buttons were pushed. It will be fairly simple to modify that code for this purpose. The hard part will be getting separate inputs from 4 different IR receivers on one pi. I could use a separate pi or arduino for each receiver, but then I'd have to buy more components. It's also incredibly inelegant. It has to be 4 sensors on one pi.

    Lirc should be able to read from 4 sensors individually. The challenge here will be getting the same signal to be interpreted differently based on which sensor it comes from. My current plan is to attempt to use lircrc files with irexec to interpret the reciever signals as keyboard button presses. These could be read by the python script to trigger lighting changes. However, I'm still working on this. It might not be possible. An alternative may be to read from the IR receivers directly in the python script. That will take more time and is only a backup plan at this point. I'm also looking into using ir-keytable if lirc isn't up to the task. 

    So far, I can translate an IR input to a remote keypress with the .lirc.conf file, then convert that to a keyboard keypress by using the lircrc file to call xdotool by way of irexec.

    I'm still heavily in the learning and tinkering phase on this one. It's my main focus currently. 

  • IR Triggered Sound Effects

    Sean10/13/2021 at 21:16 0 comments

    Playing sound effects on an arduino is a huge pain. Playing sound from a raspberry pi is much easier. Receiving IR commands on a Pi takes a bit of work though. 

    For this part, I'm using lirc. I started with a clean install of the latest pi OS. I installed lirc, configured it for the default driver, and set the config.txt to read from the proper gpio pin. Then I tried to run irrecord. It failed. Over and over. So I found a config file for a similar remote and it worked just fine. I made a lircrc file with just one entry that will use irexec launch omxplayer when it gets the signal. That's it. When I push the remote button, the sound plays. 

    Next steps for this will involve not much really. Packaging I guess. 

  • IR triggered servo

    Sean10/13/2021 at 21:08 0 comments

    So far, this creation is just a variation of the code used for the relay. Instead of writing a pin high, I used the servo library to write the servo position to 180 for a few seconds, then back to zero.

    The servo will open a hidden drawer in one of the decorations. Next steps for this are making a test version of the drawer. 

  • IR Triggered Blacklight (Basilisk)

    Sean10/13/2021 at 21:02 0 comments

    The first responsive creation I started on was the IR triggered blacklight. This has two basic parts: a gutted blacklight flashlight, and an arduino that triggers a relay when the correct IR signal is detected. 

    The arduino uses a 3 pin IR sensor which is easily read with the arduino IRRemote library. I used the simplereceiver sample sketch as a starting point, changed the received command to match my Blaster, and write pin 11 low for a few seconds when the command is received. My relay can trigger on either high or low. I found that I couldn't pull enough current to trigger it high, so I use a low trigger. 

    The IR receiving is working flawlessly and triggering the relay as expected. The flashlight is wired to trigger from the relay. The flashlight runs on 3 AAA batteries, so I'm running it off the 5V output from my arduino. It pulls about 120mA max, which is too much to power it off an io pin. However, with the relay and 5V line it should be no problem. Yes, I could have used a transistor instead. Relays are more fun though. I'm a mechanical engineer, not electrical. The flashlight is lighting from the relay as planned. There's no more work on this part until I get to the creation of the decorations.