Designing a Time Delayed Relay

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
I just found the capacitor to solder on to the backside - 0603 size... holy cow that is small! The bent lead transistor worked out fine, just had to reorient it on the board.

File away!
 
Last edited:

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Hey, not bad! The company only wanted one change to the file I submitted!! They wanted the outline in a separate file called .GML.
I wonder if that was just the first round of eyeballing o_O:) We shall see.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Submitted last friday, was informed today that the board would be shipping out today or tomorrow! I asked them to check with me before production, but they skipped that part!! I am a little concerned with silkscreen running over to solder masked areas... I asked for them to send me a picture of the boards before shipping - we shall see if they accommodate that request :rolleyes:
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
So I got pictures and they look great except for the via's being left untented. I foresee some difficulty with soldering possibly. I am quite surprised that they were left open like that! Otherwise I think they look pretty good! Should I ask them to tent or just ship as is?

upload_2014-12-16_8-53-6.png
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
They can't tent them now; they would have to re-run the production run. And since the files you gave them had the vias un-tented, they would charge you again for another run since it's not their fault. In any case it's not a big deal.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
They can't tent them now; they would have to re-run the production run. And since the files you gave them had the vias un-tented, they would charge you again for another run since it's not their fault. In any case it's not a big deal.

Cool, least of my worries then, eh?
How could I have specified tented, a separate gerber file?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
No, you just exclude the vias from the solder masks. If Eagle doesn't have an option for this, you can do it by generating all of the fabrication files, temporarily deleteing all the vias (I assume Eagle has some kind of global or wildcard selection feature), and regenerating just the solder mask layers.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
I think its done during the CAM selection, there are lists from which you can select what you want to include and not include (see pic). I apparently didn't understand the process well enough to make the correct selections. I had found out afterwards that the company had its own CAD rules, it was low on the website and I didn't find it until after submission! D'oh!!
images



Amazingly, I think it came out pretty good. I can't wait to get it in hand to see up close. There are some holes that are not perfectly centered, but certainly serviceable.

upload_2014-12-16_11-14-28.png
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
The conformal coat overspray I intend to do (once verified that the circuit works) should help protect the holes to some degree - I know it won't completely cover them, but it will keep the surfaces clean if they should ever need to be used.

Aside from receiving the boards and assembly, what can I work on next from the programming side?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
With projects like this, I just start by creating a source file. One source file is enough; there's not enough complexity to justify splitting the functionality into multiple modules and that just makes it harder to edit.

I start by defining and describing the hardware - the target device, settings (e.g. using the internal oscillator), and specifying the I/O signal names and characteristics. Then I write a description of the purpose of the unit and the firmware, and I describe the functions it needs to perform, and the general structure of the program (this can change and it may be best to write that part later).

Somewhere in there, I mention the toolchain that's used to build the firmware and any special settings that are needed. Then I define operating constants, document the device's internal register settings, and allocate variables. Then the code begins!

All that documentation may seem like a pain, but there are good reasons for it. It clarifies the project and the firmware requirements in your mind, but most importantly it provides a relatively quick but thorough overview to anyone else who reads the code. Perhaps no one else ever will read the code, but there's a fair chance that you'll come back to it later - to add a feature or change a behaviour slightly, or to use the code in another project - and the "future you" is like a new person who is not familiar with the project or the way it's designed.

This especially applies as you get older and your brain gets full and/or slows down. Having a poor memory can be an advantage because it forces you to document your code clearly - if not for the benefit of others, then for your own benefit!

Have a look at the code in https://www.electronicspoint.com/projectlogs/fanrunon-delayed-turn-off-for-bathroom-extractor-fan.1/ for an example. That one is written in assembler; I guess you'll be using C for this project.

Once you have your work cut out for you, you start by considering the functions your code needs to perform, and how best to structure the program. This takes some experience and I'll give you some suggestions once you've defined the behaviour you want.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Christmas arrived at my house today :):D:):D:):D

I don't know what to do with myself - the boards and my PicKit3 came!!! Abandon all theory and reading on programming - it's hands on time! :D:D

I am very proud of my first drag solder operation:

002_zps5bfb4eac.jpg


Not so much my first 0603 - I had to remove it and replace it - I measured the cap in circuit thinking I may have damaged it because it got stuck to my iron tip for about 5 seconds. Of course in circuit changes everything, pull it out and it specs out ok. I re-soldered it and it looks like crap, but its electrically ok.

003_zps66904794.png


I also learned that taking close up pics like this are valuable - I spotted a tin whisker between pins of the other soic and was able to remove it
images
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
lookin' good :)
well done
Thanks Dave! I have never soldered this many pieces in a project before, it was a long several hours, but I went slow and paid attention to learn as I went. I also tried to remember all I had read and watched about soldering. Helped quite a bit! Here are a few pics of the finished board.

0022_zps13dee2b3.jpg


0012_zps421d344a.jpg
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Wow! That's brilliant John! The soldering on U2 looks just perfect!

