Alright, I have this idea I want to build. I have a Raspberry Pi 2 (Pic related). For my project to work, I'd need it to do two things. 1. Measure electricity 2. Remotely control a servo. Could it do it? and if so, how do I do it? inb4; Stick a magnet on it
>>987824
If you want to measure a voltage you need an ADC, and possibly a voltage divider. If you need to measure current you also need a shunt resistor. To control a servo you should use a servo HAT. Look up all the tutorials for the stuff I mentioned and you should be able to make it work.
Yes, it's more work than clicking a few things on each other.
>>987825
From the first time I considered it I knew it probably wouldn't be easy. Thank you anon.
>>987824
>measure electricity
/diy/, I need to measure water. How do?
>>987824
The pi has no analog inputs. Unless your project needs some fairly complex programming you're probably better off with an arduino or some other microcontroller. If you are dead set on using a pi you will need a separate ADC chip (I think MCP3008 is the commonly used one) to measure voltage.
It would help to give a detailed description of your project so we can give you better advice.
>>987824
>Alright, I have this idea I want to build. I have a Raspberry Pi 2 (Pic related). For my project to work, I'd need it to do two things.
>1. Measure electricity
there are current and voltage sensors sold, plus ways to do both using discrete (individual) parts. What electricity are you trying to measure exactly?
>2. Remotely control a servo. Could it do it? and if so, how do I do it? inb4; Stick a magnet on it
What do you mean by "remotely" exactly?
There is....
1. IR LED/laser schemes, for direct line-of-sight over short distances --- cheap & simple but requires line of sight
2. xbee modules (RF, 2-way, see wikipedia)
3. wifi modules (esp8266, RF/wifi, 2-way, see wikipedia)
4. plain/vanilla RF modules that operate on 315 or 433 mHz and only transmit one-direction with no feedback -- very cheap and simple to use tho
#1 and #4 might have an analog signal and I dunno if rPi has ADC on its input pins. In that case you would need something else between them (can be cheep)
Also the rpi only has 3.3v inputs, and #1 and #4 have 5v outputs IIRC. SO you'd need a logic-level converter (also cheep)
I use arduinos but got no rpi as of yet....
>>987824
>Measure electricity
1. learn about electricity first
2. devices for measuring voltage and current already exist
>>987827
just count silly