This product was mentioned in
with an average of
OK got it. I hope you don't mind all my questions. Hopfully this is the last of it.
I have amazon prime so is this close enough to your link above: [link]
Also, what end would I connect the 5v to trigger the other end 12v?
If I were going to do this I would probably add another float switch for the pi at a higher level, so it doesn't time out and turn off if the sump is actually full.
You could also use that higher switch to turn it back on when the sump fills up a bit more. Sounds like a fun little project.
To run your load on and off, you'll just need a relay that uses 5v to switch, and is capable of switching 120VAC. For example: [link]
Most fireplaces (definitely mine) use the heat from the pilot light to generate the LV current. You want a DC relay that will close that loop. I used this:
Plus an AC smart switch, AC to USB charger, and old smart phone cable to trigger the relay. This plugs into the AC outlet under the fireplace that also powers the fan.
If your fan controller also has a light switch you could use that instead of the smart switch and wire to a relay.
2 5v triggered arduino relays will get you to 1P4T
My fireplace (like most gas fireplaces in the US) just needs a circuit to close to turn on. I had a wall switch doing this, I replaced that with a HomeKit outlet, a 5v DC wall wort, and a $6 relay. All that stuff is under the fireplace. I didn’t even know what a relay was when I started, but this was much easier than I thought it would be.
The relay: Tolako 5v Relay Module for Arduino ARM PIC AVR MCU 5V Indicator Light LED 1 Channel Relay Module Works with Official Arduino Boards [link]
Feel free to hit me up with any questions.
buy this: [link]
connect it to pi's 5v, ground, and a GPIO pin. see the pi pinout for details on finding these pins.
turn off script
import RPi.GPIO as GPIO
turn on script
Install the automatic shutdown plugin and change the pi's shutdown command to run the turn printer off script.
relay is wired as follows:
find a power cord and cut it
wire green to ground on electrical outlet
wire white to neutral on electrical outlet
wire black to NO on relay
wire relay trigger wire to line on electrical outlet
Plug printer into electrical outlet and leave power supply in the on position.
It's specifically made for Arduino with a FET on board for the control pin and I'm powering the coil (not the switched load, the relay coil itself) from a separate 5V/2A power supply. It's schematically identical to this one - note the J3Y transistor on the side.
Others have mentioned that I I needed to declare the pinMode for output (narrator: he didn't), which I'll be checking later.
You'd be fine if you used a relay such as this one. It has a transistor to protect from back voltage to the Pi and is really easy to use. I've set one up in the past to control a lamp with my cell phone.
That depends on the size of your motor, the digital pins on the arduino can provide 40 milliamps of 5v power, but given that your motor is out of a car I suspect it requires 12v to operate, at a substantially higher current. For the purposes of your demonstration I you can either get a 12v battery box, or a 12v wall transformer and just say that in a production run the motor would be run by the car's 12v electrical system. Then use a relay to control the power to the motor.
You could try rigging it into a relay such as this one, then powering it with a 9v battery. It may take some fiddling, and I'm way too tired to think right now, but it could work. I used it to hook a lamp up to an arduino and powered it with much lower voltage than the lamp would normally take. Of course, you'll still have the normal issues you'd get by using a doorbell circuit.
If you really want to get it done you could wire up a killswitch with a doorbell looking button, and add an LED that is controlled by the killswitch button.
Since you are running Octoprint anyway, you might be cheaper, and easier in the long run, to add a relay instead. I have bought the relay, but have not done the install yet, so this is theoretical knowledge.
A relay works by taking a small voltage (like the 5V that the Pi can generate right off the bus) and using it to allow a larger voltage to pass through. Think of it like a powered switch. There are three lugs on the relay. I will call them A B and C. If there is voltage coming from the Pi to the relay, then A and B will be connected. if there is not, then B and C will be connected. This lets you setup the relay in one of two ways: Normally powered or Normally Dead. If you cut the main 24V power line in the power supply, you can hook it up so that it is normally powered, unless the Pi shuts it off. This way you can still print (from SD Card) without the Pi on or connected. The Pi will keep it shut off when you are not using it. If the Pi fails, the printer will be on.
The second way (and the way I intend to do it) is to have the relay normally off, and the Pi will turn it on. This way, if the Pi is not working, neither will the printer.
The way this works, you use an addon in OctoPrint called "PSU Control" It will turn on the Power supply to the printer when you are ready to use it, and turn it off when you are done. Think of a desktop printer that goes into standby mode when not needed, but wakes when you are ready to use it.
Here is the relay I got: (out of stock right now, but gives you an idea)
Edit: minor word changes
Sorry to ask again but how does this relay look?
It also has schematics
>You mean the relay coil? Yeah, that's WAY too much for a Pi to drive. GPIO pins should be connected to a transistor (through a 1k resistor), and then the transistor can drive bigger loads. You can look it up but I think a GPIO pin is rated to only 20 mA or so, which means signal only, no work.
I'm using this: https://www.amazon.com/gp/product/B00VRUAHLE/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
It's got a wire for signal, 5V and ground
This is the relay you are looking for (allows you to control any 120V AC load at 10A):
This is a really common thing to do with an Arduino, you can learn more about it here:
From what I understand, you would want to shut off the connection to the car battery once the voltage reads close to 12.6 volts. This is the standard "fully charged" voltage of a lead-acid battery.
This measurement can be achieved easily using a store-bought multimeter (a device that measures volts and amps from a power source). The tricky part here would be getting a multimeter that can talk to the raspberry pi. My advice would be to search around for some projects like this where the volt-meter reports serialized data to your pi. I also found this arduino-based multimeter which would be very similar to the type of setup you'd need to read the voltage.
Needless to say your version wouldn't need to be this complicated, but this guy's project contains a lot of nitty-gritty details on how to measure these things using basic components.
From there you can control a relay (a digital power switch controlled by the pi's GPIO headers). Presumably the relay would cut off power to your solar panel.
I'm certainly not an expert but this is certainly a project that you could do with a little preserverence and some research. If anyone with some more detailed electrical knowledge wants to chime in I'm sure they can offer some more wisdom than I can. If you need any help in the future feel free to message me :)
here’s one on amazon for about $5.
Not elegant, but you can put it in a small project box. That’s what I used to make a power-outage detector
You could also use a relay board. They work out of the box with no soldering and you can get boards with up to 16 relays.
I ordered this relay module online in hopes i could use it to control the electromagnet. Would this work instead of a mosfet. I could solder the 12vDC electromagnet into the 12v adapter wires to power it and the arduino from the same source? [link]
And this is the magnet i ordered:
There are none, to my knowledge.
However, the relays themselves are RU and CSA certified.
As long as you're running power directly from the switch, to the relay and back using the switch's own wiring, and aren't doing anything stupid (like leaving a half-inch of bare wire exposed), you'll be fine.
You probably want to ask over at r/raspberry_pi. I have completed projects with power switching and would probably recommend using a relay. You can still use python to turn the relay off and on... And it's kinda the whole point of using a pi for this type of project. Here is an example project (not mine)...
Alternatively, you could use a pump like this combined with a motor controler you would get much more precision over the flow.
The two servos and linear actuator Im using are all getting power directly from the 12v power source. The only things connecting these items to arduino are their signal lines and ground.
Im actually not sure how much current Im drawing from the 5V rail. The only things being powered by the +5V rail are three of these photosensors, two of these relay boards (to change the direction of the linear actuator), and two limit switches with 10k ohm pull-down resistors. Ill try to find my multimeter and see if this is the problem.
If I was drawing over 150mA from the 5V rail, wouldnt my arduino overheat even if it was plugged into the USB of a computer? Because right now it's fine if I keep it plugged into the computer and dont have 12 going directly to Vin.
I got this relay board:
This is the relay that triggers the on/off button, but any 5V relay works, it doesn't have to be high voltage. I don't know about the other one, I just found it laying around. Here's a picture of it more in focus. It doesn't have to be anything fancy, if it's rated to handle household current it's plenty good.