In this part of the guide, we will go over the physical construction of my development version of The System Controller. It mainly consists of a plastic cutting board with a relay shield and a terminal electric strip bolted to the bottom of a cutting board with a Beagle Bone Black bolted to the top. This cutting board will then be placed in the pelican case where it can be made to be water proof. Then, the necessary external cords can be inserted into the case through holes drilled in the side of the pelican case. Feel free to send suggestions on this documentation to Sam.OuterBabylon@Gmail.com.
Prepare the project board
- Cut the cutting board to the proper dimensions, 4″ x 8″. It will be what I call the project board.
- The following template (fig. 1) is how I built my development System Controller. The Beagle Board will go on the top and the Terminal Strip and the Relay Shield will go on the bottom to hide some of the wiring. The hand hole of the cutting board will make a handy place to feed wire between the top and bottom. The red dots of course are bolt spots.
fig. 1
- Rather than pre-drilling all the holes in the project board, I found it easier to just line them up by eye and drill the holes as I needed when adding circuit boards to the project board.
Place the relay shield
- Place standoff spacers tightly into the top left and bottom right corners of the relay shield as shown in the project board template (fig. 1)
- The following picture (fig. 2) shows how the spacers should look when properly placed on the relay shield. I added small cardboard washers to help the standoff spacer bolts fit tighter.
fig. 2
- Place the relay shield with the spacers onto the bottom side of the project board in the position denoted on the project board template. I would suggest drilling the hole for one of the standoff spacer bolts and then temporarily mounting the relay shield with only that one bolt to see where the hole for the second bolt is best to be drilled.
fig. 3
- Place a spacer nut onto the spacers to hold the Relay Shield to the project board.
fig. 4
Place terminal strip
- Place two 1″ screws into the terminal stripe as shown here:
fig. 5
- Place the terminal strip with the screws onto bottom side of the board in the position denoted on the project board template.
fig. 6
- Screw the screws into the project board just enough so that it holds firmly. Do not allow the screws to come out of the top side of the project board. They could short something important.
Place Beagle Bone
- Place standoff spacers tightly into the top right and bottom left corners of the Beagle Board as shown in the project board template (fig. 1) I refer to the side of the Beagle Board with the power input port to be the top side.
fig. 7
- The following picture (fig. 8) shows how the spacers should look when properly placed on the Beagle Board. I added small cardboard washers to help the standoff spacer bolts fit tighter.
fig. 8
- Place the Beagle Board with the spacers onto the top side of the project board in the position denoted on the project board template. I would suggest drilling the hole for one of the standoff spacer bolts and then temporarily mounting the Beagle Board with only that one bolt to see where the hole for the second bolt is best to be drilled.
fig. 9
- Place a spacer nut onto the spacers to hold it to the Beagle Board to the project board.
fig. 10
Drill cable holes in box
- You will need to drill at least 4 hole measuring 1/4″ for my development setup. These are for two peripheral output power cables, a Beagle Bone input power cable, and a sensor cable.
- You will also need one hole measuring 5/8″ for the input Internet cable.
fig. 11
Build an analog sensor
- This is the analog sensor that we will be modifying in this section. The Beagle Board analog input port can only take 1.8 volts and can not be exceeded or the board could be damaged. This lesson will describe how to add an in-line circuit to the sensor to step down its output voltage from its factory 3V output to a 1.8V output. This is very important to protect your board. As you can see, the sensor will produce a 3V output straight out of the box with a 5V input while completely submerged in water. Lets drop it to 1.8V!
fig. 12
- You will want to strip the ends of the wire and add on some lead connections so that this sensor can be plugged into the Beagle Board without damaging the input ports of the board. You will want the red (hot) to extend to a red lead, the black (signal) to extend to a black lead, and the green (ground) to extend to a greed lead to keep things straight.
fig. 13
- We will cut the sensor cable in half about a foot to two feet away from the input side of the sensor. To be clear, the sensor cable is about 6 feet long, and this cut should be on the side furthest from the actual sensor. Placing the cut about 5 feet from the actual sensor. This is where we will splice in our step-down circuit.
fig. 14
- Now is a great time to go ahead and slide on a piece of heat shrink wrapping near the cut to make sure its ready to cover the circuit when we are done soldering. Once the circuit is soldered in, it may be difficult to get this heat shrink wrap onto the wire for the final seal.
fig. 15
- Make sure you have a nice pair of wire strippers. Stripping the cable without cutting the inner wire’s plastic shielding is important because shorts can happen and the sensor will not read correctly.
fig. 16
- Go ahead and strip the inner wires to where they have about a 1/4 inch exposed on both sides of the cut. This 1/4 inch will be the perfect amount of space for soldering.
fig. 17
- Our circuit will basically bridge the ground and the signal with a 15K ohm resister which will provide the perfect dropping of the signal wires output voltage. Here is a diagram of the resistor and the strip pattern that will identify the 15K ohm resistance.
fig. 18
- The resistors will usually come in a pack like this. Make sure that the color pattern on the resistors that you select match the color patterns above to indicate 15K ohms.
fig. 19
- This is the detailed circuit diagram that we will be soldering with the 15K ohm resistor. Note the orange rectangle indicating an area of the circuit that will be covered with a small piece of heat shrink. This smaller piece of heat shrink is a different piece than the one described above in fig. 15.
fig. 20
- With one side of the cut cable, the first solder point will be extending the ground wire with the 15K ohm resistor. Place the ground wire and the resistor in an electric clamp to hold it steady while you make your first soldier.
fig. 21
- Once stably clamped, the soldier will be applied with a soldiering iron to the spot that the soldier roll is pointing in fig. 22.
fig. 22
- Once soldiered, the ground and the 15K ohm resistor are jointed and the clamp can be released.
fig. 23
- You will want to clip off the extra part of the resistor wire on the far side of the soldier point away from the resistor.
fig. 24
- So then you should have a ground wire coming out of the cable which basically splits into a continued ground line and another to the resistor. Check fig. 20 to make sure you are still on track.
fig. 25
- Important: Wrap your electric clamps in some electric tape cause the teeth can bit into your cable or wires in a bad way. This isn’t pictured in any of these pictures but is important. Also, when you are soldiering these small wires, do not hold the iron on the metal of the wire for more than 3 or 4 seconds. Do these connection jobs in small sprints because the metal quickly builds of heat and will start to melt the near-by plastic wire shielding.
- Now we will align the wires on the clamp so that we can soldier the black wire in with the other side of the resistor. Once your done aligning it on the clamp, consult your fig. 20 once again to make sure it all makes since and your on track.
fig. 26
- Now you will soldier the black wire with the other end of the resistor at the point indicated here where I point the soldier line.
fig. 27
- When your done soldiering, you’ll have a solid connection that should be fairly smooth.
fig. 28
- Now we are going to add the smaller heat shrink wrapping over the orange section of the circuit diagram in fig. 20. Make sure to look at the diagram and that you are placing it in the right spot. Placement in fairly important and the resistor should be near the middle of the heat shrink wrap.
fig. 29
- When you are ready, hit the heat shrink wrap with a heat source to clamp it down to your wires. Don’t do it too long of it will make holes in the shielding.
fig. 30
- Now you should have something similar to the following. A red (hot) and a black and ground bridged by a 15K ohm resistor.
fig. 31
- Now you are ready to grab the other side of the cut cable and attach the wire together. Align them on the clamp so that they will reach each other.
fig. 32
- Now soldier them together. Red to red, black to black, and ground to ground.
fig. 33
- Pull it off the clamp when you are satisfied and check your work. There should be no sharp edges or points in the soldier points because they will cut or poke through the shielding or final heat wrap.
fig. 34
- Wrap the red and black wires with a couple of loops of electrical tape but don’t go crazy with it and keep them small. These wraps and all wires will need to fit into the final heat shrink wrap.
fig. 35
- Note that you don’t need to wrap or isolate the ground in any way.
fig. 36
- Now your ready to pull your final heat shrink wrap from fig. 15 over your soldiered and taped connections. Again, you will want your soldier connection points near the middle of the heat shrink. You will be able to feel it into the right position.
fig. 37
- When you are ready, hit the heat shrink wrap with a heat source, and clamp it down to the cable.
fig. 38
- It should look fairly clean now and not slide around.
fig. 39
- Here is your final analog sensor with the adapted leads for the Beagle Board ports and the step-down circuit in line and ready to go.
fig. 40
- Now lets test it by plugging the red into the 5V vin port of your Beagle Board and the green into a ground port. The black will be left free to touch the black lead of your voltage tester.
fig. 41
- Now submerge your sensor in water. Do this away from your Beagle Bone. Touch the voltage testers red lead to the sensor black signal wire and the voltage testers black to the ground on your Beagle Board. Hopefully, you will see that there is now only 1.8V traveling between the signal of the sensor and the ground of the Beagle Board. If not, take the appropriate steps to debug your circuit or rebuild the in-line circuit by going through this lesson again. Good work and on to the next lesson.
fig. 43
- Good work and on to the next lesson.
Wire the heavy voltage
- We will now cut the extension cords so that they can be ran into the System Controllers Unit. These cords will be how devices will be plugged into the system and how the devices get power. We will want to cut several cords with more cord length on the female side and one with more cord length on the male side. The long female cords will be used to plug in devices to our relay system. The longer male cord will be ran into the unit and plugged into the wall socket to power the devices. Cut them so that there is as much length in each resulting cord as possible.
fig. 44
- Now strip the chord ends so that about a 1/4 inch of metal is showing. Fig. 45 is an example of a female ended cord.
fig. 45
- Fig. 46 is an example of a male ended cord.
fig. 46
- Run the cords into the pelican case and make a knot in the cords on the inside portion of the cord so that they can’t be pulled out or create stress on the boards they will be wired into.
fig. 47
- This is a diagram of the relay. Pay attention to the positions of these wire ports as it will be important that your devices are normally open. This basically means that the devices you plug into the ports will be normally off and no electricity will be supplied to them while the relays are not engaged. The common is always used and then the normally open port is also used. Plug nothing into the normally closed ports for this project.
fig. 48
- After understanding fig. 48, you can see how a female cord can be wired in the following manor. A live power input will be placed into the common and then the hot side of a female cord can be plugged into the normally open port. For our simple setup with one sensor and one device, choose the 8th relay which is labeled on the board as K8.
fig. 49
- The terminal bank should have a section that is dedicated to being a ground. These chained terminal ports will be connected to the input male cord’s ground side. The ground side of the input cord typically has a line of some sort running down it.
fig. 50 (TODO: better picture)
- The terminal bank should have a section that is dedicated to being a hot source from the wall. These chained terminal ports will be connected to the input male cord’s hot side side.
fig. 51 (TODO: better picture)
Wire the lite voltage
- To wire the light voltage wires, you’ll have to know what kind of sensor and device setup you want. Each device, like a fan or light, needs a designated digital pin which are shown in the pin diagram below named like GPIO_#. Each sensor, like a light sensor, you wish to use needs a designated analog input pin which are shown in the pin diagram below named like AIN#. The power and ground related pins will be used in this project as well and are in the low numbered pins of bank P9. Bank P9 is the row of inputs along the side closest to the barrel power port while the P8 bank is along the other side.
fig. 52
More pin configurations are here.
We’ll be using the GPIO mode.
- For my simple setup of the System Controller, I’ll just be configuring one moisture sensor and one light. This simple setup can have the system rules setup so that the light will turn on when the moisture sensor is wet. I like this example because it can be used in a garden setup to turn water on when the soil is dry.
- To hook the device signals to the Beagle bone, I placed the following connections in place:
- A grey wire in P9_2 ( Ground )
- A red wire in in P9_6 ( VDD_5V ) // 5V needed to trigger relay
- An orange wire in P9_15 ( GPIO_48 )
fig. 53
- To hook the device signals to the Relay shield, I placed the other end of the above connections into the relay shied as following:
- The grey wire in GND
- The red wire in VCC
- The orange wire in IN8 // Controller of relay 8 as in fig.49
fig. 54
- We will be using a single moisture sensor in this simple project setup. The moisture sensor we built in the “Build the analog sensor” section has a green, black, and red wires. Wire them into the BeagleBone board in the following manor.
- The green wire into P_1 ( Ground )
- The red wire into P_4 ( VDD_3V3 )
- The black wire into P_40 ( AIN1 )
fig. 55
- With this setup, you can now get analog sensor readings off the BeagleBone board AIN1 and turn on/off relay 8 by sending a high/low signal to GPIO pin GPIO_48.
- Your project assembly should now be complete and ready to install the software and test a simple project setup.