Pages: [1]   Go Down
Author Topic: Turning on when pulling low  (Read 1418 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure the best way to ask this.  I am still a super newb and do not know the proper lingo.

I have a small circuit I am working on and thought you guys might be able to help.


I have an LED that I want to turn on when pinX is LOW.  I want it off when pinX is HIGH or high impedance (INPUT).  I would normally would just sink the current back into pinX but it raw more current then I am comfortable sending back into the arduino. I am pretty sure I could use a NPN transistor with pinX hooked up to the base (tell me if I am wrong) but I am worried what will happen when the pin is left floating (INPUT mode).  Will current flow from the collector to the emitter is the base is "floating" on a NPN transistor? Is there a way to pull the base high except when pinX is set to LOW?

That being said I could be completely wrong in all my assumptions.  Any help is appreciated.

Logged

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Greetings,

You're wise to be concerned about sinking too much current, but the 10mA of a single LED is probably fine, but adding a transistor buffer will let you sink much more. Here is a simple inverting buffer that will do what you want. Be aware that this inverts, such that a high on the base of the transistor turns it on and sinks the current through the LED. Transistors are current devices, so a low on the output of the Arduino or a high-impedance output will not turn this transistor on.

Regards,
David

                ^
               / \ +5V
               ---
                \
                / 220
                \ Ohm
                /
                |
               ---
               \ / LED
               ---
               /
            | / C
   10K   B  |/
--/\/\/\/---| NPN = 2n4124
            |\
            | \ E
              _\|
                |
                |
               ---
                -
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34184
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That circuit should work. The Arduino can sink 20mA so providing your resistor is above about 200 ohms then you are fine. High impedance or high output are the same, as the voltage drop across the system is zero so no current flows. No need for transisors.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I understand.  Let me explain what I am trying to do.  I have this circuit.



If I bring set

A = OUTPUT, HIGH
B = INPUT
C= OUTPUT, LOW
LED #1 lights up

A = OUTPUT, HIGH
B = OUTPUT, HIGH
C= OUTPUT, LOW
LED #1 and #2 light up.

I can light up any of the 6 LEDs with various combinations of the pins.  I am trying to expand this out to a 11x10 grid but I want to shunt the power away from the arduino.  I hope this makes sense.  The goal is to make each pin activate the ground for each scanline and the remaining pins to turn on the right LEDs.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34184
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you are pretty confused here, I have never seen anything like this. I followed what you said about various pins being outputs and it will work as you explained but it is not an extensible circuit.

Your line:- " I want to shunt the power away from the Arduino" is the one I am having difficulty understanding. Just what does it mean? shunt means to bypass but the Arduino is controlling the current so I don't see it making sense.

A matrix works by putting rows and coloums high and low and letting the current flow through the LED resistor and driver (Arduino or transistor)

Sorry but you have lost me. Perhaps if you could state what you want to do I could help more.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I am not sure the proper terminology to use.  smiley-sad  

I want to have a 10x10 grid of LEDs that I can control via the arduino.  I thought that I could accomplish this by turning on and off the LEDs is rapid succession.  I can setup a matrix of 10x11 LEDs and turn on any 1 particular LED based on the state of the pins.  Unfortunately I am not able to cycle through all 100 (I ignore the last row) LEDs fast enough to create a persistence of vision scenario.  Luckily I can turn on multiple LED at the same time (one row at a time).

The problem is if all 10 20ma LEDs in a row are on at the same time the LOW pin with need to sink 200ma.  I don't want to sink that much current.  That is the max the chip can sink.  I want to have a nice safe buffer.  I would like to direct that current directly to ground but only when the controlling pin is LOW not when it is HIGH or in INPUT mode.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34184
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK I see now.
Basically you need a conventional matrix scanning circuit.

Hears one I made earlier http://www.doc.mmu.ac.uk/STAFF/A.Wiseman/Acorn/articles/RTR1998/(RTR48)
It was designed, in 1998 for a PIC to drive and it is 20 X 7 but it will be drivable from an Arduino. I used four 5X7 matrix displays but you can just as easily make them up from individual LEDs if you want.

Also see the links on:-
http://www.arduino.cc/playground/Main/InterfacingWithHardware
That are to do with LED matrix driving.

Yes you need external buffers to drive that amount of current it's too much for the basic chip. These come in all shapes and sizes from transistors and FETs to ICs. Some ICs will do some multiplexing for you but most are based on an 8X8 grid. The advantage of my circuit is that it can be expanded to any arbirtary size.
Logged

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
42 The answer to life, the universe, & Everything
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hears one I made earlier http://www.doc.mmu.ac.uk/STAFF/A.Wiseman/Acorn/articles/RTR1998/(RTR48)
It was designed, in 1998 for a PIC to drive and it is 20 X 7 but it will be drivable from an Arduino. I used four 5X7 matrix displays but you can just as easily make them up from individual LEDs if you want.
.

Dead Link

Also That matrix looks like charlieplexed
(two or more leds reversed biased)


Pin 1  --|----|
          ---   ---
           \/    /\
          ---   ---
Pin 2 ---|----|
when pin 1 is pulled High and pin 2 low the first Led will turn on
when pin 2 is pulled High and pin 1 low the second Led will turn on
« Last Edit: June 20, 2008, 01:04:02 pm by biojae » Logged

42 is the answer, but what is the question?

http://www.nerdtests.com/ft_nq.php
[img]"http://www.nerdtests.co

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
42 The answer to life, the universe, & Everything
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh, also Pnp transistors turn on when pulled to ground
Logged

42 is the answer, but what is the question?

http://www.nerdtests.com/ft_nq.php
[img]"http://www.nerdtests.co

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

not quite
Logged

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
42 The answer to life, the universe, & Everything
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also in the circuit you can't use transistors, because they are only two state ((either High or High impedance) or( Low or High))

Pnp transistors do turn on when pulled low, oops  smiley-grin forgot to mention that they Have to Be saturated (More ASCII art  ;D)
Code:
    __________VCC
    |           |
------|/|_______| PNP Transistor
      |\|
         \
        ---  LED
         \/
         ---
          \____/\/\/\___GND
[/font]
Logged

42 is the answer, but what is the question?

http://www.nerdtests.com/ft_nq.php
[img]"http://www.nerdtests.co

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
42 The answer to life, the universe, & Everything
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here I am going to make a table for the Led states
Code:
   A     B    C
1   H          L
2         H    L
3   L     H  
4   L          H
5   H     L
6         L    H
Logged

42 is the answer, but what is the question?

http://www.nerdtests.com/ft_nq.php
[img]"http://www.nerdtests.co

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34184
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
Hears one I made earlier http://www.doc.mmu.ac.uk/STAFF/A.Wiseman/Acorn/articles/RTR1998/(RTR48)
It was designed, in 1998 for a PIC to drive and it is 20 X 7 but it will be drivable from an Arduino. I used four 5X7 matrix displays but you can just as easily make them up from individual LEDs if you want.
.

Dead Link


Sorry but the last ) did not seem to be part of the link, although it is inside the URL field. The link is still active It is a tif diagram, remove the last bit to get at the page.
http://www.doc.mmu.ac.uk/STAFF/A.Wiseman/Acorn/articles/RTR1998/(RTR48)

