GM_Soulless
Posts: 4
Joined: Mon Feb 22, 2016 10:19 am

Detecting voltage change

Thu Mar 03, 2016 11:45 am

Ok, might need some help here guys- trying to set the pi up so it can detect a voltage change over a port (high<->low) for integration in some machinery I'm running.
Was wondering whether it would be possible to do this with the USB port, or would that be far, far too complex?
Would using the GPIO be a better option? Or do you guys have any other suggestions
Sorry if this is in the wrong board, wasn't quite sure where it would fit

PiGraham
Posts: 3971
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Detecting voltage change

Thu Mar 03, 2016 11:51 am

What voltage(s) do you want to detect? Is it AC or DC? How quickly does it change?

GM_Soulless
Posts: 4
Joined: Mon Feb 22, 2016 10:19 am

Re: Detecting voltage change

Sat May 21, 2016 7:04 pm

Whoops, was wondering why I wasn't getting replies, obviously my last post didn't actually post.
It would be an on/off check basically. As my tech guy said- "Since the Vcc is 3.3 v, we can safely say less than 0.5 V is off; greater than 2.0 V is on." It wouldn't be rapidly changing

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Detecting voltage change

Sat May 21, 2016 7:32 pm

GM_Soulless wrote:Whoops, was wondering why I wasn't getting replies, obviously my last post didn't actually post.
It would be an on/off check basically. As my tech guy said- "Since the Vcc is 3.3 v, we can safely say less than 0.5 V is off; greater than 2.0 V is on." It wouldn't be rapidly changing
If its a digital voltage, and you can guarantee that it will not exceed 3v3, then hook the voltage to your GPIO of choice and use a simple python script to read the pin.

If there is even the slightest chance that the pin will go higher than 3v3, you should run it through a buffer (or voltage shifter) similar to the buffers on the Gertboard, or the level shifters from AdaFruit, before you run to the GPIO pin.

If its an analog voltage, use an ADC (like the one on the Gertboard) to read the voltage, and then use SPI to read the ADC to get the correct digital correlation.
marcus
:ugeek:

GM_Soulless
Posts: 4
Joined: Mon Feb 22, 2016 10:19 am

Re: Detecting voltage change

Sat May 21, 2016 7:52 pm

Cheers Marcus, informative reply. I'll check with my guy as to whether it'll be guaranteed under the 3.3v limit because i wouldn't want to cause any malfunctions.

Return to “Automation, sensing and robotics”