Burnt my arduino and motor driver when connecting them to a solenoid, but I don't know why

Thread Starter

qingyou

Joined Feb 24, 2024
9
Hi, I am new to electronics, trying to build a whac-a-mole machine based on this tutorial

r/AskElectronics - Circuit of the tutorial Circuit of the tutorial
I am currently just working on one of the solenoid actuator, hoping to make it responding to the state of the limit switch.


r/AskElectronics - Circuit of a single solenoidCircuit of my attempt of making one solenoid work
This is the video of how mine (kinda) worked
https://drive.google.com/file/d/1C7QraJIU0L6SVUsiTP2VwbaIzERnTESl/view?usp=sharing

From the video, you can see the actuator is activated only when the switch is pressed, then after a few tries it is stuck (you can see the spring is compressed with or without switch being pressed ) . The code I used is AnalogInOutSerial from Arduino IDE's Example library.

Then I looked up to the DC power source, it dropped from 12V(the voltage required for solenoid) to 4V, I tuned it up, my motor drive starts smoking and my arduino cannot be recognized by the laptop anymore

My questions are:

1. For the switch, I connected the NC(normally closed) and C terminals. I assume it would be HIGH when not pressed and LOW when pressed, why is it the other way around? Is it has something to do with ACTIVE HIGH and ACTIVE LOW?

2. Why does my solenoid(p3) stops responding?
It's stuck at being activated. (In the later part of the video, you can see that the LED of motor drive actually dims as well, I am not sure if it has anything to do with the current)

3. Why do both of my motor drive and arduino is burnt?
Is it because I tuned up the voltage after it is stuck?

This is the components I used:

limit switch: https://www.amazon.ca/dp/B07YKGL61S?ref=ppx_yo2ov_dt_b_fed_asin_title

Solenoid: https://www.amazon.ca/dp/B01K41EZAU?ref=ppx_yo2ov_dt_b_fed_asin_title

Motor driver: https://www.amazon.ca/dp/B07YKGL61S?ref=ppx_yo2ov_dt_b_fed_asin_title

r/AskElectronics - switch switchr/AskElectronics - solenoidand solenoid
//
PS: Thank you so much for your time of reading through this. I am new to electronics and is working on my first project, any material/ source that can help build a more systematic way of understanding would be really appreciated as well: D
 
Last edited:

crutschow

Joined Mar 14, 2008
38,316
You have no protection diodes across the solenoids to dampen the inductive voltage spike, so that likely zapped the driver output transistors.
You always have to be concerned about inductive transient voltages when controlling any inductive device, such as solenoids, relays, or motors.

Below is an example for bidirectional drive of an inductive motor:
If you are only driving the solenoids with one polarity, then you can add a single diode directly across the solenoid coil (diode cathode to positive side of solenoid).
A 1N400x series diode should be adequate for that purpose.

And turning up the voltage after a failure is observed, is never a good troubleshooting procedure, although it may make it more obvious what has failed. :eek:

1737678457147.png
 

SamR

Joined Mar 19, 2019
5,470
I also see that you have 9V on an Arduino pin. Pins need to be 3.3V or 5V max, so you need a transistor switching circuit and a 9V source. Yes, Arduino can be powered by up to a 15VDC source, but it is then regulated to 5 or 3.3VDC source or sink on the pins depending on which model of Arduino used.
 

MisterBill2

Joined Jan 23, 2018
27,159
Turning up the supply voltage to unstick a mechanical problem lead to excess current, and that lead to smoke as the motor and the arduino were damaged.
What you should learn is that when things get stuck, switch OFF the power.
 

djsfantasi

Joined Apr 11, 2010
9,237
1. For the switch, I connected the NC(normally closed) and C terminals. I assume it would be HIGH when not pressed and LOW when pressed, why is it the other way around? Is it has something to do with ACTIVE HIGH and ACTIVE LOW?
Since the pin inputs are connected with a pull-down resistor, if you connected the NC terminal your schematic shows the NO terminal is connected. Per the schematic when thr switch isn’t pressed, it will be LOW.

