1297Views43Replies

Author Options:

Circuit works when I poke a connection, but the connection is sound Answered

So, I've started playing with vfds since this weekend jaycar (if your an Aussie) is selling 11 digit, 10 segment vfds for $1.90. Cheap as :P. It runs off 12v for the segments, 4.5v for the filament. I'm using 3 4094s to control the segments and an atmega168 to control the 4094s, using 3 transistors to up the voltage between the 4094s data, clock and latch pins and the the atmega I/O ports. I'm pretty sure everythings hooked up correctly but, as with most projects, it's not working first time :P. Here's the thing, it works if I poke either the green or brown connection with just one probe of my multimeter/finger it works. My first thought is that i've hooked up my transistors incorrectly, the base is 5v with a 2.2k current limiting resistor, and the collector is 12v with a 5.1k current limiting resistor. To much? I blew out a resistor in initial testing and it got me a little worried :P Thoughts?

43 Replies

user
robot797 (author)2010-09-21

is this made with standard arduino code or special avr code

becaus if it is normal code
i want to rebuild it

Select as Best AnswerUndo Best Answer

user
gmoon (author)2009-01-15
Picking up this discussion at the top (or the formating on this will be weird)..


Instead of the added 4011's to invert the signal, why not just add an invert() function and use it with ShiftOut()?

uint8_t invert(uint8_t foo){	return(foo ^= 255);}//--- stuff ---shiftOut(dataPin, clockPin, invert(outputbyte));

There might be a little initialization overhead also, but no biggie.

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-15

that will just invert the output byte, to properly interface with the 4094 the clock pulses have to be inverted as well ie, the 4094 would register the input on the downwards clock edge coming out of the avr instead of the leading edge because of the inverted signal, and I'm not sure how the avr handles the data pin once it's set it and sent the clock pulse i could just rewrite the shiftout function but i reached for my 4011 instead :P i just saw it as an easy way to do it

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-15

Suit yourself, but the ShiftOut() function looks pretty easy to modify (I'm sure it wouldn't sync with every external chip without mods, anyway.) The 4011 is a good quickfix, but if you're planning on releasing a schematic or pcb, then simpler is better... (I'm sure you're dealing with the "strobe" line somehow via software, too.)

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-16

yeah, i think you are right, it's not that hard at all to simply set up a new function to do that role but until i get this working the 4011 is nice to simplify things, and I wont post a proper instructable until I get this whole thing rounded out properly

Select as Best AnswerUndo Best Answer

user
westfw (author)2009-01-14

So, do you have a schematic of the way you think it is set up now? I'm finding it hard to visualize from the descriptions (although gmoon seems to be doing OK!)

Select as Best AnswerUndo Best Answer

user
greendude (author)westfw2009-01-15

Here you go :D, mind my terrible schematic skills :P The only difference between this schematic and my breadboard is the liberal use of 0.1uF caps on my breadboard, 100uf and 10uf caps between 12V+ and gnd next to the wallwart plug and all the outputs of the 4094s are tied to the vfd through 680Ω resistors

Select as Best AnswerUndo Best Answer

user
westfw (author)2009-01-11

Protoboards are somewhat notorious for getting stretched internal bits that result in unreliable connections. Try moving that set of connections to a different column?

Select as Best AnswerUndo Best Answer

user
greendude (author)westfw2009-01-11

Thanks for the response, I wasn't expecting one so quickly :P I just tried another column and, again, nothing, so i manually connected the green and brown with alligator clips, nothing. Except if i poke the brown wire to alligator clip or the green wire to alligator clip connections with my finger it works :S The Atmega168 runs a program that fills up the parallel out ports of the 4094s with HIGH and then latches it every microsecond, I dunno if thats important, it shouldn't be but, just for full disclosure :P

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-11

A quick search for VFDs returns this project. Is that your inspiration?

So the transistors aren't for switching the VFD current, but rather to convert the 5V logic of the AVR to the 15V or so used by the CMOS chips. The NPN transistors are wired essentially as a common-emitter voltage amplifier.

