Pages: [1]   Go Down
Author Topic: 5v solenoid and arduino // Tip120 system  (Read 2395 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
}
« Last Edit: January 31, 2014, 07:17:11 pm by beyondal » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 545
Posts: 27353
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* coil_drive-motor-solenoid-relay.jpg (24.79 KB, 960x720 - viewed 143 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 1
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Update!
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nobody an Idea?



Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 105
Posts: 4673
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 02, 2014, 04:49:05 am by JimboZA » Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Newbie
*
Karma: 1
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 105
Posts: 4673
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Newbie
*
Karma: 1
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1612
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.... smiley
« Last Edit: February 14, 2014, 06:09:56 pm by TomGeorge » Logged

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

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: April 01, 2014, 09:58:37 am by hithwen » Logged

Victoria, Australia
Offline Offline
Edison Member
*
Karma: 46
Posts: 1612
Electronics Engineer/Industrial Control
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.. smiley
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?



* Scanned Document.jpg (58.88 KB, 1228x969 - viewed 4 times.)
Logged

Pages: [1]   Go Up
Jump to: