Jump to content
 

Printed Circuit Board (PCB) Software


Recommended Posts

  • RMweb Gold

OK, it’s CAD – and the program will model your work in 3D – so I think this is the right part of the forum to show it in.

 

I’ve used DipTrace to produce several PCBs, now, and thought that some other member here could also benefit from my experience.

 

Although I’ll freely admit it’s not a 3D mechanical draughting package, and it’s not everybody’s cup of tea, but if you want to produce some PCBs to operate parts of your layout then may I humbly recommend NOVARM’s DipTrace.

 

It’s free, (for none commercial use with the only limit being a maximum number of usable pins being 300), and it comes with an extensive library of components. It’s quite intuitive and the various programs all share similar program menus and styles – so it’s easy to use. There’s some really nice features but you will definitely find it easier if you’ve already used a CAD program to make PCBs before.

(When producing the output files for manufacturing, you REALLY DO need to know what you are doing and what your supplier will accept.)

 

OK. Advert over, and the usual disclaimers apply with no connections except being a very happy user.

 

The board, I’m showing, is to sense passing trains using Infra-Red.

I’ve not tried the circuit yet, so I really don’t want to post the (full size) circuit diagram until it has been proven. (I will not be able to prove the circuit for at least a month yet, but when I do I’ll post the results here.)

 

I’ll add more in the following posts.

 

Kev.

Link to post
Share on other sites

  • 3 weeks later...
  • RMweb Gold

Right, got really bored so I went out and bought most of the rest of the bits I needed to populate the PCB.

 

Bought the last two thirds of the components, for around £11.00, in the GuangZhou Electronics market (DianZiShiChang, FuShu XiLu or something, or other. It sometimes works!) – and enough bits for 40 boards or so!

 

Still not tested properly but the right voltages are in the right places and nothing has blown up yet!

 

Kev.

post-12815-0-12613100-1322240613_thumb.jpg

Link to post
Share on other sites

  • RMweb Gold

Sorry about the size of the photo in that last post, (I don’t know what I am doing), but there again I can actually see more detail than I ever could have imagined. And just using my camera phone too. (Might have to upload all my work to RMweb so I can see it clearly!)

 

Wrote a simply LED flashing program for the Infra-Red-Detector PCB.

It’s the equivalent of the “Hello World” message in Computers but in this case for simple Micro Controller circuits.

If it flashes then all is well. All IS well!

 

Unfortunately, my Infra-Red LEDs and Receivers are back in the UK.

I could wait until I’m home next week or I could nip down the Electronics Market and buy a few more.

 

Now, what is it I have to say to the Taxi Driver - “GuangZhou DianZiShiChang, HuangFu Xi Lu”?

(I’ve sent my minder/chaperone/taxi finder/translator on an errand tomorrow so I’m free to go where I want.)

 

Kev.

Link to post
Share on other sites

  • RMweb Gold

Hi David,

 

No, I'm not a member of MERG. But i do know of it.

(I've been led there in the past when serching the web. Not visited for months though!)

 

There's some good stuff there but I've never really followed it up... not sure why, it appears good.

 

Will give MERG a good visit tonight. Thanks for the Link.

 

Kev.

Link to post
Share on other sites

  • RMweb Gold

OK, went t the electronics market today and bought all the bits – and some unnecessary gadgets as well!

(It don’t matter how you pronounce the intended destination in Mandarin if the taxi driver only speaks Cantonese.

Thankfully, hotel staff a plenty to help out.)

 

Paid too much for some capacitors but the rest were really good value but more important than that available.

(I can haggle in Mandarin but I can’t say ‘Boo’ in Cantonese.)

 

Had no tools, (all at work), and I’m nowhere near my workshop, (shed), so I had to improvise with what I had available – meter and leads, nail clippers and the ever essential paper clips.

Wrote a few lines of code and pushed it all together. (No soldering iron.)

 

It Works!

I am so pleased, but there is still plenty of work to do.

 

It reliable senses my fingers in the 1.5 to 2.5cm range. (Once I’d replaced the Chip after frying the first with a 9v battery.)

And this with no tweaks, light guards, preying, software changes and frequency/characterising.

Other materials heave a greater or lesser sensing distance, regardless of ambient lighting.

(It responds to the 2 hotel room TV zappers at over a metre distance.)

 

Things to do:-

Tweak the, Red and Green, LED brightness’s.

Check the IR LED driving frequency and duty cycle.

Review the schematic. (I reckon I could cut the component count in half.)

Swap the voltage regulator around. (So far the only mistake!!!)

Play around a lot and see what extra features I can cram into the Micros Controller’s memory – Only used 98bytes or %10!

 

To re-iterate – I am dead chuffed. And no I won’t excuse the pun in this case.

I am going out now to celebrate.

I will post some photos when I’m back in and in no fit state to do so.

 

Cheers.

Kev.

Link to post
Share on other sites

  • RMweb Gold

OK, a couple of photos.

 

I hear some alarm bells ringing.

 

The circuit datasheets indicated that my design should have been suitable for sensing in the 12" to the foot scale - and not my intended 4mm... (I always thought I would have to do some serious signal attenuating to get this to work.)

 

Also, the TV zappers were much more effective. This tells me there is something wrong with my excitation frequency or the peak frequency of the IR LED (in nm - not sure how i can measure that? I can see it using my mobile phone camera though!)

 

But it currently works... if it aint broke then don't fix it!

 

Either way, i must get to the bottom of what is happening and to do that i will need an oscilloscope.

 

 

Kev.

 

(Err. what u can't see is my finger slightly closer to the sensor in the bottom photo.)

(Sorry - must get the hand of posting. Mayby a video clip would illistrate it better?)

post-12815-0-70151000-1322415254_thumb.jpg

post-12815-0-03055400-1322415330_thumb.jpg

Link to post
Share on other sites

  • RMweb Gold

Ah, now we’re talking!

 

PDP11s, VAX73s, CP/M, Home Computers.

Rubbish - the lot of them!

;-)

 

In the mid-80s I used ‘em all but spent the best part of a year and a half making PCBs by laying out the artwork – literally, with clear sheets, miles of black tape and pages and pages of almost identical dots!

You paid careful attention to every part used then and you really did learn to think ahead.

Each of the boards I would then expose, etch, clean, inspect and then build.

 

It gave you a real respect for clearances, attention to detail and a methodical/clean working environment!

 

Nostalgia wasn’t one of the reactions I was expecting, but I hope you enjoyed the little trip.

Back to my IR Driver board.

 

Threw a rusty ancient scope on it today and inspected the waveforms.

Not bad but it did show that I had the Mark/Space ratio slightly out and that my primary frequency was slightly too slow. Thus I changed three variables, slightly, and they’re spot on now.

The sensing range changed to 0 to 7 centimetres. (It senses incoming movement slightly further out but I don’t know why yet.)

Not really what I wanted but it did give me the idea of making these variables available in my main signalling/controlling program. Thus allowing me to fine tune each sensor in situ.

Details here:-

http://www.rmweb.co.uk/community/index.php?/topic/43396-am-i-being-too-ambitious/

 

Also, I’ll say that it is almost, but not quite, impervious to ambient lighting conditions.

My torch, (Good old filament type. It reluctantly releases brown light on a good day.), sets it off but only if the IR LED is in circuit, (Even when well shielded!), again I don’t know why! Must look at the supply lines and de-coupling more carefully.

 

Looking at the scope and how the board responded, immediately showed me that there would be three main ways of writing the “proper” software.

 

1/ Poll the device until it changes state.

2/ Use the ADC and compare this to a value, below-ignore above trigger.

3/ Use interrupts.

4/ Use the above but gate/window the responses before triggering.

 

Should continue to keep me busy.

 

Kev.

Link to post
Share on other sites

  • 2 weeks later...
  • RMweb Gold

Well, after a pause to get the house ship shape again, I have started writing the firmware for my IRD.

 

The ADC, (Analogue to Digital Conversion technique), which initially worked so well with one channel was completely useless for use with both channels on the PCB. There was no separation between the two channels and whichever sensor fired first would set off both outputs!

Luckily, the Digital Input technique worked very well with both Infrared Channels working completely separately from each other. Also, the point at which you ‘look’ for the sensor actuating is adjustable thus giving some control over sensing distance.

I have also written some code so that the Push Button can change the operating mode of the IRD. This works except it doesn’t actually do anything yet!

Maybe I could use it to change the output delay, or to change the output detected to serial comms instead of logic levels. I’ll give this some more thought as I have a lot of flexibility here.

 

I’m now happy enough with the design that I will post the full schematic.

I’ll also post the firmware. I’ve programmed the PIC micro in Basic so I’ll post both the HEX and the source code so that if anyone wants to change things to suit their own needs they can.

 

It is worth mentioning that this design was optimised for flexibility.

If I was making this commercially then things would have been very different.

If price or size was an issue then, again, things would be different.

 

Still I’m very pleased.

So now I will work on the firmware more, check the schematic and post it, and then start making the 20 or so units I’m going to fit to my layout.

 

Kev.

Link to post
Share on other sites

  • RMweb Gold

Attached is the schematic for my IRD board.

 

I've increased the resister values to the LEDs to reduce both the brightness and the current load through the regulator.

I've also made the schematic clearer to read.

Otherwise, the schematic is as the PCB and the prototype - in other words it should work.

 

The schematic is in PDF format as I know most people wont have the (free) Diptrace PCB software.

 

Kev

PicCTRL10_2a.pdf

Link to post
Share on other sites

  • RMweb Gold

I will now post my complete project for my IRD.

 

The Schematic and PCB CAD files are for use with NOVRAMs excellent “DIPTRACE” PCB CAD draughting package.

(No connection except being a happy productive user of the free version!)

You will need to use version 2.2.0.0 or later.

 

I have posted the BASIC program in TXT format.

It is for use with the, also excellent, “microBasic PRO for PIC” from MikroElektronika.

I used version 3.2.

It is worth pointing out that this software is also free with the only restriction being that you cannot compile above 2k. No problem at all since the PIC12F675 only has 1k!

(Again no connection but I was so impressed that I did buy a license in this case. Well I needed it for another project really but I was still impressed all the same.)

My program is quite long and complex but that is because I have made the IRD operate in 4 different modes, (changeable at power up), and with 8 different “Output OFF Delays”, (changeable by pressing the Push Button at any time during normal operation).

 

These 4 modes are:-

1, Both sensors in reflective mode, (under track), with digital outputs. WORKING.

2, Both sensors in direct mode, (line of sight), with digital outputs. NOT TESTED!

3, Both sensors in reflective mode, (under track), with serial TTL outputs. NOT TESTED!

4, Both sensors in direct mode, (line of sight), with serial TTL outputs. NOT TESTED!

 

The NOT TESTED versions almost certainly don’t work! I will get round to using these modes and then posting the corrected software but if you want you can have a go yourselves.

 

I then used a Microchips “PICkit 2” to program and de-bug the circuit/software.

I recommend you buy this, (30 quid-ish-now I guess. Well PICkit 3 now!). There are programmer designs available for mere pence but they are not worth the effort/time required. (No support, software, features, tools, ICSP, in circuit de-bugging, etc, etc… and they usually require a now obsolete serial or parallel port too.)

The only small niggle is that when you program the PIC micro in situ you will need to remove the two IR detectors from the circuit otherwise things just go pear shaped – no real damage but a real bu**er to recover! (I didn’t/haven’t include buffer resisters on the design to separate these two differing functions from pins GP0 and GP1 – as is recommended in the Data Sheet.)

 

So there you are.

I have “totted” up what I have spent on PCBs and components, for the IRD, and for the 38 boards I have I reckon that they will come out at about £2.50 / board. That’s £1.25 per channel. But remember that that does not include development time/costs, failures, premises, profit – usually small, manufacturing, warehousing, distribution, support, etc, etc… But that’s why DIY should be a hell of a lot cheaper!

Just takes time and effort instead of money!!

Having done this, I reckon commercial products ARE good value and I have no intention of producing this circuit for the “masses”!

O course, you-lot can, and will, do what you like. ;-)