How are you powering the Nano? I don’t see any power connections in your schematic shows
 

Thread Starter

qingyou

Joined Feb 24, 2024
9
You have no protection diodes across the solenoids to dampen the inductive voltage spike, so that likely zapped the driver output transistors.
You always have to be concerned about inductive transient voltages when controlling any inductive device, such as solenoids, relays, or motors.

Below is an example for bidirectional drive of an inductive motor:
If you are only driving the solenoids with one polarity, then you can add a single diode directly across the solenoid coil (diode cathode to positive side of solenoid).
A 1N400x series diode should be adequate for that purpose.

And turning up the voltage after a failure is observed, is never a good troubleshooting procedure, although it may make it more obvious what has failed. :eek:

View attachment 341102
thank you so much I will look more into the diodes
 

Thread Starter

qingyou

Joined Feb 24, 2024
9
Since the pin inputs are connected with a pull-down resistor, if you connected the NC terminal your schematic shows the NO terminal is connected. Per the schematic when thr switch isn’t pressed, it will be LOW.

How are you powering the Nano? I don’t see any power connections in your schematic shows
I powered the nano with my laptop, which I think it supply 5v
 

Thread Starter

qingyou

Joined Feb 24, 2024
9
Turning up the supply voltage to unstick a mechanical problem lead to excess current, and that lead to smoke as the motor and the arduino were damaged.
What you should learn is that when things get stuck, switch OFF the power.
TT that's a definitely a lesson learned in a hard way
 

Thread Starter

qingyou

Joined Feb 24, 2024
9
I also see that you have 9V on an Arduino pin. Pins need to be 3.3V or 5V max, so you need a transistor switching circuit and a 9V source. Yes, Arduino can be powered by up to a 15VDC source, but it is then regulated to 5 or 3.3VDC source or sink on the pins depending on which model of Arduino used.
sorry the diagram is a bit confusing, it's pin 9 instead of 9V, I powered it with 5V
 

MisterBill2

Joined Jan 23, 2018
27,159
One more reason I dislike the cartoon channel: projects that don't work, because the instructions left out a lot, to make it seem easy, when actually some part takes a lot of skill and experience to get right.
 

panic mode

Joined Oct 10, 2011
4,864
the third link does not show the module, it is the switches again. but it seem to be the common bridge driver L298N such as this. more info including schematics and Arduino code can be found elsewhere such as here. it is clear that diodes are included which is also seen from the photo.

and Arduinos including Nano have Vin pin which makes it possible to power it from external source such as 9V. there is onboard 5V regulator but in most cases it is linear type and should not be stressed much.

the biggest problem i see is the non-legible "schematics". i would suggest to try marking things clearly.

also when working with anything that is above 5V and involves external PSU, it is a good idea to prepare for the worst - specially when not experienced. for example it may be a good idea to NOT connect your project to your computer. if things go sideways, it can get expensive - you can loose more than Arduino and the motor shield... computer could be toast too. to avoid risk it does not hurt to use USB hub, preferably isolated one.
 

MrSoftware

Joined Oct 29, 2013
2,273
Great time to learn how to swap the processor chip on the Arduino. If the original chip had a boot loader on it you'll need to put one back on. Plenty of info online about it.
 

be80be

Joined Jul 5, 2008
2,394
If you did this like you show you have a short at pin A0 And what ever that pin is on your drawing across from it

You send your five volts strait out to two out puts
 

sarahMCML

Joined May 11, 2019
695
Those are normally made like this

Your schematic is wrong in several ways.
The 7805 section of the module supplies the logic section of the L298N device, on pin 9. The Motor power connects to pin 4.
On the module, the output of the 7805 should go to pin 9 directly, with the lower end of the C1, R1, D1 section to common.
 
Top