Interfacing Dot Matrix Display with a Microcontroller

Go To Last Post
39 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I'm trying to interface a 5*7 dot matrix display with a controller.As far as i understood,i should use pnp transistors(BC557 for ex.)to multiplex(choose a single column(anode)) and connect the rows (cathodes)to put a value on the selected columns leds.Then,i should choose the next column and so on.This should be done fast enough so that human eye shouldn't observe that leds are shut during this scheme.

Does that(if the above is correct) means i should use timer1 for ex. with compare mode A,and when the suitable time is gathered,the interrupt routine should :

select a column by applying logic 0 to the base of the pnp transistor and put a value on the rows port and repeat this for rest of columns.

How much is that proper time for the eye to catch the changes?What is the "minimum trigger time" of the dot matrix display?

After that proper time passes should i select one column and apply the row values to it,exit the routine then after it passes again,select the next column and so on?Or all columns should be serviced one after the other in the same routine in the same time?

Please advice.Thanks

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You've got the right idea. You definitely want to exit the ISR between columns so your uC can do other things. So to repeat the sequence:

Set timer fast enough to update entire display 80-100 times/sec. For 100/sec update that's 500 interrupts per second (2ms).

Each interrupt:
-Turn off current column
-Output row data for next column
-Turn on next column

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi
Thank you for your reply.

I tried that,the concept seems to work,each column is chosen via transistors,the leds values imported through uc port and each interrupt serves one columns.

When i adjust the rate of the interrupt to about 2ms-whole screen serviced each 10ms-the leds glow yet the problem is that all leds glow not some as the code intended to write a certain character.so i studied the rate of interrupts ocurance:

when adjusted less than 5o us:leds glow instantly then they are shut.

between 50 us to about 65 us,some leds flashes periodically.

Number of leds flashing increase with time.

In the range of ms ,leds start to be stable,all glow but not very bright,in about 2ms,the glow clearly.

In way after observing,the problem seems to me that all leds in one row keep glowing together,like i choose one column and so leds in it are lit,when moving to choose another columns,there is still enough current(i think to continue choosing the previous column) and so on.I'm not sure really.

