limit switch question and does it look like i have all the right plan

i have a small door which goes up and down in response to a photosensor via a pulley and dc motor with arduino telling it what to do and i was wondering which limit switches would be the way to go, would something like this get the job done or can i do better.

Also, does this 'schematic' look right in terms of do i need to order anymore parts to make it work. i wasn't sure if running the arduino off the h-bridge 5v output is a good idea.

solar 12V 20W | solar convertor 10A | battery 12 V 12ah | h-bridge L298N ----- (5v output) ---- breadboard -- atmega328pu --- limit switch | 12v dc motor

Since when does the L298N have a 5V power output?

And do yourself a favour. Return the L298 to the museum and get a modern, MOSFET based H-bridge. Or at least remember to crank up the input voltage by 3-4V to compensate for its losses...

What is the motor full load current? Stall current? Post a link to motor and other components' datasheet or seller's webpage. Which Arduino? Where's the schematic?

wvmarle: Since when does the L298N have a 5V power output?

The chip itself doesn't but the module apparently does. https://electronicshobbyists.com/controlling-dc-motors-arduino-arduino-l298n-tutorial/

Your suggestion of using security switches for limit switches depends entirely on the accuracy you need. The magnet will cause the reed switch to open any time the magnet is in the vicinity of the switch. Positive acting microswitches will give quite accurate and repeatable position indication.

Paul

wvmarle: Since when does the L298N have a 5V power output?

And do yourself a favour. Return the L298 to the museum and get a modern, MOSFET based H-bridge. Or at least remember to crank up the input voltage by 3-4V to compensate for its losses...

i'd seen it in examples i saw but i wasn't sure, i took it from a product webpage of the L298N that i can't get to link as mini confirmation it says "5V output if 12V jumper in place, ideal for powering your Arduino (etc)". is there a better way to do it? i wasn't sure if i needed a separate wire and use a buck convertor for the arduino instead.

is this what you mean by mosfet, they're $20 compared to $5 for the L298N. are the advantages using the mosfet one that great?

JCA34F:
What is the motor full load current? Stall current? Post a link to motor and other components’ datasheet or seller’s webpage.
Which Arduino? Where’s the schematic?

i was looking at this motor it’s called a GW370 i was gonna go for 2rpm. my slight worry with it was it might draw too much from battery cause there are smaller ones called a n20 but wasn’t sure about them doing the job cause they’re tiny

im not sure about these terms but i found a kinda specs page here for a 30rpm version of the same motor and the rated current is <0.5A and the stall current is 1.3A i think rated could be the “full load current”.

for the arduino im currently using an uno but i was going to have a go at just using the atmega328 chip in the breadboard to make it more power efficient. not sure what the name for that is technically stand alone chip maybe.

as far as the schematic that’s at the bottom of my first post that’s why i put “schematic” with quotation marks as it is probably a poor attempt and technically would not be one, but i also wasn’t sure it was really needed as it explained it all, my concern was more whether the power going through the h-bridge to the breadboard and arduino was the way to go.

Paul_KD7HB: Your suggestion of using security switches for limit switches depends entirely on the accuracy you need. The magnet will cause the reed switch to open any time the magnet is in the vicinity of the switch. Positive acting microswitches will give quite accurate and repeatable position indication.

Paul

it would probably need to be reasonably accurate as it's repetitive so i am guessing you're saying the magnetic is no good, i was just wondering if the microswtiches with the lever thing are easy for a light door on a pulley to push down? i wasn't sure what you meant by positively acting even from googling it, also from what i've seen they seem to be rated at 125V and 2A is this quite high for the arduino and battery or am i looking at the wrong ones i tried 5V but nothing came up.

I paid no more for my TB6621FNG than a typical L298 module would cost - less than 2 USD I remember.

And that switch will do just fine at 5V.

wvmarle:
I paid no more for my TB6621FNG than a typical L298 module would cost - less than 2 USD I remember.

And that switch will do just fine at 5V.

is this it i was typing mosfet rather than a specific name cause i didn’t know of it. im not sure about it to be honest because looks as tho i will have to solder the pin thingys and it doesn’t have a 5v output i think? do i run a separate buck convertor for the breadboard/arduino/limit switch. thanks for tip about the switch too

Yes, they normally do not have the headers soldered in yet. Trivial. And no, that board doesn't have a 5V regulator included.

Just use your buck converter for your 5V needs, so at least you can power your Uno without worrying the regulator overheats (which it most likely would the moment you add a few LEDs to that Uno). Mind that a mere 100 mA of current means 700 mW dissipation in that regulator, which is pretty much the limit it can handle. An Uno takes some 70-80 mA by itself.

Regarding the switch: that's of course a maximum current/voltage rating, not an operating voltage/current rating. Big difference. No doubt that 125V rating is for AC only, I don't think it'll fare too well if you try to switch 2A, 125V DC with it.

If it is a chicken coop door, use the forum in the upper right for previous “chicken coop” discussions on that subject.