Thingiverse

Silent Anet A8 Electronics Case Cover OctoPrint Raspberry Pi Zero W 4 Channel Relay Enclosure by tednv
by Thingiverse
Last crawled date: 4 years, 2 months ago
This case cover accepts a 4 channel relay board that I'm controlling using a Raspberry Pi Zero W running octoprint. The original case was meant for the larger Pi2 but 2 of the holes line up perfectly for Pi Zero W and leave some extra room for cables and connectors. You need a few custom circuits to drive the relay module, Pi IO ports are 3.3V, the relay board needs 5. This was very easy and inexpensive to accomplish
The purpose of the relays is to use octoprint event functionality to turn on and off the loud fan that sits on the extruder heat sink and the case fan, making the printer completely silent when it is not printing. I'm also planning on using one of the relays for a software controlled emergency kill switch to add some more safety to the printer, and the other one to turn on some large LED modules for time lapse. I'm also driving RGB led strips with the Raspberry Pi Zero, but don't need relays for that
The original design is pretty much perfect, I only added 1MM to the bottom and left side of the cover to make it stronger, the screw holes were pretty close to the edge and one of the corners broke on the original
I used the bumper design to get the base measurements (my caliper battery died so I couldn't get measurements). The bumper needed to be scaled up about 2MM to compensate for shrinkage, printing it at 100% made it almost impossible to get the board in, and definitely not possible to get out without destroying bumper
This is the article that helped me a lot for getting the relay hooked up to my Pi Zero W, everything was the same as the Pi 2 in the article. It will show you the raspberry pi pinout and how to hook up the stepup adapters to the relay board
https://myhydropi.com/connecting-a-relay-board-to-a-raspberry-pi
This is the relay board I used:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
To make the driver circuit, you'll need a soldering iron, some solder, something to shrink tubing with (I use a bic lighter, just have to be careful not to overheat components)
2n3904 transistors like these:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
You only need 4, but this was cheapest I could find as amazon addon, and now that I know how to use them i'll use them for other projects
3mm shrink tube like this:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
or this assortment:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
Optional, but makes for a stronger connection. I also used a larger diameter to wrap the whole thing when done
Some resistors:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
You need 4 x 10k and 4x 2.2k, I got the assortment because I'm always soldering resistors off old broken electronics and trying to find the right values. This assortment is pretty cheap and I'll use them elsewhere
Helping hands if you don't already have some:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
You can also print these, but I like the metal ones because they don't melt and the heavy base keeps them from falling over
The 80mm fan that I'm using to cool the raspi and anet boardhttps://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
And dust filter for it (I like an actual dust filter instead of just a grill so I can vacuum out the dust and it won't cover all my components)https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
Building the relay controller step-up modules
Bend the two outer legs towards the flat part of the transistor. Bend the middle leg (Base) out towards the rounded part
Solder a full length 10K resistor to the Emitter leg. This will be connected to ground
Cut the middle leg (Base) to about the length of the body of the 10K resistor. Cut one side of a 2.2K resistor to the same length
Solder the two ends together
Allow solder to cool and then slide a 3MM shrink tube on this solder joint
Using needle nose pliers, make 2 bends on the other end of the 2.2K resistor so that it is parallel to the 10K resistor and solder them together
Trim all the ends to about 1/4 inch or whatever you feel comfortable soldering a piece of wire to
Clean up the solder joints but leave some extra solder on them so that you get a good bond with the wire. Do not overheat the joints, heat them only enough to briefly melt the solder and leave some flux behind so that the wires get a good bond
Slip on 3mm tube onto wire. Solder on the wire with the dupont connector, shrink tube around joint. Slip on shrink tube (larger diameter) over dupont connector and shrink it around the resistors and the smaller shrink tube to strengthen the connections.
Slide 3mm shrink wrap around 2 remaining wires. One with dupont connector for relay pin and the other to ground connector on raspberry pi and ground connector on relay board (you will need to make a harness with a bunch of ground wires connected together)
For the software/configuration portion:
You'll need to copy the attached on.py and off.py python scripts to pi user's home directory to use this config
Octoprint events configuration section (add this to the end, also attached with the right formatting):
events:
enabled: true
subscriptions:
event: PrintStarted
command: python ~/on.py
type: system
event: PrintDone
command: python ~/off.py
type: system
event: PrintFailed
command: python ~/off.py
type: system
event: PrintCancelled
command: python ~/off.py
type: system
I tried using some of the octopi images but couldn't get ssh to work and had some other problems, so just built my own octoprint from a clean raspbian install
The purpose of the relays is to use octoprint event functionality to turn on and off the loud fan that sits on the extruder heat sink and the case fan, making the printer completely silent when it is not printing. I'm also planning on using one of the relays for a software controlled emergency kill switch to add some more safety to the printer, and the other one to turn on some large LED modules for time lapse. I'm also driving RGB led strips with the Raspberry Pi Zero, but don't need relays for that
The original design is pretty much perfect, I only added 1MM to the bottom and left side of the cover to make it stronger, the screw holes were pretty close to the edge and one of the corners broke on the original
I used the bumper design to get the base measurements (my caliper battery died so I couldn't get measurements). The bumper needed to be scaled up about 2MM to compensate for shrinkage, printing it at 100% made it almost impossible to get the board in, and definitely not possible to get out without destroying bumper
This is the article that helped me a lot for getting the relay hooked up to my Pi Zero W, everything was the same as the Pi 2 in the article. It will show you the raspberry pi pinout and how to hook up the stepup adapters to the relay board
https://myhydropi.com/connecting-a-relay-board-to-a-raspberry-pi
This is the relay board I used:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
To make the driver circuit, you'll need a soldering iron, some solder, something to shrink tubing with (I use a bic lighter, just have to be careful not to overheat components)
2n3904 transistors like these:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
You only need 4, but this was cheapest I could find as amazon addon, and now that I know how to use them i'll use them for other projects
3mm shrink tube like this:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
or this assortment:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
Optional, but makes for a stronger connection. I also used a larger diameter to wrap the whole thing when done
Some resistors:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
You need 4 x 10k and 4x 2.2k, I got the assortment because I'm always soldering resistors off old broken electronics and trying to find the right values. This assortment is pretty cheap and I'll use them elsewhere
Helping hands if you don't already have some:https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
You can also print these, but I like the metal ones because they don't melt and the heavy base keeps them from falling over
The 80mm fan that I'm using to cool the raspi and anet boardhttps://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
And dust filter for it (I like an actual dust filter instead of just a grill so I can vacuum out the dust and it won't cover all my components)https://www.amazon.com/gp/product/B01N4O719N/ref=as_li_ss_tl?ie=UTF8&linkCode=sl1&tag=tednv05-20&linkId=34352f77cdd14374f6b95ad47d121587
Building the relay controller step-up modules
Bend the two outer legs towards the flat part of the transistor. Bend the middle leg (Base) out towards the rounded part
Solder a full length 10K resistor to the Emitter leg. This will be connected to ground
Cut the middle leg (Base) to about the length of the body of the 10K resistor. Cut one side of a 2.2K resistor to the same length
Solder the two ends together
Allow solder to cool and then slide a 3MM shrink tube on this solder joint
Using needle nose pliers, make 2 bends on the other end of the 2.2K resistor so that it is parallel to the 10K resistor and solder them together
Trim all the ends to about 1/4 inch or whatever you feel comfortable soldering a piece of wire to
Clean up the solder joints but leave some extra solder on them so that you get a good bond with the wire. Do not overheat the joints, heat them only enough to briefly melt the solder and leave some flux behind so that the wires get a good bond
Slip on 3mm tube onto wire. Solder on the wire with the dupont connector, shrink tube around joint. Slip on shrink tube (larger diameter) over dupont connector and shrink it around the resistors and the smaller shrink tube to strengthen the connections.
Slide 3mm shrink wrap around 2 remaining wires. One with dupont connector for relay pin and the other to ground connector on raspberry pi and ground connector on relay board (you will need to make a harness with a bunch of ground wires connected together)
For the software/configuration portion:
You'll need to copy the attached on.py and off.py python scripts to pi user's home directory to use this config
Octoprint events configuration section (add this to the end, also attached with the right formatting):
events:
enabled: true
subscriptions:
event: PrintStarted
command: python ~/on.py
type: system
event: PrintDone
command: python ~/off.py
type: system
event: PrintFailed
command: python ~/off.py
type: system
event: PrintCancelled
command: python ~/off.py
type: system
I tried using some of the octopi images but couldn't get ssh to work and had some other problems, so just built my own octoprint from a clean raspbian install