Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Controlling two solenoids

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    3

    Controlling two solenoids

    I have a project that controls two solenoids. I originally set it up with an Uno, and then switched it over to a Teensy 2.0 so everything would fit on a single small breadboard and into a small project box.

    Everything works on both setups with the exact same code (except changing PIN numbers for the Teensy), except one thing.

    On the Uno setup I have two pins from the Uno go to the respective first pins of the TIP120 transistors that control the solenoids. Pin 2 of each TIP120 goes to the ground of the solenoids. There's a 2.2K resistor between pin 1 and pin 3 of each transistor. A wire connects pin 3 of both TIP120s, and pin 3 from one of the transistors is connected to the ground of the 12V power supply. Lastly the live connections from both solenoids are connected, and then from there are connected to the 12V power supply.

    This works perfectly on the Uno. On the Teensy only the solenoid that connects directly from pin 3 of of TIP120 to the 12V power supply is activated. The second solenoid is never activated, even though it's wired exactly the same as on the Uno. Any ideas why this setup would not work on the Teensy?

    I've tried replacing the transistors, the resistors, the wires, and nothing seems to help. I can't figure out if there is something electrically different going on because of the Teensy. I can't imagine what that would be, but it seems like there is some difference that I'm not recognizing. Any help would be greatly appreciated.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Arduino Solenoids Drawing.jpg 
Views:	14 
Size:	236.3 KB 
ID:	16095  
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Mar 2019
    Posts
    3
    This is the version with the Teensy. The only thing not accurate is it actually has a breadboard power supply on the breadboard. I didn't have that part in Fritzing, so I just connected the power plug to both sides since that what it does.

    Click image for larger version. 

Name:	Bathtub Project Teensy 2_bb.jpg 
Views:	11 
Size:	84.8 KB 
ID:	16110

  3. #3
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,876
    Some suggests steps, apologies if you have already done these:
    Have you already swapped the solinoids/drive transistors/control pins?
    Have you used a multimeter to check the IO pins actually switching?
    Have you used the basic blink code to activate the pin (removing all your project code from the equation)
    Have you confirmed voltages around the three drive transistor pins?
    with Teensy disconnected/off/loaded with blank code manually driving the transistor with 5V

    First guesses based on mistakes I have made:
    transistor wired to a different pin than the one code controls
    IO pin damaged due to misconnected 12V.

  4. #4
    Junior Member
    Join Date
    Mar 2019
    Posts
    3
    Quote Originally Posted by GremlinWrangler View Post
    Some suggests steps, apologies if you have already done these:
    Have you already swapped the solinoids/drive transistors/control pins?
    Have you used a multimeter to check the IO pins actually switching?
    Have you used the basic blink code to activate the pin (removing all your project code from the equation)
    Have you confirmed voltages around the three drive transistor pins?
    with Teensy disconnected/off/loaded with blank code manually driving the transistor with 5V

    First guesses based on mistakes I have made:
    transistor wired to a different pin than the one code controls
    IO pin damaged due to misconnected 12V.
    Thank you for your help. I have both versions, which connect via a cable to the solenoids. The Uno version works fine, so I know the solenoids are good. I've swapped the transistors, including putting the one from the working solenoid into the spot for the non-working solenoid, and it still doesn't work, so I'm pretty sure the transistors are okay. I've tried swapping the wires and resistors, and no difference.

    I've tested the pin with a multimeter and it goes high when it should. I think I've tested the transistors properly, although I'm not certain, but they seem to be working. I'm running out of things to test...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •