Labels

Showing posts with label RPi Project. Show all posts
Showing posts with label RPi Project. Show all posts

Tuesday, August 14, 2018

HomeLink HA Interface #2 - Experiments with the LiftMaster 850LM

So I decided to go ahead and test out the LiftMaster 850LM to see what I was up against. This device will become central to how I am going to interface my home automation system to my car.  I have always been a little upset that there were no interface devices to link my car to other than a simple switch or a garage door.  That is shallow thinking on the part of the automotive industry and the people who make garage door devices.  Anyway I digress.

The 850LM is going to be used to detect button clicks from my car and convert those clicks to MQTT messages that will be sent to my home-assistant controller via an MQTT broker. I expect to interface this on a Raspberry Pi Zero W (RPi0W) using its gpio pins.  However, there are a couple of issues that need to be resolved. The gpio pins on the RPi take 3.3v and the lowest voltage DC that the 850LM can handle is 9v.  Fortunately, I noticed previously that the Adafruit bi-directional level shifter can take a high side voltage up to 10vDC.  That means that I can use the level shifter between the 850LM and the RPi0W. The main reason that I want to use the RPi0W for this interface is that I can run the software under a Docker container, and allow for another container to House a Bluetooth proximity sensor / MQTT setup. Note that the RPi0W needs a 5v DC power source, but generates its own 3.3v power for the gpio.

The 850LM has a power port as well as a screw connection marked plus and minus. It has a total of three relay connections; the first two having NO / GND screw terminals and the third having NO / GND / NC screw terminals.  So my first question was how do the power port and power screw terminals relate.  The second question was when the relays switch is it momentary (governed by how long you press the button on the car), is it momentary (fixed close then open time), or is it more of an on / off switch (changes as you click the car button). Fortunately, I should be able to use a remote control to do the testing.

Test 1: I powered up the 850LM using a 5v to 9v usb cable that I had lying around by plugging it into the power port.  I had to use an adapter because the center pin on the power port was thick (white size). Once powered up, I had no problem setting up the remote control by following the 850LM instructions (click yellow button on 850LM, led next to button flashes, click button on remote, led goes out).  Once I did this, a click on the remote caused the relay to close and then open on its own.  So I answered the second question.  It makes sense because most garage door controllers have wall switches that momentarily close a connection which starts the garage door motor running.

Test 2: I then checked the power terminal pins and discovered that there was on voltage in the millivolt range.  This means that I cannot power the 850LM and draw power from these terminals when the 9v supply is plugged into the power connection.

Test 3: while clicking on the remote, I checked the voltage levels appearing between the NO / GND terminals.  This did not measure any change from zero volts.  This means that I will need to use a pull-up resistor for transitioning on the level shifter.  It also means that I will need to deal with negative logic; high showing up on the gpio means False / 0 / not clicked, and low means True / 1 / clicked.  I might end up using interrupts instead of running everything through a loop in order to not interfere with other container programs.

Test 4: I connected my 9v power source to the power screw terminals. I checked the on / off with my remote and everything worked out just fine.  So I will be connecting the 9v source (via a barrel to screw terminal adapter) to these terminals, along with the input side of a Buck converter (to give 5v from the 9v source) and some connection wires to power up the high side of the level shifter.  What I may do instead is put everything on a breadboard connected to the RPi0W gpio and minimize the connections needed (use the breadboard as the connection points for all of it).

I wonder if I can mount the Buck converter on the breadboard as well, that would save some space for me.  I am also concerned that the Buck converter might interfere with the functioning of the RPi, but I will have to test that out as everything is built.

Saturday, January 6, 2018

LED - Light Controller #3 - I always seem to never have enough time to complete projects

As usual, I am here after a long period of time without completion of my project.  During my time away from my little projects, it occurred to me that I might have a problem with the way that I was doing this project. I had a workable solution, bread-boarded part of it and connected the raspberry pi to it, putting a simple python program onto it and exercising the 8-channel relay.  After checking things out, I started putting the elements together and soldering them to a perma-proto board from Adafruit.  Sure enough, when I started soldering the 24 pin chips onto a breadboard I ended up smoking them.  I found myself completely unable to switch the 8-channel relay at this point.

At this point I started rethinking my approach to development.  Even though I had plenty of Raspberry Pis to go around, I started thinking about other solutions.  In my network, I have a vlan specific to Experimenting.  I also have a bunch of switches that allow me to setup links all over the house.  It occurred to me that maybe I could use an ESP8266 NodeMCU chip to receive commands and cause the switching to occur.  That way, I could use a Raspberry Pi to do the commands.  I could also simply print each of the boxes and tailor them to my circuitry.  So that is where I am at.

Friday, December 22, 2017

LED - Light Controller #2 - Hardware Buildout for Light Controller Box

The idea for a Light Controller Box is from the old idea of an internet controlled switch.  You have some type of control that sets or unsets a relay so that power is turned on/off at a plug.  Normally these things are in racks of equipment and are used for emergency shutdown and reducing power in a network room when a server is not needed.  The idea suits my needs because I want to be able to switch a string of lights on and off.  This is the basis for many of the light shows that you can find videos from on YouTube.

First off, I wanted something to keep the equipment dry and at the same time be able to run the power cables as necessary.  At first, I thought about using a cheap toolbox and cutting out holes for the power ports and switches.  One other thing that I was going to have to do was to figure out some sort of seal around the lid and some way to waterproof the connections going into the toolbox.  However, after thinking about it, I decided that this was too much work on my part for what I was getting.  I wanted something that I could buy and quickly setup as necessary since I was going to need a couple of these.  So I settled on the idea of a DriBox which is a plastic box that has openings for power cables so that you can put say a power strip in it and plug cables into it.  The cables are put into slots in the box that have grommets that fit around the power cables when the lid is put back on.  It is not completely waterproof, but you can run a hose on it and it does keep the contents dry.



Next, I figured that I could take the electronics and put them on a piece of Plexiglas with standoffs that could be screwed into the Plexiglas along with some "feet" on the other side.  That way, I could put everything together, check it out and then put it into the box quickly.  That would save a lot of time for repairs.  I could also re-purpose the electronics to another project later by simply removing the Plexiglas board from the DriBox and unscrewing the power lines.  I also chose to put the 16 port io extenders on a full size Adafruit perma-proto board with connectors pointing up so that this could be reused as well.  Prototyping of the whole circuit can be done on a regular breadboard and then moved over to the perma-proto board because the connections are identical.  There is even space on the board for the connector to the Raspberry Pi.


The next post will have a circuit diagram for the 16 port extension.  I might even invest in a RPi hat that has the same characteristics if I can find one.

Thursday, December 21, 2017

LED - Light Controller #1 - Introduction and Idea

I have been thinking about next Christmas season and I have decided to get my act together and put together a LED Strip Controller Helix and Light Switching Box.  I want it to be RPi/Arduino controlled and interfaced to my home network.

The requirements for Light Switching Box are as follows:
  1. Circuit A and B, with inputs A and B from mains
  2. 8 individually switched circuits - one socket per
  3. Main switch toggles off, circuit A or circuit A+B - real switch
  4. Fuses on incoming?
  5. One socket always connected to circuit A for RPi, always powered when A is plugged in
  6. Connection to RPi through I2C, 16 port ic through level shift
  7. 8 ports used for 8-port relay, remaining 8 ports for switch and led functions?
  8. RGB led for boot up/armed function, RGB led for other indication
  9. Triple LED strip controller PCM (WS2812B)
The requirements for the LED Strip Controller Helix are as follows:

  1. Base the light on a helical strip wrapped around a 4 inch pvc pipe.  I can get about 4.5 inches in between each coil on a four foot section and make use of the controls in each
  2. Cap the top so that water cant get in
  3. Place an Arduino and power supply, for the LED strip, inside the pipe to keep it out of the weather.  If the Arduino can be controlled wirelessly, I can communicate with it to send update commands with my home network.
  4. Four wire line (for power and i2c data/clock) in the case of a non wirelessly controlled Arduino or, a Two wire line (for power) in the case of a wirelessly controlled Arduino controller.  Power only going into the box is obviously preferred.
  5. Communicate from the Light Switching Box to each Helix to relay commands and synchronize the light show.