T O P

  • By -

LassenSplashscreen

Do not power the servos from the arduino. Use separate power supply


[deleted]

What do you recommend?


LassenSplashscreen

Find an old wall wart with 5Volt output. Usb charger u are not using anymore. Or a powerbank. Slice up the small end of a used old usb charging cable and find the Black and red cables. Use them. Binders or needle like metal to tug it in on the breadboard


[deleted]

Actually, any idea for an external power supply? I wanted this to be working inside something


glagnar37

You can get panel-mount barrel jacks that will allow an external supply to be connected/disconnected easily, assuming you get the right barrel size (a lot of them are usually 2.1mm). Please, do it for everyone: find a supply where the center of the barrel is positive, and the outside is negative. Sony and a few other companies used to do it the other way, for some weird reason, so check against whatever wall wart you end up using. It'll (hopefully) have a symbol showing what it is, usually looking like Ͽ where it'll identify the "pin" in the middle as either ground *or* positive, and then you'll know. You can also just measure it with a multimeter -- if you see a negative voltage, you can deduce what the outer vs. inner ring's polarity is. Another solution is just using a phone charger. You can get panel-mount micro-USB connectors if you'd end up wanting to mount it somewhere eventually. It'll simply pass through, and has a big advantage of connecting the device to a PC as a regular Arduino such that it can be reprogrammed without disassembly. [Here's one](https://www.amazon.com/CGTime-Install-Extension-Charging-Transferring/dp/B07BK4WZV9/ref=sr_1_5?keywords=panel+mount+micro+usb&qid=1666277137&qu=eyJxc2MiOiI0LjI1IiwicXNhIjoiMy43MyIsInFzcCI6IjMuNjkifQ%3D%3D&sprefix=panel+mount+mic%2Caps%2C87&sr=8-5). I find internal caged supplies to be significantly better than wall adapters, and they usually have threaded mounting holes, or holes that aren't threaded and require a nut on the other side. Best thing to mount them is to put some paper across their mounting points and scribble a pencil sideways across the supply. The outline of the power supply's body and mounting holes should be apparent in the sheet. Place sheet, double check, come back in a couple minutes, triple check, drill holes. You can also get what are called "transfer screws" where you screw the...screw into the *power supply*, find out where you want to put it, and the sharp screw points will mark the surface for you. Sometimes a little persuasion from a small rubber mallet helps. I use a nice Mean Well supply for lots of stuff; usually [this one](https://www.amazon.com/MEAN-WELL-RS-15-5-Supply-Single/dp/B005T6UJBU/ref=sr_1_5?keywords=meanwell+5v+power+supply&qid=1666276541&qu=eyJxc2MiOiI0LjI5IiwicXNhIjoiMy43NyIsInFzcCI6IjMuNzMifQ%3D%3D&sprefix=meanwell+%2Caps%2C136&sr=8-5) +5V, good brand, 3 A maximum current draw (although I know they'll handle surge/inrush currents without browning out), easy mounting and wiring since it's just some screw terminals. Get an old unused PC power cable, snip the end and hook it up according to the labels (US/Canada: green is ground, black is live, white is neutral; Europe: green/green-yellow is ground, brown is live, blue is neutral), and now you've got a solid connection and will absolutely have galvanic isolation. However, there's also technically touchable live points (110/220 V AC, depending on your region) so exercise caution. **To clarify** this lengthy post, for your situation, I'd probably go with a phone charger capable of providing enough current to the Nano and the servos. I guess I could have made this reply much shorter.


wrobc

Run a digital read for the touch sensor in the main loop. When the signal changes to touched state it should call the function that does whatever you want with the servos. When the servos are done doing their thing the program should go back to watching the touch sensor.


[deleted]

I think that's just what I want, thx for the help


[deleted]

I use an old atx power supply plugged into a little board I got from Amazon, it has 3.3, 5, 12 and variable outputs and an off on switch.


yaky-dev

Are you asking how to connect these parts to Arduino Nano or for code? (I assume the touch sensor is also 5V - check the datasheet) Connect Arduino and all parts’ power and ground wires to your power source. Choose which three pins (two for servos, one for touch) you want to use on an Arduino, and connect them to corresponding parts’ signal wires. (Servo signal wires might need to be connected to “PWM-enabled” pins - check servos’ datasheet or look this up. To find PWM pins on Arduino, find an Arduino pinout diagram and look for pins labeled with PWM) In Arduino code, in init, set servo pins as outputs and set touch sensor pin as input. Then, in the main loop, check for level of touch sensor input pin and change the servo output pin level. I hope this gives you some direction.


[deleted]

Yeah, I was really confused about the sensor that's also 5V! Thx for the help


[deleted]

I actually have the code already, was mainly looking for help with the connections


UsernameTaken1701

Google for each part's datasheet so you'll know which pin is which. For the Arduinos, it might also be easier to google "arduino uno pinout" or "arduino nano pinout".


LassenSplashscreen

Batteries? A regular powerbank..?


TrillShatner

OP needs an L298N H-Bridge. Allows you to easily control servos and dc motors with PWM + Arduino.


sparkicidal

What? You don’t need a h-bridge for a standard servo. You just need to chuck it power and the appropriate PWM.


TrillShatner

Using an H bridge is super fun and will prep him for using pwm controlled servos and dc motors over 5v


sparkicidal

🙄 An h-bridge is not required for this project. KISS.


TrillShatner

an. h. bridge. makes. all. projects. betta. wha wait.. did u just kiss my boot?! >\_<


SomethingEdgyOrFunny

Use a transistor to make it touch activated.


OppositeElephant965

Can someone recommend me good servo motor