Go Down

Topic: 5v solenoid and arduino // Tip120 system (Read 3023 times) previous topic - next topic

beyondal

Jan 31, 2014, 01:42 pm Last Edit: Feb 01, 2014, 01:17 am by beyondal Reason: 1
I did some research to drive a 5v solenoid with the tip120 the n4001 diode and an arduino to do something simple as the blink sensor.

It 'arms' itself but that's it. It doesn't 'unarm' itself.

I would like to give it a fast on/off sequence based on milliseconds or other possible way.

Pictures :  http://www.dewildequinten.be/11.JPG
                    http://www.dewildequinten.be/12.JPG
                    http://www.dewildequinten.be/13.JPG

Code:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(8000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(8000);               // wait for a second
}

CrossRoads

Picture? Schematic? Code?
Solenoid example:
https://www.sparkfun.com/products/11015
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

beyondal


Picture? Schematic? Code?
Solenoid example:
https://www.sparkfun.com/products/11015



Update!


JimboZA

#4
Feb 02, 2014, 10:45 am Last Edit: Feb 02, 2014, 10:49 am by JimboZA Reason: 1
I'm not sure what your question is, tbh.

Forget the Arduino logic and the transistor and the diode... when you put 5V across the solenoid and take it off again, does it shoot in and out?

If that's not working then that's one question; if that is working, but doesn't do that with your Arduino based way, that's a different question.

You can't really expect anyone to unravel your circuit from the photos. But on the face of it, if your transistor base is simply connected to pin 13 then yeah I guess the solenoid should "blink".

Ooo hang on, I think you might have the diode the wrong way round... looks like you have cathode to collector and anode to positive. That makes sense on the face of it, but this diode is supposed to be back to front, cathode to the positive supply. EDIT- Look carefully at the pic Crossroads posted a bit above.
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

beyondal


I'm not sure what your question is, tbh.

Forget the Arduino logic and the transistor and the diode... when you put 5V across the solenoid and take it off again, does it shoot in and out?

If that's not working then that's one question; if that is working, but doesn't do that with your Arduino based way, that's a different question.

You can't really expect anyone to unravel your circuit from the photos. But on the face of it, if your transistor base is simply connected to pin 13 then yeah I guess the solenoid should "blink".

Ooo hang on, I think you might have the diode the wrong way round... looks like you have cathode to collector and anode to positive. That makes sense on the face of it, but this diode is supposed to be back to front, cathode to the positive supply. EDIT- Look carefully at the pic Crossroads posted a bit above.




The solenoid works.

I switch the diode two ways, with the ring to the transistor it gives me nothing, other way around also nothing.


JimboZA

Post a schematic of how you connected: those photos are about impossible to follow.

Where's the solenoid getting the 5V from btw?- not from Arduino I hope.
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

beyondal

If I connect my resistor to my arduino directly it works, when theirs a wire between it just to lengtify it.
It doesn't work. Common madness????

Now my solenoid works but gets hot, after 20 seconds it gets hot but still touchable?



beyondal

Now another thing, when I put the same wiring over to my trinket. It just goes on/off superfast.

even when changing the delay on my sketch it doesn't change?


TomGeorge

#9
Feb 15, 2014, 12:08 am Last Edit: Feb 15, 2014, 12:09 am by TomGeorge Reason: 1
Hi, can you tell us  YES or NO, are you getting the 5V for the solenoid from the 5V on the arduino?
If yes, then stop, you need a separate 5V supply for the solenoid.
Also, a schematic is a circuit diagram, even a picture of a hand drawn circuit would help.

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running......VK3DMK

hithwen

#10
Apr 01, 2014, 04:17 pm Last Edit: Apr 01, 2014, 04:58 pm by hithwen Reason: 1
Why can't you feed it from the 5v of the arduino? I mean, if there's a transistor in the middle.

I'm pretty new to all this,  just asking

TomGeorge

Hi, yes you can control the current to the solenoid with the arduino and a transistor, however the current supply that runs through the solenoid and the transistor must not be from the arduino but a separate supply with enough current to actuate the solenoid.

Also what is the spec of the solenoid, how much current is it supposed to draw?

Please can you post a picture or CAD drawing of  your circuit diagram, the pictures are  a great help, just that you look to be powering the solenoid from the arduino.

Trouble shooting is a logical, systematic process to solve problems quickly and EFFICIENTLY, a circuit diagram will save soooo many replies, ours and YOUR tme.

Thank you
Tom.. :)
Everything runs on smoke, let the smoke out, it stops running......VK3DMK

fanofard

Hi,
I am not opening new thread, as I am playing with the similar circuit, but I use different transistor (I tried also TIP122).
Ihave 12V solenoid which I want to supply from 12V lead acid battery.
Open circuit battery's voltage: 12.86V
When I connect the solenoid to the battery directly, it draws  0.33A, voltage measured on solenoid is 12.52V

But when I switch the solenoid via the transistor BD237 (see schematic attached), then the voltage measured on solenoid is only 10.5V. But when I disconnect the load (solenoid) and keep the transistor active (turned on) - then the voltage is ~12.86V - so the same as on battery without any load. Why there is so much voltage drop via the transistor?

Sorry, I am a newbie and I knows only very basics about the transistors. When I check the specification of BD237, then there is Ib specified as 1A dc. Does it mean it needs 1A current for "fully turn on"?
Before I tried this BD237 I used also TIP122, but I also had large voltage drop.
Can anybody help me what I am doing wrong? Is it enough when I put 1K resistor before the base of the BD237 / TIP122 and use 5V from the arduino's pin? Ib of the TIP 122 is specified as 120mA. Arduino's pin can supply 5V and via 1k resistor the current will be 5mA --> is this enough? Is this the source of my problem?


malkindy

i started my design using this simple Tip120, then i thought i could be more sophisticated so i went for the L298N so i can use the enable pin. but it seems the it is not clear to me how to connect the solenoid, is the output of L298n similar to the collector of the TIP120? and i connect the other terminal of the solenoid o the power supply ? ::)  ::)

JimboZA

#14
Nov 23, 2014, 06:35 am Last Edit: Nov 23, 2014, 06:36 am by JimboZA
The L298 puts out a voltage across two pins (or two pairs of pins actually, since it can drive 2 motors). A motor (or I suppose, a solenoid) is connected across pins 2 and 3 or 13 and 14.

The output on those pins is at the voltage supplied on pin 4 (+) and 8 (gnd) (less at least 2v drop, maybe even 5v drop), in response to and of the same polarity as the signal on pins 5 and 7 or 10 and 12, which respectively need enabling on pins 6 or 11.

The attached pic shows 2 motors on a 298.
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

Go Up