LED's , LCD's and me crying in the corner

ok - i decided to take a break from the robot building to go back to absolute beginner's electronics so i could create a better bot and learn more in the process.

my idea was to create a display output for my "akira" so that as the picaxe pbasic program ran i would know where it was and what mistakes it might be making (it kept running into walls)

so... i got a picaxe 08M2 to talk to a shift register (8 bit, 74HC595 SIPO) and then to a seven segment LED first for practice and then to an LCD for the final version.

and thus my problems began...

1) the 08M2 and the shift register both run at 5v but the seven segment LED runs at 2.5v so obviously i need to put a resistor inbetween them - how on earth do i decide on the strengh of the resistor?

i used ohms law ... (source volts - LED volts) / (current / 1000)

the 1000 is to change milliamps to amps

i got ... (5-2.5) / (30 / 1000) = 340 ohms

i put the closest resistor i could find (440 if i remember rightly) and bugger all happened

i tried kilo ohms - still nothing , hundreds of kilo ohms - nothing (it took one mega ohm resistor to do the job)

so my question - am i missing something really obvious in the maths or are there multiple other things i need to take into account eg the fact i was using a voltage regulator to provide the 5 volts

2) it turned out maplin had sold me a common anode seven segment LED - is it impossible to contol one of these using my setup or can i tweak the programming or physical setup in some way to allow me (i notice most arduino controlled 8x8 LED matrixes are common anode)

frankly i probably have a whole bunch of other questions but this is getting a bit long - so i'll start here.

and before anyone mentions google - my problem is not my lack of research - its the fact i've never had a one to one chat in this subject and thus dont have a clue about the "little things" that most take for granted - hence im looking for advice and not links to information.

 

thanks

dominic

I will attempt to offer some info.

First up. Quick and dirty voltage drop requires a “voltage divider” not a current limiting resistor. Voltage dividers take the form of

Resistive_divider.png

IIRC R1 needs to be double R2 to get half the Vin to the Vout, in your case 2.5v from 5v.

Next, your common anode display would require current limiting resistors on each cathode leading to your shift register. I did a quick search to see if the datasheet might help me tell you if you can safely sink 20mA * 8 (If you include the dp). The only spec I saw on the datasheet I looked at was 70mA. I don't know if that is per pin or for the whole package at any given time. If the package can't handle sinking current from all the pins at once, you will need either a package of NPN transistors, or, something like a ULN2803.

typical

as usual trying to save money has made life a damn site more complicated - i should have known a cheap bag of LED/LCD’s would hold all the misfits. I’ll get a proper common cathode LED when i’m in town on monday (tho the common anode 8x8 LED matrix i just ordered off ebay might not be as handy as i hoped)

Its also good to know i wasnt just being stupid - the voltage control via resistor never really made sense to me.

but i dont give up THAT easily  :wink:

There are low current 7

There are low current 7 segment led displays available like this one.

Do you want to learn how a shift register works or just drive a 7 segment led display via picaxe 08 for debugging reason? If latter, there might be easier ways to do that. It is also described in the picaxe manual 3, starting at page 21 :slight_smile:

well … now you ask

i was looking to continue the modular approach i was taking to robot building - so i was thinking if i can get a PIC (in this case picaxe cos its my first programming language - ie pbasic) to talk to a shift register and then to something else i could create little add on modules which are pretty self sufficient and require as little input from the central “brain” as possible.

eg - i start with a seven segment display

i move onto an LCD display

possibly a sound output

even an LED matrix for some form of “emotional” output  :slight_smile:

i know there are much easier ways to do this but i thought this way i would learn as much as possible about IC interaction as possible while maintaining a pretty open source evolution of the modules for future learning (almost sounds deep)

the annoying thing is that i get most of how they chat to each other - i just got tripped up at the last hurdle when it turned out it wasnt just a 5v powers everything idea but amps got involved too and ohms and who knows what else

 

anyway

 

dom

 

utter failure … again

ok - so i discovered my breadboard wasnt working properly so i decided to actually build a circuit board to try it out.

LED_fail_basic.jpg

complicated little bugger - but isnt it pretty

 

then i uploaded the program i had written and got...

 

LED_fail.jpg

 

its supposed to be counting from 0 to 9 - instead it just did an o and a decimal point which it wasnt supposed to even know was there.

i checked the connections - everything that was supposed to be connected was and not, wasnt.

i checked the program and it worked just fine in the picaxe simulation

basically - im back to square one - and rather bemused at the same time

I WILL WORK THIS OUT!!

i think its the programming

thus i have inserted a copy of the program HERE

as usual any help would be greatly appreciated (especially as my matrix LED just turned up and i cant get past step one)

thanks

dom

more tears

I was feeling inteligent tonight so i decided to have another go

I simplified the programming so it would simply activate a single LED via the shift register (to check i had at least got that bit right) and got a really strange result

every time i attach the batteries something different happens - sometimes its the circle and dot as in my previous picture - sometimes its nothing whatsoever othertimes its completely random pairs of LED’s - the odd thing is the gap between attaching the batteries seems to affect it

any idea’s?

edit - i forgot to mention that this was after building some cool little pcb / breadboard adapters as the width of the pins from certain gadgets was too wide for the breadboard to clasp along with the wired pins

AH BLUE BETA, don’t cry ;_;

AH BLUE BETA, don’t cry ;_; or I cry too… I don’t know what’s going on but it’s hard to get to the nearest corner! moar booze!!! (don’t mind me ;:smiley: :expressionless: )