I hope some of you are inspired enough to ‘ave a go. I really really don’t want to put you off!

You could just take the bits off the schematic you like, (It’s like Lego! ie. Modula.), and make your own circuit. I would recommend this for most users.

Also, even though I have included the – corrected – PCB file, you could just as easily use Vero strip board instead of having PCBs made. (Although they are getting cheaper all the time.)

 

I will now try to make a video of the circuit in use.

This will, undoubtedly, try my patience.

 

Kev.

IRD10_1Testing4.txt

Link to post
Share on other sites

  • RMweb Gold

Hmmm.

 

Seems RMweb wouldn't let me upload all the files.

(Schematic, PCB, HEX code, and a picture showing the required config bits.)

 

I'll try zipping them up.

If that don't work then i'll hava word with a Mod.

 

Kev.

Link to post
Share on other sites

  • 2 weeks later...
  • RMweb Gold

Attached, with any luck, will be all the files for this project but all 'zipped' together.

 

No - Error!

 

OK, it won't let me post Zip files either.

I'll have to have a word with a Mod to see what can be done.

 

Kev.

Link to post
Share on other sites

  • RMweb Gold

You're welcome Baby Deltic.

 

Are you using the same cicuit, but on vero strip board?

If not, then remember that it checks one of the input lines at power up to change the mode of operation.

 

Let me know how you get on.

 

Kev.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...