There's also an on-board voltage step-up inverter, 5 to 15V (the FET, 150uF choke and caps.)

-- If you're using the same type of step-up inverter circuit, have to tried an external 15V regulated supply? Are the capacitance filter values high enough to remove any ripple?

-- Are the transistor specs OK? Substituting here will likely change the resistor values...

-- Are you sourcing or sinking current with the AVR? Is it PWM, or continuous? Have you measured the switched voltage on the transistors?

Your finger is probably adding some stray capacitance which could effect the inverter, the output ports or any other AC that's present.

Select as Best AnswerUndo Best Answer

user
gmoon (author)gmoon2009-01-11

On reflection, check the AVR output states. (re: -- Are you sourcing or sinking current with the AVR?)

Are you switching between HIGH and floating? (Tri-state Hi-Z) A bipolar transistor's input impedance reflects the amount of current it's switching.

The load resistors imply low-to-medium impedance, but the CMOS chips are very high Z. If the switching circuit is balanced delicately, then touching a floating output might activate the transistor...

To put it another way--driving the port HIGH isn't done unless a lot of current is needed for switching. Normally, output ports switch between a pullup resistor (either internal or external) for the V+, and pulling the port low. That's how it's done on a bus...

Select as Best AnswerUndo Best Answer

user
gmoon (author)gmoon2009-01-11

....I didn't finishing that thought...

Floating a port needs a something for reference. If you're stuck on driving the port HIGH, you might try a pull-down resistor.

(LOW and a pull-up with the floating port are generally preferred...)

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-11

Oh, I didn't read what you wrote properly, I'm totally open to changes in the circuit Why are LOW and a pull-up generally preferred? I just chose HIGH and pull down because it's easier to write code for that :D

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-11

From wikip on pull ups:

Similarly, pull-down resistors are used to hold the input to a zero (low) value when no other component is driving the input. They are used less often than pull-up resistors. Pull-down resistors can safely be used with CMOS logic gates because the inputs are voltage-controlled. TTL logic inputs that are left un-connected inherently float high, thus they require a much lower valued pull-down resistor to force the input low. This also consumes more current. For that reason, pull-up resistors are preferred in TTL circuits.

Also, since a lot of digital circuitry was designed around TTL, then pullups became the convention.

So if you were switching between HIGH and HIGH, then nothing would appear to be happening...

Re: pullups as the norm: AVR ports offer two types of Hi-Z: A) floating only, and B) floating with internal pullup. Note that these are actually input settings, but are routinely used to switch between pulling a port LOW, and letting it float HIGH. It's a little weird, but "tri-state logic" output levels are done like that with AVRs : switching the port data direction between output and input.

So they don't provide an internal pull-down (only pull-up), but the floating only setting lets the designer use an external pullup or pulldown, if either is required...