Now you "just" need to write the software to control it!
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Wow! That's brilliant John! The soldering on U2 looks just perfect!

Now you "just" need to write the software to control it!
Thanks Kris :)

"Just" you say?? LOL, the control journey now begins! If this was Lord of the Rings, I would say we are at Book 1 after taking refuge in Rivendell - LOL, so many roads to cross yet!
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I'll take your word on the LOTR reference... that fantasy stuff doesn't do it for me :)

Yes there's a fair bit of learning but you have such a great attitude I'm sure you're already taking it in your stride. And there are many people here who can help. Have you written up your initial comments yet? Will you be programming it in C?
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
I'll take your word on the LOTR reference... that fantasy stuff doesn't do it for me :)

Yes there's a fair bit of learning but you have such a great attitude I'm sure you're already taking it in your stride. And there are many people here who can help. Have you written up your initial comments yet? Will you be programming it in C?

Ok, how about Rocky II, 14th round? LOL not quite the heavyweight champion, but getting there? :D:p

Thanks bud! Not so sure about stride, I have lost my direction a bit - so many cool distractions just came in the mail, now at least that the board is made up and out of the way I can try and focus on programming! Although that other thread drew my attention all night and I found some interesting links, which I will share later on that thread :cool::D. I can honestly say that I have not forgotten your post (#330) - I actually copied and pegged it to my desktop as a reminder of my next step! No, I have not written up my initial comments, but I will soon. As for C or ASM I am not sure, I like the fact that ASM helps me understand directly the architecture being used, but I do appreciate the fact that C allows me to get the job done without having to repetitively direct each bit... So many directions, so little time, so little knowledge, LOL.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
No worries! Your priorities are for you only to determine, and you can't do everything at once!
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
No worries! Your priorities are for you only to determine, and you can't do everything at once!
That's the hard part!! There is so much cool stuff vying for my time it's disorienting! And it's a great problem :D

I am watching a course called Understanding Modern Electronics - its 24 half hour lectures, I'm on the eighth one - transistors as amplifiers. The professor was talking about load line analysis or something of that nature and my eyes did glaze over a bit... I think I will have to rewatch that one! Just sooo much to take in, I am watching the videos as a way to learn more about general electronics, then project specific, I spent some time watching videos on soldering as well as reading various articles on techniques of soldering, tips, ideal soldering temps, etc. Then general interest tinkering has me looking for bits and pieces on e-bay :rolleyes: - I haven't ordered anything, but I am thinking about picking up some magnet wire and some other odds and ends.

More importantly, for the task on hand - I need to get started on it soon!!!!! Bear with me ;)
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Ok, some preliminary stuff:
upload_2015-1-4_23-56-16.png
/*
* Dust Collector Delay Circuit
* Chopnhack
* 2015
*
* Purpose: This circuit has been designed to automatically turn on a dust collector when another tool is running. The criteria for turning on the DC (dust collector)
* will be at least 5 amps at 120v or 4 amps at 240v AC. This should allow the DC to run when large dust producing tools are being used without triggering
* on smaller tools. This should save time in the shop and allow for cleaner air and floor as the DC will turn on at the time its needed. The DC will have a
* delay, to run for ~10 seconds after the triggering tool has ended operation to clear out the ductwork.
*
* Hardware: Refer to schematic or board. Power will come into the circuit via a rocker switch mounted through the 4" steel electrical box wall (not shown in
* schematic). The circuit is protected by an inline, 160mA slow blow fuse and comes on-board at connector CN1. From there, AC power travels through
* a transformer, providing isolation from mains as well as a secondary fuse (transformer is self limiting). The stepped down power gets rectified via
* BR1, full wave bridge rectifier. This is then filtered via C1 and C2 electrolytic caps before entering U1, a 7805 LDO voltage regulator and exiting,
* filtered by C3 at +5V DC. R1 provides a constant current for a power-on LED indicator via jumper J1.
*
* The +5V output continues and feeds 4 more areas: the PIC microcontroller (PIC12F675), Allegro Hall Effect ACS712 chips, Q1 2n3904 power amplifier
* and the coil K1.
*
* When current is sensed in either Allegro chip, (this would be from an outlet in series with the chip via connectors CN2 or CN3, one for 120v and
* one for 240v) pin 7 will send out an analog signal (amplitude varies with current). This signal enters the PIC at pins 3 and 5 - one for each sensor chip.
* C4 and C6 are filter & C5 and C7 are bypass caps for the Allegro chips. I believe R2 pulls down the master clear (MCLR) Pin 4 so it's not left floating
* (R2 allows for 0.15mA of current to pass). R3 limits current, but allows mains frequency to to reach pin 2 of the PIC (CKLIN), while C9 filters the signal.
* Pins 1 & 8 are V+ and V- or ground with C8 filtering between. Pin 7 is the output, which will trigger the coil via R4 and Q1. D1 prevents backfeeding the
* circuit when the magnetic field collapses. R5 and C10 help to dissipate power as the field collapses. K1 will the relay separating power from our switched
* device.
*/
 
Top