I am in developing process of creating/ designing a device that will launch a projectile remotely. The solenoid is being used to open the valve and allow the projectile to be shot. To remotely trigger this I plan to use infrared since I found a receiver laying around and my phone has uses infrared as well. I have an IR receiver however it connects via 3.5mm.Is it worth it to use this one I have now or get a different receiver. How does one go about include am IR receiver and/or a solenoid valve to a project involving the Raspberry Pi.

  • Have a look through the Magpi magazine to get some ideas. – joan Sep 23 '15 at 17:08
  • IR receivers are cheap (~$2) and easy to attach (3 pins) and use, if you do some basic searching online... – goldilocks Sep 23 '15 at 17:13

I can give you some pointers, but not a full answer as that would be me designing this solution for you - you need to do some more basic research as what you are asking is very common technology solved in thousands of blog posts, instructables.com articles and more (I know because I recently added an IR receiver to my rPi for Media Center purposes).

First of all, let me assuming you want the phone to be the controller, and the rPi to be attached to the projectile launcher (you're not spelling this out in your question - maybe you could edit it in).

  1. Go look at IR receivers online. Adafruit sells one, so does Radioshack (in the remaining locations they have in the US, you just have to browse through their component racks yourself as their personnel is totally clueless). If you're not from North America, there are tons of hobbyist electronics stores in Europe and Asia that sell these, either in store or online. Adafruit also has a short tutorial on how to wire it up, just forget about all the LIRC setup they mention.
  2. Most IR receivers have three pins - a ground pin, a VCC pin (you need a 3V3 source) and an output pin which contains the received information. Just wire those up to GND, 3V3 and one of the GPIO pins.
  3. I don't know your solenoid, but it will likely have a VCC input and a signal input, as well as a ground. If the VCC is 3V3 and the current requirement is very small (<100mA) you can connect to the rPi's 3V3 pin. If the VCC is 5V and the current requirement is 0.5A or less, you can use the rPi's 5V pin. If the VCC or the current requirement is not within those specs, you need to look for articles on how to use a relay with an rPi (thousands abound, just google).
  4. Now, using a library like RPi.GPIO, you can read the incoming signals from your IR receiver GPIO pin, do your logic and then send the right signal to your Solenoid. Again, boatloads of documentation on this at uncle Google.

Good luck.

  • 1
    @niko one tip for number 3 add uln2803 to your search (assuming you don't connect it directly to the GPIO pins. This chip is very easy to work with and you will find lots of Pi specific resources. You may also want to look over the stuff at learn.adafruit.com they have a whole section on the Pi including IR, and the darlington chip (ULN2803) mentioned above. – Steve Robillard Sep 23 '15 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.