When I wrote the info earlier, I had no idea what how you were using the ports, or that it was an Arduino. Nor do I really know how the Arduino defines output states... (sorry, I've done quite a bit with bare AVRs, but nothing with Arduinos.) So the pull-down was just a guess. If that fixes it, then it was a lucky guess...

Driving the port HIGH might be actually be needed for a low input impedance device-- a pullup might not supply enough current. But CMOS chips have very high input-impedance, so it shouldn't take much current to switch the transistors on and off (for bipolar transistors, the amount of current needed for switching depends the amount of current being switched; that, and the gain of the transistor.)

If it were me, I'd be using an MOSFET instead of the bipolar transistor, simply because of it's high input impedance (search for "FET level switching" for more info--although if what you have works, don't bother ;-)

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-11

It's not working 100% at the momment :P, noticable flickering in the screen while refreshing the display every ms means theres still some nasty noise around :S
I was just reaching for optocouplers before I read your post :P
So lets see if i have this correctly, using a J FET, say http://www.jaycar.com/productView.asp?ID=ZT2400&CATID=&keywords=fet&SPECIAL=&form=KEYWORD&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=
My I/O pin gets connected straight to the gate with a resistor from the gate, to ground to bleed off some of the charge when I switch the gate off, the source gets plugged into 12+V and the drain can be outputted to my data/clock/latch pins of the 4094 with a limiting resistor in there of my choosing? Is that correct?
Also, I would assume that the size of the bleed resistor is based on how fast you want to be able to move the gate from open to closed? (small resistor = faster switching)

Select as Best AnswerUndo Best Answer

user
greendude (author)greendude2009-01-11

wait I think I have that backwards: the 12+v will flow only when +5v ISN'T applied to the gate so I would use a pull up ressistor on the gate and set the I/O pin to HIGH/HIGH-Z for a 0 and LOW/Open drain for a 1 any chance you could point me in the right direction for resistor values? :D

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-11

Let's backup and try it with the NPN before junking that idea.

He's got 4.7K for the base resistor, 2.2K for the load resistor.

I'd try 10K to 47K for the base, 33K for the load. With a 2N2222 for instance, and figuring the input impedance of the CMOS gate adds from 1 to 10 Megs load...

I simulated that in LTspice (see pics):
Red is 0-5V pulse
Blue is base V
Green is collector / load resistor V

Problem is, it simulates fine, with before or after values.

The impedance of a CMOS input is so high, it almost doesn't have any electrical presence on the circuit (it's simulated by the 1M (1000K) resistor to ground. 1M instead of 10M here only drops the converted output pulse about 0.5V... (11.5V peak)


This brings up another question. Maybe this is noise related... Have you added the decoupling caps?

Just add some 0.1 uF caps from 5V to GND and 12V to GND at different spots on the board. Probably at least one near each IC...

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-11

I love you gmoon, your transistor circuit worked like a charm, no flickering at all now, just nice steady display, you can even see the gradient in the brightness because more electrons are kicked off the negative filament end than the positive :D Since this setup runs everything backwards, I'm off to change my code (well sleep first, then change my code) Oh, is it worth using a 250Ω pull up transistor off the 5v rail to the I/O pin? this would mean High impedance (pin HIGH) would be a 0 at the IC and open drain (pin LOW) would be a 1. (atmega168 can sink up to 60ma but 20ma should be enough to keep the transistor open right?)

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-12

A pullup shouldn't be needed. To get the full output voltage from the 4094, all you need is to exceed the threshold for a CMOS logic HIGH at it's input, which is ~70% of the source voltage (70% of 12V = 8.4V.) So a voltage at the NPN collector / load resistor exceeding 8.4V (by a reasonable amount) should be OK.

Safe to say, a pulse HIGH of 11.5V is plenty.


Re: the original NPN resistor values:

I suspect those are correct for a TTL input, which needs more current for switching than a CMOS device. If you had just played with the base resistor alone, you probably could have gotten it to work.

But a 2.2K load resistor just seems overkill for a single CMOS input, WAY more current used than necessary. Technically, the lower NPN gain should have meant more noise rejection, but it's a moot point if the collector / base currents aren't well matched...

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-12

Ok so I've written some code (just shift out 255 3 times, latch wait a second, shift out 0 3 times, latch wait a second) to flash the display on and off nothing, i figured it was a problem with my code so I used a 4011 to invert the signals coming from the atmega, also nothing I think it might be breadboard connection issues so I'm going to spend the rest of today re-wiring and better spacing my board

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-13

RE: inverting--it may not be necessary to invert the AVR signals. That was just an aside; you should look at the 4094 wiring and, as it may have been inverted a second time at the latch inputs...(if so, no compensation needed.)

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-13

I'm not sure about that, looking at the truth table instead of the schematic, but I'll play around with the code and check what works once I've fixed this reulator problem :S The only things I can think of to make it heat up past it's shutoff point is that there is a short somewhere (i can't find one) or the 5v board is drawing a LOT of power. Ok, it it, I just thought to check and it's drawing about >200ma for just a atmega and 4011. This has thrown me. I'm going to pop up some pics if anyone would be so kind as to take a look :)

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-13

200ma for just a atmega and 4011.

Yeah, something's wrong there. You can selectively fry an IO pin on the AVR, but if it's still functional and toggling then that can't be it... With load and base resistors there's no way the current could be flowing through the NPNs.

That's without the vfd? (Is there a datasheet for the vfd?)

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-14

2 pages just describing pin configuration and some basic input current/voltages
http://www.jaycar.com/productView.asp?ID=ZD1880&CATID=33&keywords=&SPECIAL=&form=CAT&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=465
this guy has done some interesting projects too
http://www.cate.com.au/download/Z8/index.html

The thing is, the only things hooked up to the +5v rail is the atmega and the 4011, So I can't understand what is pulling all that current

Select as Best AnswerUndo Best Answer

user
greendude (author)greendude2009-01-14

Oh and I did fry one AVR but I have a few of them. Measuring the voltage that the 7805 puts out from the moment of turn on, it starts at 3.5v and just starts dropping until it shuts off from heat and lets the whole load through. It's not the 7805 because it can power a few leds without getting how

Select as Best AnswerUndo Best Answer

user
gmoon (author)greendude2009-01-14

Isn't the vfd filament connected to 5V+? The datasheet specs anywhere from 18 to 100mA @ 4.5V (slightly higher voltage will increase the current draw, too.)

Have ya tried a heatsink on the 7805? 200mA might be borderline without one.

But it worked correctly for awhile? (7805 shot?)

You also wrote something about transistors possibly being mis-connected?


I'm curious about substituting the 4011 for the 4094. Are you using many more transistors / AVR outputs than the linked schematic? It doesn't look possible to run so many vfd segments without the shift / latching functions (unless you are using many outputs or 4011's..)

Select as Best AnswerUndo Best Answer

user
greendude (author)gmoon2009-01-14

Oh, no I'm still using the the 4094 to convert serial data to parralell, all the three chips on the higher board are daisychained 4094s. Because the transistors invert the signal from the avr I'm using the 4011 between the transistors and the avr to invert the signal as well (making it super easy to code in arduino langauge because of the shiftout() function) , by using 3 of the 4 2 input nand gates and just plugging clock, latch, and data into both of the inputs of each of the gates. So th 4011's are on the 5v board with the avr and the 4094s are sitting at 12v. I might start working on a schematics and create a pcb because I don't see why the setup we have now shouldn't work, I'll also try with a heat sink

Select as Best AnswerUndo Best Answer

user
gmoon (author)gmoon2009-01-11

Oh, yeah. You realize, of course, that any sort of a common-emitter converter like this inverts the signal...as is plain on the plot...

Select as Best AnswerUndo Best Answer

user
guyfrom7up (author)greendude2009-01-11

maybe you have a problem with ground or a reset in your avr. For example: Me and my friends were testing with avrs for a school project, the circuit wasn't working. terrible. Then as I try and pull the chip out of the protoboard to reprogram it ( only have one connector to my programmer, and it's in a circuit board made by me) I guess I must of touched the reset pin and grounded it, so the avr started working! I guess the story is make sure you ground the avr's reset pin for proper operation. Maybe that's the problem?

Select as Best AnswerUndo Best Answer

user
11010010110 (author)2009-01-11

does it work if you poke it with something not conductive ? maybe the touch you give it kinda acts as earth

Select as Best AnswerUndo Best Answer

user
guyfrom7up (author)110100101102009-01-11

That's what I was thinking, especially if your powersupply is plugged into the wall. Quick somewhat related question. Let's say I have two computer powersupply that's i've converted into lab power supplys. How come I can take the 5v from one and connect it to a circuit. I then take the ground from the other and connect it to the ground of the circuit and BAM it works. How come? I thought they wear suppose to be isolated from the mains, but not apparaently. Inless, is this what happens? They ground the ground output to earth ground, and the same common ground gets shared through the same prong, that just came to me.

Select as Best AnswerUndo Best Answer

user
Goodhart (author)guyfrom7up2009-01-13

You are talking 3 prong plug, right ? The "true ground can be connected to the same place but not either of the two "live" wires (even though one is supposed to be at potential zero).

Select as Best AnswerUndo Best Answer

user
gmoon (author)Goodhart2009-01-13

My guess to what they are discussing: Once rectified, filtered and regulated, the DC voltage grounds (5V, 12V, -5V, etc.) are connected to the green wire "earth" ground (for safety.) That's OK in a single PS, all the grounds have the same potential relative to each other. So even though two computer PS units could theoretically be placed in series, a short would result (the green ground would be connected to both 0V and V+ on at least one supply, since they are "stacked" together.) The green ground wire would need to be removed from one supply. It could work, but probably not super accurately, regulation-wise. There's a reason they make negative voltage regulators...

Select as Best AnswerUndo Best Answer

user
Goodhart (author)gmoon2009-01-13

Yes, isolation is always best practice...

Select as Best AnswerUndo Best Answer

user
11010010110 (author)guyfrom7up2009-01-11

yep. the power supply earth (black wires) is connected directly to the earth from the ac in

Select as Best AnswerUndo Best Answer

user
thermoelectric (author)2009-01-13

Jaycar's selling them for under $2????? Wow, I'm gonna get one

Select as Best AnswerUndo Best Answer

user
greendude (author)thermoelectric2009-01-13

1? get 5 :D Once I get this working (with tremendous help from gmoon) I'm going to post an instructable of this whole ordeal, and knock up some pcb schematics so I can make a few controller boards for them

Select as Best AnswerUndo Best Answer

user
guyfrom7up (author)greendude2009-01-13

hey, do you have any suggestions for driving vfds? I have a couple IV-22 (russian) vfds and I have some clue how to work them. I've never used vfds before, but I have used nixies. Do i need current limiting resistors? What do I do with the grid? Etc.

Select as Best AnswerUndo Best Answer

user
thermoelectric (author)greendude2009-01-13

Well I already have one, But i think it has its terminals on top..... (It's scavenged)

Select as Best AnswerUndo Best Answer

user
greendude (author)2009-01-13

This was going to be a post about a problem with my 7805 getting hot enough to cook an egg, but looking at the pics my transistors are in the wrong way, not sure if that would cause the problem but i'll try again in the morning.

Select as Best AnswerUndo Best Answer

user
Plasmana (author)2009-01-11

I get that weird problems sometimes...

Select as Best AnswerUndo Best Answer

user
greendude (author)2009-01-11

Ok here we go :P @ gmoon: yeah, sprite and a couple of other places were my inspiration and I saw the cheap display and just went for it :P the AVR is sourcing current and are connected to the base of the transistors through a 2.2kΩ resistor this is just an early circuit so, no PWM just yet this vfd runs off 12v so I'm using a 12v regulated wall-wart with a 100, 10 and 0.1uf decoupling caps (just what I usually uses, i have no idea how to figure out the correct values :P), that runs into a 7805 to power the avr (you can see that in the bottom left, tucked away down there :P) so, no step up converter, and in my circuit a high on the avr pin corresponds to a high on the data/clock/latch pin of the 4094, in sprites, it's inverted I'm using arduino and switching the avr ports between HIGH and LOW, so i guess HIGH and floating (not sure how the arduino handles that) thats an exellent idea with the pull-down resistor (why didn't i think of that :P) 10kΩ ish? @guyfrom7up another thing i overlooked :P cheers

Select as Best AnswerUndo Best Answer

user
greendude (author)greendude2009-01-11

So, I went and used a 3,3kΩ (all i had :S) to ground the I/O ports and the reset pin. :D Moderate success :D It works now at least, a bit flickery but nice and bright, a bit later I think i'll spread some more decoupling cheer around the board Thank you for your help guys :D

Select as Best AnswerUndo Best Answer