Any ideas what's happening?

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You've either got a problem with your software or with your hardware. Without seeing either, I'm not sure what else to offer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The base resistors are initially 1 kohm but i increased them gradually till 100 kohms to limit the current but still the same happens.(I want to say that the resistances' values are not the problem)

The voltage supply is 5 voltages not shown for ICs but connected(same the ground).

Note that the leds are active low.transistors are chosen by applying logic zero to their bases.

Dot matrix display's minimum trigger time is 1ms (whatever that means)

Proteus (the program i simulate with)can simulate dot matrix display(vision delay).So there is a problem either hardware or software

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can safely use 4K7 on the transitor bases. However trying to suck 7 x ~35mA (5-1.5? /100) from the AVR is likely to stretch the friendship.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't have to use a timer to use a dot matrix display. I would think it would make it harder, unless you had a good reason for doing it that way.

The way I have set them up is with:

5x7 column cathode/ anode row
74HC138 3 to 8 decoder
470 ohm resistors

I run the 7 rows from the matrix to resistors to the AVR,
then I run the 5 columns to the decoder and then 3 wires to the AVR.

Again I don't know your specific project but thats a quick easy way to do it. It gets more complicated trying to use less pins and a timer.

To fire the leds you pick a column and make it low with the decoder and make the row pins high (for the ones you want on in that column).

I set mine up by firing all 5 columns over and over real fast for X amount of time in a loop, then increment to the next 5 columns (or shift one for scrolling) then I adjust my "real fast" and "X" to whats visually appealing by trial and error.

I am not encumbered by the restraints of the adult mind.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dear Sherif,

As js has suggested, you need a 4k7 for R8 .. R12. The column transistors must be driven hard on.

The 100R current limit resistors are going to limit the current to 30mA or so. (for a 2V drop on the LED). If all pixels are lit at once, your AVR is sinking 210mA. 200R resistors would be a lot safer.

Can Proteus simulate smoke or burning smells?

Your code.txt has learned a few tricks!
The next thing is to look at some of your magic values.

	ldi gen,$f7           ; hex constant
	ldi gen,0xf7          ; hex constant
	ldi gen,0b11110111    ; binary constant
	ldi gen,~(1<<3)       ; expression
        (1<<3)       ; expression
        0b00001000   ; as constant
        0b11110111   ; the ~ operator flips the bits

Now looking at your ISR():
The 'count' variable is going from 0 .. 255 then wrapping to 0 again. But your display is only lit for 'count' of 0 .. 4

You can also see that you have a certain amount of duplication in 'first_column', 'second_column' ...

So you might rearrange your code.

Good Luck!

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think the pnp drivers arent turning off fast enough... need a pullup to 5v to the base of the pnp?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I switched to 4k7 base resistors,200 ohms out of uc port,and used pull up resistors,still leds are all lit.Thanks everyone I wasn't really sure what are the right values.

Quote:
You don't have to use a timer to use a dot matrix display. I would think it would make it harder, unless you had a good reason for doing it that way.

I understand your suggested scheme,but I really don't want to leave that one before I get why it's not working.Thanks anyway.

Quote:
ldi gen,~(1<<3) ; expression

Hi David,I'm not sure what does (1<<3) means?

Quote:
The 'count' variable is going from 0 .. 255 then wrapping to 0 again. But your display is only lit for 'count' of 0 .. 4

Note i'm clearing the count in the fifth column code so it goes from 0 to 4 then 0 again.

Quote:
You can also see that you have a certain amount of duplication in 'first_column', 'second_column' ...

Yes,you're right ,thanks.

Quote:
I think the pnp drivers arent turning off fast enough... need a pullup to 5v to the base of the pnp?

I tried that as I said in the beginning,4k7 resistors.Is that a suitable value?

The problem still seems to me,that columns are all on in the same time,hence rows' led are all on or off together.Is it a matter of timing or I need other hardware to further control the operation?

Please advise.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One thing that jumped out on me when I looked at your schematic is that you're not showing the power supply. Are the transistor emitters connected to the same power supply voltage as the CPU? If you are feeding them from a higher voltage, then the CPU can't make the base voltage go high enough to turn the transistors off.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IC and transistors are all connected to 5v supply.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe you wired up the display wrong. Try disconnecting all columns but one and see if that one behaves. Then disconnect that one and wire up the next one by itself, etc. Don't change the code at all, just pull the wires on the columns.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dryanhuston wrote:
You don't have to use a timer to use a dot matrix display. I would think it would make it harder, unless you had a good reason for doing it that way.

??? How do you get your uC to do other work? The point of using a timer interrupt is to provide a consistent display update (which gives consistent brightness between columns and over time) while freeing up the uC to perform other tasks. How else would you accomplish both goals?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Try disconnecting all columns but one and see if that one behaves.

When choosing only one column,all other columns leds are turned off,and all the chosen column leds are on ,although i never put "all zeroes" in the rows(leds are active low).Not a clue why all are on.

Anyway that's repeated for all other columns,all leds of one column are always on.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have another display you can try? Otherwise, I would start manually (display disconnected from uC) turning on just one column and just one row and see what happens.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kk6gm wrote:
dryanhuston wrote:
You don't have to use a timer to use a dot matrix display. I would think it would make it harder, unless you had a good reason for doing it that way.

??? How do you get your uC to do other work? The point of using a timer interrupt is to provide a consistent display update (which gives consistent brightness between columns and over time) while freeing up the uC to perform other tasks. How else would you accomplish both goals?

Like I said in my first post I am not sure of his project goals. His schematic just shows a dot matrix display. The way I described is a simple way I have done it. I always find it is easier to get code working on hardware correctly before implementing timers and interrupts.

I understand your point and I completely agree with you. Maybe I am assuming too much, but I am under the impression he just wants it to display something (much as I did when I first messed with dot matrix displays). Timing it for a constant brightness and updating via interrupts to free up the chip for other tasks is just icing on the cake if your only goal is to just display something meaningful.

I am not encumbered by the restraints of the adult mind.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should use a buffer IC like the ULN2003 to drive the each of the rows on port D. Remember that five times the average current for a lighted LED must go through each LED because each LED is only powered at 1/5th of the time (there are five columns). Persistence of vision makes the LEDs in the five columns appear to be on at the same time.

Even though each LED should have only 10 or so milliamps at max going through it, this value only applies to continuous current. Pulsed current needs to be much higher in order for the LED to be seen.

The AVR port can not supply the current needed to drive the column. Assume all seven LEDs of the column are lighted and that each LED is using 10 milliamps if it were lighted continously. Since each column is lighted only 1/5th of the time, each LED needs 50 milliamps for about 1/150th of a second.

Each column has to be lighted at least 30 times a second for persistence of vision and there are five columns. The timer should interrupt at least 150 times a second. On each interrupt it will switch to the next column on port C and update the row data on port D.

The BCC557 column transistor is too small for multiplexing. The column transistor needs to handle at least 350 milliamps of current (50 milliamps per LED times 7 LEDS).

Yes, it is safe to say that most microcontroller failures can be traced to either to a hardware or software problem. Occasionally, various deities or space aliens will sprinkle alpha particles on our circuits for their own amusements. But, yes, in general, it's either a hardware or a software problem. If your boss wants to know Why it's not working (all the time), the alpha particles excuse occasionally sometimes works. We both know the space aliens were actually responsible, but it's best to keep this special knowledge to ourselves.

Most LED multiplexing problems result from the LEDs not getting enough current. Either the driver ICs are too weak (in design phase) or they have burned out (in the field).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sherif,

PORTD is wired for the data. PORTC is the column select. Both PORTS are active low.

So a pattern of 0xFF written to PORTD should mean all LEDs off. A pattern of 0xF9 is 0b11111001. So I would expect the the LEDs to light as 0b00000110.

Some people can read HEX naturally. In this case, I think that using a binary constant is clearer. And showing the actual LIT bits is clearer still. e.g. ~0b00000110

If you single step your code in Proteus, you should see the correct dots light up.
I have just simulated in Studio. And sure enough the code works perfectly. (Sorry, I did not notice you 'clr' counter after column 5)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Occasionally, various deities or space aliens will sprinkle alpha particles on our circuits for their own amusements.

So,I'm not the only target to their amusements.Feels good,I'm not alone :lol: .Yet I wasn't referring to them,it's just that in a previous post,proteus was accused to have a bug,i was pointing that it isn't the problem.

Quote:
Proteus (the program i simulate with)can simulate dot matrix display(vision delay).So there is a problem either hardware or software

Thanks,Simonetta,for your suggestions,they seem promesing.I'll work on them now.

Thanks David.I'm glad you liked my code this time.I'll keep the binary advice in mind for next times.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dryanhuston wrote:

Like I said in my first post I am not sure of his project goals. His schematic just shows a dot matrix display. The way I described is a simple way I have done it. I always find it is easier to get code working on hardware correctly before implementing timers and interrupts.

I understand your point and I completely agree with you. Maybe I am assuming too much, but I am under the impression he just wants it to display something (much as I did when I first messed with dot matrix displays). Timing it for a constant brightness and updating via interrupts to free up the chip for other tasks is just icing on the cake if your only goal is to just display something meaningful.


OK, in the learning or testing case I can agree with this, and in fact I've tested new multiplexed hardware using software delays. In any case, it appears that the OP understands how to use timer interrupts, so he should be good in either case.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The BCC557 column transistor is too small for multiplexing

I'm not an expert in transistors types.Can anyone suggest one that can tolerate 350 ma.

Quote:
You should use a buffer IC like the ULN2003 to drive the each of the rows on port D.

ULN2003 is a buffer(Don't start commenting on me for mentioning that although you've said it already,i'm gathering the facts.) , i should connect outputs of portd to its input port and its outputs to the dot matrix rows while holding 'common pin' high(Vcc),right?

Coz the outputs are held low with no change,I'm not finding any frequency talk in its data sheet so it's not that the frequency of the inputs is high.Is there anything I'm missing?

Quote:
The AVR port can not supply the current needed to drive the column.

Portc is for choosing the columns.It does that by applying logic zero to the base of the transistor making the Emitter-Base PN junction forward(Vbe>.5)(The voltage drop on the base resistance is relatively small in another words,it doesn't affect this requirement).

That matches the problem of that each column,duty cycle is just 20% of the time and the current is pulsed due to the switching made,so I need a transistor that can provide up to 350 mA

The dot matrix anodes are connected to the transistors,which supply the current.The cathodes are connected to portd,which should apply logic 0,to leds to be lit.(I mentioned before that leds are active low,that was a mistake that caused this confusion i think,sorry).Anyway,those should be connected to a buffer to separate the high current from the uc.

Thanks for your help,i'll concentrate in the multiplexing first and hope that it's what causes the uln not to work.If the way i understood the uln is wrong,please notify me.

If anyone can suggest a transistor that is suitable for the current requirements,please advise.Thanks.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First off. Does Proteus display the dots correctly on the 5x7 display?

With the 200R 'row' resistors, and all dots in a column lit, the column transistor is sourcing a peak 105mA. A BC557 should manage that just fine. The AVR will also sink 15mA per PORTD pin ok. But you are pushing things a little!

I would guess that a real-life design is actually going to use several 5x7 matrix displays. And this will definitely mean higher peak currents and higher average currents. So you would be looking to higher current transistors than BC557, and a ULN2803 for the 'row's. You would also use lower 'row' resistors to achieve a higher peak current.

Visibility depends on average current in your LEDs. Your 5 columns at 15mA peak have an average current of 3mA per 'dot'. 10 columns would need a peak 30mA to achieve a 3mA average.

A BC357 is higher current. (from memory)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
But you are pushing things a little!

I'm really not.I'm just trying to cover the possibilities.
I found a c code and circuit done using proteus,i ran the simulation,it seems that the difference in the simulation is that:
whenever i pause the simulation,only one column is selected in the one i downloaded,while in mine all columns are selected,although one base is low at that time and all other bases are high(i.e four transistors should be off)
There is a delay in the transistor,switching on and off.I added a delay between a releasing a column and selecting another,still didn't work.So I was open minded to try another hardware since we both agree that software is fine.

If anyone dealt before with multiplexing using transistor,can he/she gives me an approximate times for the transistor switching on and off.

Playing with the two timers together doesn't converge to a stable result with me.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In my displays I use ~2.5ms refresh rate per row and I use proper current source drives for the LEDs. The transitors will switch a lot faster than you can see (in the ns range).

If you only have 1 column on but all leds are on then you have a hardware problem.

This is where a debugger comes in handy, you put a breapoint after you select the column, stop and check what's going on with the hardware.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem is i have all columns on at one time while selecting one base of the transistors.Meaning only one base is low at one time but all collectors are high at that one time.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are the emitters of your transistors going to the same voltage source as Vcc of your AVR? Are your transistors wired correctly? A '1' output on the AVR should turn off a PNP transistor, no question about it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,they are.They are wired as shown in the pdf & the code is as shown in the txt file.The base resistors are now 4k7,the portd ones are 240 ohms.The crystal is connected correctly(I was working without it then thought to try it before posting,but it's not the problem also.

I agree with you the the transistor should be off.Beside,I can't convince myself that this is a bug in proteus,because I'd understand,that they neglect the delay,but to extended it?.Also I tried Bc557 alone out of paranoia,it works just fine.and when voltage one is on the base it's off.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Meaning only one base is low at one time but all collectors are high at that one time.
Quote:
then you have a hardware problem.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, one transistor works, now add one more, and one more, and...

Another interesting thing to try would be to slow the interrupts enough that you can see the columns scanning, and tell us what happens then.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As we have both discovered, the software is correctly written. The Studio simulation works fine.

The PDF looks fairly sensible too. But then I have no experience of Proteus. The 5x7 display has no mention of how the terminals are labelled!

I am just guessing that the 7 terminals at the bottom are Rows, and the top 5 terminals are the Columns. The LEDs Rows are cathodes with common anodes connected to each Column.

You can test the Proteus 5x7 by simply wiring a column to 5V and wiring each row resistor directly to 5V or 0V.

In real life, you may want to allow some switching time as you switch columns. But you already turn off all columns, and the AVR will take 4 cycles (500ns) before the new column is enabled. This should be plenty long enough for a BC557.

Have you tried this circuit in real-life yet?

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It worked only when I connected each collector with a 1k ohms resistor to the ground(Sort of pull down resistors i think).But i'm not sure why is that.I figured it out,when i connected a collector with a voltmeter to trace a step by step what happens,then the column connected to that collector worked correctly,so I thought to connect a low resistor to each one and see what happens.If any one that is an expert in electronics could give an explanation,it would be great.

Thanks.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The obvious question is:
'What does Proteus think this funny 5x7 dot device is?'

If you had a part number or labels on the terminals, it would help. You do not even have pin #'s.

If you wire the top left hand terminal to 5V.
And wire the bottom left hand terminal to a 240R resistor to 0V.

All other terminals being 'no connection'. I would expect the top left hand dot to light. If it does not, then you may be using common cathode LED display.

This is what I love about Proteus simulation. No proper schematic. No part number. And worst of all, the students will not even confess to having real hardware or not.

So someone can waste time checking their code or schematic without even knowing whether the student has tried it with real components.

If you have a real Proteus or if you have a real component it would be nice to know!

But even a simulated part number would be helpful.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
'What does Proteus think this funny 5x7 dot device is?'

It deals with it as next: "Any led will be drawn lit if both column and led pins are high unless user choose to invert each or both,taking into account the vision delay".

I chose to invert the rows to simulate common cathodes rows,with columns being the anodes.

Quote:
This is what I love about Proteus simulation. No proper schematic. No part number. And worst of all, the students will not even confess to having real hardware or not.

I agree it's annoying that pins are not labeled,but dot matrix display is my first encounter with this.And I have tried it alone using directly connected supply and ground to know how it works.

I first draw the schematic in proteus,write the code in AVRStudio,simulate in proteus,then try the hardware of course.It's just each time I have a problem in proteus simulation,hardware never works,so i learned to make it work first in proteus before trying the actual hardware.But to not waste anyone's time,next time I'll try the hardware first before posting.

I'll try the actual hardware with and without the 1k ohms resistors and post the results,yet if someone has a logical explanation,it would be good.Perhaps the current passing through transistor doesn't find a path to ground in the base-collector junction?

Thanks for your time.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

It deals with it as next: "Any led will be drawn lit if both column and led pins are high unless user choose to invert each or both,taking into account the vision delay".

So we are talking about a completely imaginary device. Real-life devices are cathodes to rows and anodes to columns (or vice versa)

You buy either common anode 7-segment displays or common cathode 7-segment displays. I would have assumed that Proteus has both devices and you choose the one you want.

A regular diode has an anode and a cathode. Does Proteus ask you which way you want the current to flow?

Quote:
I chose to invert the rows to simulate common cathodes rows,with columns being the anodes.

Does Proteus really work like this?

As I suggested earlier, you can verify the direction of the LEDs by direct wiring one column high and one row low. If it does not light, you do col hi, row low.... i.e. you have common cathode columns.

I do not expect students to be conversant with electro magnetic theory or the finer points of network analysis. But surely connecting a LED via a resistor is a simple task?

If a 1k resistor from Q1 collector to GND lights a dot, then this means you have cathodes connected to the column pins. i.e. the 'invert' function has applied to the column pins. (the 'invert' should only apply to the row pins)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I tried the actual hardware,it worked in both cases correctly(With 1 kohms and without them).Not sure why it worked with the resistors.I verified the direction of leds with the actual dot matrix.Rows are the anodes,columns are cathodes.Connecting a resistor between a collector attached to a row and a ground seems to not affect the operation.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have got me really confused. Your schematic suggests that columns are anodes and rows are cathodes.

When the BC557 turns on, it takes the column to 5V.
When a row is held low, the current flows from 5V through the BC557 to an LED anode, lighting the LED. The current exits through the row pin via the 240R to the PORTD pin that is at 0V.

I can only assume that you have configured Proteus incorrectly.

Please can you double check your anode-cathode thing.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi David

Quote:
Your schematic suggests that columns are anodes and rows are cathodes.

Yes,that's correct.I thought that's the popular type,but while collecting the hardware needed,i could only find the opposite(rows are anodes and columns are cathodes).

Anyway,I connected the circuit after changing the code to fit the new type,and it worked without the 1 kohms.Then I tried them,there were no change,it also worked correctly.(I'm talking about actual hardware not proteus)

That's the first catch i encounter with proteus,i think it's safe to say it's useful as an easier way of simulating the hardware,but i shouldn't rely on it alone.

Sorry for wasting your time,while it was just a bug in proteus.

Sherif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am pleased that you have your program working.

So it seems that it was more a problem with you not checking your hardware rather than Proteus.

I presume you just used NPN column drivers with active high bits on PORTC. And the PORTD pattern was then active high too. Far more intuitive!

So it seems that Proteus is an excellent method of developing some software and hardware without the usual smoke.

It does not really have the same hands-on satisfaction as my first bit of electronics.

That was a single valve amplifier mounted on a tobacco tin. I held the tin in one hand as I switched it on. I will never forget the +250V d.c. on the outside of the tobacco tin due to my incorrect wiring. A good learning experience!

David.