/* 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}

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.

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.

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.

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

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

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.86VWhen 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?

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 ?

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.