optoisoisolater opto isolator

How to detect an electric current in a secondary circuit (12v)?

Ask QuestionAsked todayActive todayViewed 23 times2

I want to detect if there is an electric current in the wire where I wrote “here > > > > > >” (on the image)
The secondary circuit is a 12v circuit.
How can I do this ?
Thanks !

My simplified shéma

dc-motorcurrentshareedit  follow  close 1flag asked 14 hours agoPacCol2322 bronze badges New contributoradd a comment

1 Answer


I would recommend that you use a Opto Coupler. An Opto coupler consist of a LED (Light Emitting Diode) and a Photo sensitive transistor.

That will create a safety isolation between your motor that creates nasty electrical spikes and your precious Raspberry Pi.

Take a look at the Youtube video for more detailed info https://www.youtube.com/watch?v=pYENAGK8qH4

If you really want to measure the current then is a ACS712 (Current Hall sensor) and since the Raspberry Pi doesn’t have a Analog input a ADS1115 (Analog to Digital converter) that has a I2C interface that Raspberry Pi understand.shareedit  follow  flagedited 13 hours agoanswered 13 hours agoMats Karlsson16377 bronze badges

  • I very much appreciate your answer, concisely giving a good and comprehensive guidance to newbies. Cheers. – tlfong01 14 mins ago    
  • I watched the 4 minutes Youtube video on optocoupler and surprisingly found it also concisely giving a good and comprehensive guidance to newbies. I was particularly impressed by the use of newbie friendly colored text and also the selection of popular components like 2N2222 and PC817 which are widely used in the industry and commercial areas I gave both your answer and the video 5 stars (top 3%). Cheers. – tlfong01 just now   Edit   

add a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.