Author Topic: Working with relays  (Read 33068 times)

germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #45 on: July 13, 2013, 06:01:24 am »
I see what you mean with the terminals, I'll keep that in mind.
Uhhh... seems the darlington was tricker than I thought. I'm not exactly sure how it inverting the output can cause so much trouble.
But as you said, I don't really need them for this specific project, so I'll just remove them again. It's jut nice to know how they work for future builds. Guess I could just use transistors if the load on the board is too high.

You mean leading the GND to the terminal instead of just the board? Well that's no problem, I'll do that.
I'll bring the AMicro up to DS standard (everytime I rework one of them I get the urge to do the other, because I always improve something that carries over), remove the darlington and see where it all end up.
Realizing how tiny all this is, I'll have a fun day of soldering. Removing the darlington really just makes everything easier anyway.


*edit* So it's back to basic with all through hole nice spacing and thickness, all the other stuff I learned and everything neatly in 90º or 45º angles for my OCD ;)
Also no need for the Arduino to be outside of the board, just makes it easier to damage.
I already changed it a bit since I uploaded the image tho, moved the LEDs one step to the left, they were a tiny bot too close to the SSRs.
I COULD make it smaller, by switching the 230v IN and output 5. But that would add to confusion when it's installed.

With all this work, I hope you won't tell me that it's just as easy to make a double-sided PCB xD
Thanks a lot Mark and everyone for all the help!

-> https://dl.dropboxusercontent.com/u/524696/Arduino/Rboard.r3.5fl-Amicro.PNG <-
« Last Edit: July 13, 2013, 07:32:28 am by germ »

Mark

  • Full Member
  • ***
  • Posts: 196
Re: Working with relays
« Reply #46 on: July 13, 2013, 03:53:44 pm »
germ

That looks really great and very polished.

Quote
Guess I could just use transistors if the load on the board is too high.
Unfortunately you are in the same boat, since they invert.
Think of a transistor as a relay, but with one contact joined to one of the coil wires, and that has to be ground.
Instead of switching the phase (volts), you have to switch the neutral (ground).

Before you commit to getting it manufactured, you may want to include some mounting holes (pad with clearance for the standoff) and check if it fits in the enclosure of your choice, that gives you sufficient room for the cord grips, etc.

Mark


germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #47 on: July 13, 2013, 05:19:42 pm »
Thanks Mark!
I already tweaked it a little. Increased the size of the pads (compared them to the digispark pads), and removed all 90º bends in favor of the 45º ones.
Also changed to one size bigger resistors, just in case.  It turned out pretty small still, only about 65x60mm.

Oh, and I rotated the LED, no one told me they were backwards xD
https://dl.dropboxusercontent.com/u/524696/Arduino/Rboard.r3.5%20final%20Amicro.PNG

Yeah, mounting holes... I'll do a few of those too.
I was going to print it, and try to make my own PCB, following some guides over at instructables. I'm not sure if I'll succeed, but you never learn if you don't try right? :)


« Last Edit: July 13, 2013, 05:21:36 pm by germ »

Mark

  • Full Member
  • ***
  • Posts: 196
Re: Working with relays
« Reply #48 on: July 13, 2013, 06:14:58 pm »
germ
Your LED's were around the right way to start with.
http://electronicsclub.info/leds.htm

What was not completely right was the pads should have been swapped in the component template.
If you wanted more space, you could consider moving the resistors to be parallel to the ssr, shifting the led left, and running the pin 2 trace through the resistor to the Kathode of the LED. A short track heading right from the Anode to the resistor.

I still think the pads for your connectors are on the light side.
I recall most of the pins are 1.2-1.5mm which doesn't leave a lot of track after drilling.
Sometimes there are VIA's which might be larger. Since you are printing it, their function is immaterial.



Mark

germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #49 on: July 14, 2013, 02:23:19 am »
Oh, well that's just confusing. Yeah I read that the square pad should be +. But flat side is k huh, well I'll just remake the component :P
I'll consider it, and I'll try it :)
Hmmm, yeah well to be honest they did look bigger in the software, maybe it was the background.
The problem is that I have to de-construct and reconstruct every component manually to replace the pads. But I'll try one size bigger, see how it turns out.

Thanks!

Mark

  • Full Member
  • ***
  • Posts: 196
Re: Working with relays
« Reply #50 on: July 14, 2013, 03:17:36 am »
germ

re pulling it apart
If you don't care and will build it yourself, it doesn't matter, just stick the led in the right way.
If you are having a silkscreen they changing it to suit might be the better option.

You may be able to drop a much larger PAD over the top.
Since you're manually placing it, it should work fine.

Cheers
mark



germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #51 on: July 14, 2013, 11:21:10 am »
Well I had to change all the pads anyway. Made the as big as I dared, and made the hole a lot smaller. As I'm drilling it myself, I don't want any holes ending up with gaps between the hole and the pad.
I switched the LED and the resistors, was that how you meant? It became a bit more compact, and the trace looks a little cooler ;)
We'll probably fix the mounting holes when we cut the board later. Probably just make it a bit bigger.



Will have vacation in a week, then I'll probably try to etch the board :)

Mark

  • Full Member
  • ***
  • Posts: 196
Re: Working with relays
« Reply #52 on: July 14, 2013, 05:13:53 pm »
germ
 
Yes that was the way I thought might give you some room.
It looks good. :D
 
You might have enough room for mounting at the left corners, and for the right side between the two tracks on the upper, and a little left of the fuse for the lower.
 
No need to make it bigger if you don't have to ... ;) 
Mark

germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #53 on: July 15, 2013, 07:39:46 am »
Measured the 230v LEDs today. My Fluke didn't register over 61mA at any point, so I'm pretty confident the SSRs won't die.
Ok, so I'm pretty happy with this. Now does the micro handle more mA per output than the digispark?
I was thinking that the next step will be flashing one of my sparks with littlewire and mount a chip right onto the board.

I need a chip that is programmable with the digispark, so that's at least all the ATtiny with <=8pins, right?
Can I program a ATMega, and is there any reason to go with an ATMega instead of a ATtiny?

Second question would be, how much do I need apart from the chip? I want to skip all fancy stuff; no power on LED, no test LED, not voltage regulator for 7-12v etc.
I just need 5 outputs and 1 input. Does a ATTINY13A work? (If I keep my code to 1kb)

Yeah I won't let this thread die just yet, I'm learning too much :)


semicolo

  • Full Member
  • ***
  • Posts: 137
Re: Working with relays
« Reply #54 on: July 15, 2013, 12:42:44 pm »
If I'm not mistaken you need to keep the reset pin if you want to be able to reprogram your chip (for example you need a high voltage programmer to erase a digispark without using the bootloader).
So you'd get only 5 I/Os on a 8 pin MCU.
But you could use a 14 pins Tiny24, 44 or 84 (I don't think the code is compatible though) and even a mega.

The chip you choose depends on the flash size and peripheral you need.

If using the internal oscillator you only need a 100nF capacitor between Gnd and 5V.

germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #55 on: July 15, 2013, 02:51:02 pm »
Aww, that so? And I need all 6 of them. So I guess I'll go for a 24/44... question is... Can I program those with the digispark, or am I limited to the 8-pin chips?
Was thinking of building a programming shield for my sparky and then program the chips. Too bad you loose an I/O =/
Still, any help in using something else would be nice too.

semicolo

  • Full Member
  • ***
  • Posts: 137
Re: Working with relays
« Reply #56 on: July 15, 2013, 06:26:00 pm »
I think I remember some posts about using the spark as a programmer for other chips like the atmega or tiny44. But I'm sure it can be done, problem is the amount of work needed.
You also need to build the code with different tools for the tiny44, you can use the arduino ide for atmegas.

Maybe the arduinoISP sketch can be used with some changes on a digispark too.

germ

  • Jr. Member
  • **
  • Posts: 53
Re: Working with relays
« Reply #57 on: July 16, 2013, 06:57:06 am »
So, as far as I've gathered, the first number in the name is the amount of flash memory in kB. But what is the last number?
You men that the AttinyX4 doesn't understand the same kind of kode as the 85?
As it seemed extremely simple to program another 85, I thought maybe it wouldn't be rocket science to do it with a 13A or a 24/44/84.
What about Attiny45? Isn't that basically a 85 but with 4k memory?

Worst case, can I sacrifice the reset pin for a "one time only" programming of a chip? To get all the I/Os.

semicolo

  • Full Member
  • ***
  • Posts: 137
Re: Working with relays
« Reply #58 on: July 16, 2013, 07:50:20 am »
I'm not 100% sure but I think tiny84 doesn't use the same code as tiny85, I'll double check.
Yes the first number is a code for flash/ram size the other one tells the chip kind (that's why I say they don't use the same bytecode).

Yes a tiny45 is the same with 4K flash and also half RAM/EEPROM but you have to tell the compiler about this.

Last question is also a yes, you have to burn it right the first time, write the flash then the fuses.


semicolo

  • Full Member
  • ***
  • Posts: 137
Re: Working with relays
« Reply #59 on: July 16, 2013, 08:05:30 am »
Found this http://hlt.media.mit.edu/?p=1695 while searching if 84 and 85 had compatible code.
The guy provides models to build code using the arduino software for different tinys.

You still need a regular arduino to burn the chip though.