Would that work as a "high" voltage input?

Hello everyone!

I have an external setup of a controller and it's actuator- which consists of inductive solenoids.
I need my Arduino to see the status of those (see if they're activated)
Using resistor divider is suboptimal (I think), since the load is inductive.

Here is something I came up with

In my head it should all work fine:

  • 3.3V on input when inactive
  • about 0.6V when powered, which will read as logical 0

But somehow I am in doubt now, since I don't really remember seeing anything like that implemented.

I also want to use that as a kind of an AND Gate, to see if any channel is activated, with just one input of Arduino

The design is done, and the board is on it's way, so it's a perfect moment to check with you, guys: will that even work? :smiley:

Thank you!

People usually build the circuit on a breadboard and test it before ordering a circuit board.

2 Likes

That's too boring, come on :stuck_out_tongue_winking_eye:

Jokes aside- I have ran some simulations for concept proofing with positive results, but could be that I am missing something
So here I am, to double-check

1 Like

When the MOSFET is turned ON, what will it's drain voltage be?

Oh yes, that sound like something I am missing
It's a pretty power intense system, so I doubt it's higher then 0.15-0.2V
I guess it won't result in input being more then 1.5 to become logical 1

Use Schottky diodes instead of "common" diodes so you have around 0.2V instead of 0.6/0.7V for low state.

1 Like

An optocoupler with limiting resistor in parallel with the actuator is safe and reliable.

1 Like

Oh yes, that will give it a lot of headroom
Thanks!

But i it safe to use those with inductive stuff?

Why wouldn't it be?

Why 3.3volt. The Every uses 5volt-logic.
Why the resistor. Internal pull up on the pin should be the same.
Only three diodes should be needed.
I doubt you need Schottky for that (no harm done), 1N4148 should work.
Make sure your actuators have a diode across.

The above will only work if grounds can be shared.
If not, then use opto couplers, which should be safer for the Every anyway.
Leo..

3 Likes

The kick-back voltage..? Sorry, I am obviously not too qualified :sweat_smile:
I mean if it overshoots rated reverse voltage of Schottky

Sorry, this piece is just an illustration, the real project uses 2040 connect

I just prefer hardware pull-ups, can't give you a good reason for that though :slight_smile:

They surely can :ok_hand:

Thank you!

But the coils are supposed to have diodes in anti-parallel (and if they don't have them you should put them because you can fry the mosfets).

1 Like

Yes, sure, they definitely do :man_facepalming:
Thanks for your patience with me, hehe)

Some remarks:

Why pull-up to 3.3V? The Nano Every can handle 5V.

Why analog input? You want a yes-or-no, so digital input is good enough.

Be aware that when using 3.3V for pull-up a digital input detection of ‘1’ usually works, but is not guaranteed.

Internal pull-up will work too.

The fly-back diodes across the coils to protect the MOSFETs will not affect your input.

Assuming that the solenoids have kick-back protection your circuit should work fine.
The nano every is 5V so I'd supply R2 with 5V and decouple the 5V to ground with a cap.
With normal silicon diodes you would then be within the specified voltages for logic levels so you can use a digital input.
VIH = 3.0V; Vih = 2.6V; Vil = 2.2V; VIL = 1.5V
I'd also add a small capacitor from the digital input to ground to match the capacitance of the diodes.

Be aware by doing so you potentially lose useful information.

Sorry about the confusion, guys
It's not actually Every, but RP2040 Connect, hence 3.3 logic

Thank you all for your input!

Hello again!

Just a little something that I am thinking about lately
A reverse recovery time. I think it's not an absolute zero even for Schottky's, so my worry is about MCU receiving 12v on it's input after a mosfet has opened.

Would that be wise to add like 1nf cap in parallel with a pull-up, to consume the peak, or is it something really negligible in my type of application?

R2 will back feed a positive voltage to R1 through D1. Since R1 has a higher voltage, no current should flow. D1 prevents the back feed, so it should work as expected.

1 Like

Reverse leakage current is more important. Schottkys usually have higher leakage that silicon.

Hmm, I really don't think it would make voltage exceed i/o limit. Do you?

I think I confused myself and everyone with "Mosfet has opened"
What I meant is Q1's Drain going from 0V back up to 12V (from R1)
Could those momentarily make it's way to the I/O pin causing damage, or should I not really overthink that?