user8033: I accidently bought a "Common Anode" 7-segment display instead of a "Common Cathode".
I understand that the polarity of the leds within the display is 'reversed'. So instead of putting the common pin on GND I have to put it to 5v (with current limiting resistor)
My questions on this are:

Can I still use only one current limiting resistor on the common pin? Instead of a resistor on every segment pin.
Can I use the pins from arduino to drive it (withouth pull-up/pull-down?) By making the signal LOW the current will flow from 5V common anode to the arduino and thus the segment wil light?
Can I still use a shift register to drive the segment led? (By inversing the outputs (in software))


Obviously I would like to have wiring more like this (but then I would ofcourse change  the GND line to a 5V line.


The wiring below is the worst-case wiring I can think of.

^ So can I avoid this, when using a Common Anode 7-segment display or am I forced to buy a Common Cathode 7-segment display?

user8420: Peter and Gerben have already said what is needed , but I wish to explain things even further.
A normal small 7-Segment display consumes only 70-80mA when all segments are HIGH.So you can use the Arduino directly without damaging it. Also note, depending on the quality of the project, you could either use a common resistor for all segments, or use separate ones. Separate ones will give much brighter light and better quality.
A medium size one will require max consumption of around 400mA current, so use cheap transistors.
A large size one will require max consumption of upto 1.5-2A current , so use MOSFETS or other high current Transistors.
An Extra Large one will require max consumption of upto 10-25A current, so use good MOSFETS or maybe even Relays.
Usage
Small- Wrist watches
Medium- Small clocks
Large- Big clocks
Extra Large- Very big clocks like ones in Railway stations


user42: You can use a single resistor on the common pin if you want. The problem is that lighting up multiple segments at the same time will substantially reduce the brightness of each one. You could work around that by lighting each segment one at a time in very quick succession though.
It should be possible to control the display directly from the IO pins by setting them LOW. In this configuration, they will be sinking current (rather than sourcing it). It depends on the specification of the display and on what resistor you use though.
Basically, try to keep the current below 20mA and it should be OK (assuming you're using a standard 5V Arduino). For example, if each segment has a forward voltage drop of 2V, you would want to use a resistor of around 180 Ohm.
Controlling the display directly from a shift register is probably not possible, although once again it depends on its specification. Shift registers usually aren't designed to sink enough current so you'll need something like a transistor on each output.

user2881: Sorry about the crudity of my image, but you don't always need those transistors. Peter has already said so, but I wanted to explain a bit further.

The only thing is that you need to set a pin to LOW to light up the led, and HIGH to turn it off. Just use a ! to make your code more intuitive if your like. So e.g. digitalWrite(segmentA, !HIGH)
Some limitations. A pin can sink up to 40mA (no problem here), but the total sink current for the digital pins 0 to 4 shouldn't exceed 100mA. The same goes for pins 5 to 13. And the same goes for the analog pins. So either limit the current through the leds to around 10mA, or make sure no more than 5 leds are lit at the same time, or connect half of the segments to on of the above mentioned groups, and the other half another (f.y.i. analog pins can be used just like digital pins).

8033: <p>I accidently bought a "Common Anode" 7-segment display instead of a "Common Cathode".</p>

<p>I understand that the polarity of the leds within the display is 'reversed'. So instead of putting the common pin on GND I have to put it to 5v (with current limiting resistor)</p>

<p>My questions on this are:</p>

<ol>
<li>Can I still use only one current limiting resistor on the common pin? Instead of a resistor on every segment pin.</li>
<li>Can I use the pins from arduino to drive it (withouth pull-up/pull-down?) By making the signal <code>LOW</code> the current will flow from 5V common anode to the arduino and thus the segment wil light?</li>
<li>Can I still use a shift register to drive the segment led? (By inversing the outputs (in software))</li>
</ol>

<hr>

<p><strong>Obviously I would like to have wiring more like this</strong> (but then I would ofcourse change  the GND line to a 5V line.</p>

<p><img src="https://i.stack.imgur.com/S6MnF.jpg" alt="Better wiring"></p>

<hr>

<p><strong>The wiring below is the worst-case wiring I can think of.</strong></p>

<p><img src="https://i.stack.imgur.com/t9mfh.png" alt="Wiring"></p>

<p>^ So can I avoid this, when using a <code>Common Anode 7-segment display</code> or am I forced to buy a <code>Common Cathode 7-segment display</code>?</p>
 8420: <p>Peter and Gerben have already said what is needed , but I wish to explain things even further.<br><br>
A normal small 7-Segment display consumes only <b>70-80mA</b> when all segments are HIGH.So you can use the Arduino directly without damaging it. Also note, depending on the quality of the project, you could either use a common resistor for all segments, or use separate ones. Separate ones will give much brighter light and better quality.<br>
A medium size one will require max consumption of around <b>400mA</b> current, so use cheap transistors.<br>
A large size one will require max consumption of upto <b>1.5-2A</b> current , so use MOSFETS or other high current Transistors.<br>
An Extra Large one will require max consumption of upto <b>10-25A</b> current, so use good MOSFETS or maybe even Relays.<br><br>
<I><b>Usage</b><br>
Small- Wrist watches<br>
Medium- Small clocks<br>
Large- Big clocks<br>
Extra Large- Very big clocks like ones in Railway stations<br>
</I></p>
 42: <p>You can use a single resistor on the common pin if you want. The problem is that lighting up multiple segments at the same time will substantially reduce the brightness of each one. You could work around that by lighting each segment one at a time in very quick succession though.</p>

<p>It should be possible to control the display directly from the IO pins by setting them LOW. In this configuration, they will be <strong>sinking</strong> current (rather than <strong>sourcing</strong> it). It depends on the specification of the display and on what resistor you use though.</p>

<p>Basically, try to keep the current <strong>below 20mA</strong> and it should be OK (assuming you're using a standard 5V Arduino). For example, if each segment has a forward voltage drop of 2V, you would want to use a resistor of around 180 Ohm.</p>

<p>Controlling the display directly from a shift register is probably not possible, although once again it depends on its specification. Shift registers usually aren't designed to sink enough current so you'll need something like a transistor on each output.</p>
 2881: <p>Sorry about the crudity of my image, but you don't always need those transistors. Peter has already said so, but I wanted to explain a bit further.
<img src="https://i.stack.imgur.com/01Y8C.png" alt="schematic"></p>

<p>The only thing is that you need to set a pin to LOW to light up the led, and HIGH to turn it off. Just use a <code>!</code> to make your code more intuitive if your like. So e.g. <code>digitalWrite(segmentA, !HIGH)</code></p>

<p>Some limitations. A pin can sink up to 40mA (no problem here), but the total sink current for the digital pins <code>0</code> to <code>4</code> shouldn't exceed 100mA. The same goes for pins <code>5</code> to <code>13</code>. And the same goes for the analog pins. So either limit the current through the leds to around 10mA, or make sure no more than 5 leds are lit at the same time, or connect half of the segments to on of the above mentioned groups, and the other half another (f.y.i. analog pins can be used just like digital pins).</p>