EDIT It's done it again. There must be some automatic function on this forum that is removing the trailing brace. Ok for you who like a single click try one further up:-
 http://www.doc.mmu.ac.uk/STAFF/A.Wiseman/Acorn/articles/RTR1998
« Last Edit: June 23, 2008, 05:07:42 am by Grumpy_Mike » Logged

California
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
42 The answer to life, the universe, & Everything
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that looks like it is just a regular multiplexed led matrix, not the charlieplexed one that he has.

I just thought up a way that you can control it with transistors (more ascii art! smiley-razz)

Code:
arduino pin
           |_____
           |     |
           \     \
           /     /   Appropriate resistors (1k or so)
           \     \
           /     /
           |     |
      NPN ----   ---- PNP
          | --   | /\
          | \/   | --
          |  |   |  |
          |  |   |  ---- VCC
          |  |   |___________
          |  |_______ GND    |________ Matrix Pin
          |__________________|
[/font]
(repeat for each pin)
when the arduino pin is pulled high, the matrix pin is pulled low
when the arduino pin is pulled low, the matrix pin is pulled high
its sort of like an inverter
Logged

42 is the answer, but what is the question?

http://www.nerdtests.com/ft_nq.php
[img]"http://www.nerdtests.co

Pages: [1]   Go Up
Jump to: