My current project is to run two synchronized linear actuators with incremental optical feedback (3-wire) with an arduino uno and two IBT-2 motor drivers. Im using a dpdt switch ( but using it as a spdt) to extend or retract the actuators. Im powering the board and drivers from a 12V car battery into the V_in pin. then using the 5V output to give the power for the optical sensors.
I have the code mostly sorted but while working through some bugs i have somehow blown my two switch pins.
i had the switch functioning as it should for a few days
using:
pinmode(switch_pin1, INPUT_PULLUP) // switch pin 1 connected to Digital pin4
pinmode(switch_pin2, INPUT_PULLUP) // switch pin 2 connected to Digital pin5
and the third switching leg to arduino GND pin
everything was good there, until i got sporadic results suddenly. Switching the switch pin 1 and switch pin 2 to pins 7 and 8 respectively and adjusting the defined pins in my code got me back to expected results.
my question is what happened? i cant have this system blow up down the road for the same reason.
Am i supposed to have a current limiting resistor in this setup? Everything i read online tells me to connect one leg of switch to GND and the other to the digital pin to use, setting the internal pullup resistors(input_pullup). It is possible that i accidentally commented out the "pinmode" section of my code briefly and uploaded it, could this have done the damage? or i may have run the my code while only connected to usb, and power to v_in switched off.
I will make another post for my coding questions but i would like to make sure my circuit is safe and reliable before doing any more damage.
heres a link to the actuators if needed:
and the motor drivers:
im using a switch very similar to this (but not this exact one):
*Unable to show connections as everything is all packed into the enclosure. hopefully wire diagram (ms paint) shows it clearly
Well something clearly but from your description you did nothing wrong.
Am i supposed to have a current limiting resistor in this setup?
No.
t is possible that i accidentally commented out the "pinmode" section of my code briefly and uploaded it, could this have done the damage?
No. Pins default to inputs on reset so the worse that could happen is that not enabling the internal pull up resistors would leave the input floating, that is the two inputs could have been any value, including the same logic level which is not possible with inputs.
Ok good points. I should give more info. This system will end up in a camper trailer to open a large service window. The entire trailer will have a 12v circuit handled by a blue sea controller, with the option for shore power, 12v alternator inputs, ac outputs etc. it will have a bank of deep cycle or lithium batteries to power everything. The controller sort of buffers everything as well.
But for now I had this unit connected to a loose car battery, with a charger/maintainer attached. I guess that this unit could have caused a spike...
Also. One of the actuators does have a long run of wire to it; about 20ft.
So, should I be adding an additional voltage regulator? Is the v_in pin easily damaged by spikes or over/under charge? I’ve read that the recommended voltage is 7-12v but the limit is 6-20v. But I’ve heard mixed feelings about over 12v supply voltage. Is there any more or less protection if I use the barrel jack instead of the v_in pin?
Grumpy_Mike I need to study Those links. But it sounds like that could be an issue for me. So would I need a protection circuit on just the signals wires to the Arduino and the switch inputs or do I do the same for my 5v line that runs from the Arduino a long distance to the actuator encoder
If you are running 12v supply and powering sensors from the 5v you could well be over heating the regulator .
It has to dissipate ( 12-5)x I watts ( Where I Is the total current) . So 12v input is ok , if you are not taking much current from the 5v output.
Ok. Thanks for all the suggestions. So for starters, i’m considering getting this dc dc converter:
So 12ish volts in to the adapter, power the Arduino through the usb output(5v) Power the 2 encoder leds from this adapter as well. The switch could be changed to a pull down setup, getting its 5v from the adapter. (This also should prevent the actuators from going crazy if something goes wrong again, since when the pins blew up last, the actuators tried to drive on their own, almost wrecking my door).
Thoughts? Or suggestions on a better converter that can be shipped to me quickly.
I wouldn’t use pull down resistors, much better to use external pull ups as you can make them stronger than the internal ones. They are about 35K but for a noisy environment I would use 1K.
Hi,
Before you have a fire, where are your fuses?
One for each motor controller.
One for the UNO.
A main fuse.
I can't see a master ON/OFF switch to disconnect your project when you start to look for problems.
Do you have a indicator light to show that it is powered up.
A Lead Acid car type battery will happily throw 100's of amps through a short circuit if given the opportunity.