Friction mount for compact relay module and small SMPS, for 3d printer power control

Friction mount for compact relay module and small SMPS, for 3d printer power control

Description

EDIT: see better way of controlling this relay from gpio below. These 5v relay modules are really handy, except they have no mounting holes. https://www.aliexpress.com/item/Free-Shipping-5V-low-level-trigger-One-1-Channel-Relay-Module-interface-Board-Shield-For-PIC/32708600505.html They handle up to 10 amps of 250v which is more than enough for almost all desktop 3d printers, which is why lots of people use them to control their 12v or 24v power supply either with a raspberry pi or power supply control from their RAMPS or other controller. But full wall AC voltage on the relay pins is a scary thing. And there's no mounting holes. So i designed this friction mount. The board snaps in with minimal effort but to remove it you have to wedge something under the board. The two bumps in the middle keep the board pushed up against the ridges on the side walls. There are small ridges at the ends of the sides that keep it from being slid out. The mounting posts allow it to be attached to a low cost 5vdc 2A switch mode power supply: https://www.aliexpress.com/item/AC110-220V-to-DC-5V-2A-Switching-Power-Supply-Driver-Transformers-50-60Hz-Module-Damom/32916118113.htm This SMPS is overkill for providing the logic and servo power needs of a RAMPS. It _MAY_ be sufficient for a Raspberry Pi 3b running Octoprint. You might try tweaking the voltage up to 5.15v-5.2v. I recommend chopping the "A" end of a USB cable off if you want to do that. The power wires will be thicker than the data wires, and they will probably be red and black. I know that the RPi people say that you "need" a 2.5A supply, but when i was building a raspberry pi media center i did some of my own testing with a usb volt/amp meter and my observation is that the rpi3b idles at about 650mA with some short spikes now and then but i never saw it draw over 1.1A. My supposition is that most usb charger supplies are garbage and that the raspberry pi design has basically no reserve capacitance so it is extremely sensitive to the transient response of the external power supply. So in theory a 2A supply should do the job. Give it a shot. But my intention is to find a place to mount this small SMPS and relay module inside the controll box of my Wanhao i3 v2.1 when i install a RAMPS, so that the 12v supply can be switched on and off using M80 and M81. This provides an additional layer of safety because mosfets often fail "closed", which could lead to a runaway heating condition and possibly a fire that would be impossible to shut down without power supply control. Marlin firmware automatically shuts down the power in an error condition, potentially preventing a fire in the case of a failed mosfet. You will need some short M3 screws to attach the mount to the power supply. They should self-tap easily but you may want to tap the holes before you try to mount it, where you can get a good angle to get them started with a screwdriver. You may have to take the SMPS apart to install the mount. The top pops off and there is one screw. Since this is a switching power supply that runs off mains voltage I think you should do this before ever connecting it to power. You should be able to use the wiring diagram from this instructable if you are using octoprint: https://www.instructables.com/id/PSU-Control-With-Octoprint/ But since i use the built in atx power supply control capability of the 3d printer firmware it is a little different for me. If you don't have any experience wiring mains AC you should read up on it and i can't be held responsible for your injury or death or destruction of all your belongings and home if you make some mistake. That being said the main thing is that you should avoid screwing around with mains powered electronics while they are plugged in, and unless you know for sure that the circuit is discharged you should keep one hand in your pocket because what kills you is when you are shocked across your chest. After your fuse and power switch wiring, earth and neutral go to both the 12v/24v supply and the 5v supply. The live wire goes to the live on the 5v supply and to the N/O terminal on the relay. Then run a wire from the COM (center) terminal of the relay to the live terminal on the 12v/24v supply. Run +5v and gnd to the vcc and gnd pins on the relay module. If you have a RAMPS, connect the "In" pin on the relay module and +5v on the power supply to the PS-ON and VCC pins on the RAMPS. You will need to clip one leg of D1. This will prevent the RAMPS from trying to power the mega2560 voltage regulator from the 12v supply - the 5v supply is now the 5v power supply. If you have any servos (e.g. a bltouch) you will need to run an additional wire to the 5V pin next to the VCC pin on the RAMPS. Run a wire from the GND (V-) terminal on the 5v supply to the GND terminal on the 12v/24v supply. This should be the only ground wire you have to connect to the 5v supply. I do recommend assuring that the 5v supply's enclosure is earthed, by using screws to attach it to a piece of metal that is already earthed. If i remember right these relay modules are active high, which means that you compile Marlin with #define POWER_SUPPLY 2 EDIT: I was messing around with one of these and an orange pi, so i can use octoprint to turn the printer on and off, and i found that if it is connected to the gpio pin directly, it is triggered no matter what. 1, 0, or even set to input. I found a simple solution. Put any random LED between the "in" pin on the module and the gpio pin on the pi - cathode toward the gpio pin. And add a series current limiting resistor for safety margin. Now the relay is triggered when the gpio pin is pulled low. With a bright warm white led and 10k limiting resistor it works great and the LED illuminates a little. With a random diffuse red LED from the 80's the LED barely illuminates but it still does the job. Using an LED as a constant current sink (or source) is a pretty common trick in audio gear.

Statistics

Likes

15

Downloads

0

Tags