navitron
 
Renewable Energy and Sustainability Forum
UK's most popular Renewable Energy Forum May 23, 2012, 10:01:39 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: UPDATE ON DECC APPLICATION FOR LEAVE TO APPEAL TO THE SUPREME COURT | Yingli Green Energy's PV Module Ranks No.2 in TUV Rheinland Energy Yield Test | Navitron Solar Showers at Glastonbury for Year 5!
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: electronics help needed for a DS2408 relay driver please  (Read 3060 times)
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« on: October 15, 2010, 04:40:09 PM »

I will have to ask for help now as i have blown up 2 DS2408's and i only have one left  wackoold

I have written a pretty comprehensive Central heating controller - logger and viewer for the PC in VB.net

so far I have been testing the switching part by having a DS2408 wired up to the Onewire cct with 8 LEDS to show me if ports are turning on/off when programmed.
All has been working without fault for a few days now and
my relays and relay drivers came today so i thought i'd substitute the leds for the relays
and put the leds on the relay outputs just to test that part of the cct.

well obviously my programming skills are much better than my electronic skills as I have accidently blown two DS2408s.
I can still see it on the onewire server but cant write to it anymore.

all I have done is to run the outputs of the ds2408 to the inputs of a ULN2803 relay driver.
the ground pin on the ULN2803 was connected to a seperate 5v grnd supply and pin 10 to vcc

Led connected on output pin 18  and input from DS2408 to pin 1.
This as expected didn't work as i guessed I'n need to connect the one wire vcc and ground to the local 5v supply somehow

Thats where the blowing up bit came in !   when i conected these together !

obviously i dont understand what i am doing  whistlie
I only had a led on the output at that stage so the relays were not to blame.

should i have added a resistor between the two Vcc's

I know there are a lot of electronics genius's out there so i feel pretty stupid but hopefull  Roll Eyes

Thank

Mike
Logged
wyleu
Guest
« Reply #1 on: October 15, 2010, 05:16:36 PM »

Have you placed a reverse diode across the relay coils? As a relay turns off the inductance of the coil try to maintain the current flow which results in a large voltage spike, which might well be causing the problem. It can get up to 10's and even hundred of volts.

Probably a good idea to put a 100 uF or so capacitor across the supply lines to the board as well and if your feeling particularly cautious try strapping a small 10nF cap across the PSU because electrolytics can't perform very well at higher frequencies.

In an ideal world you'd want 'proper' decoupling between your one-wire bits and pieces and your relay stuff. The one wire data sheets have a fair bit of shottky diodes and such like, but I would try running the relay's from their own supply. This may only consist of raw ~15 V supply with a 7805 to power the one wire stuff and similar for the relays. Again if your really into belt and braces and also if your running mains on the relays it might be sensible to consider opto isolation on the relay front ends to reduce the risk of mains getting back into your one-wire bits and from there back into your PC.

A circuit diagram will probably help simply because it avoids those 'I wonder what this might do?' type moments, it also gives the bobbing minds in a jar that float zen like round here something to fight over! Cheesy

If it makes you feel any better My third year degree project fried an £80 Switched capacitor filter chip the first time I turned it on, and that was when £80 would buy you most of a Yorkshire Village with first call on the local maidens.
« Last Edit: October 15, 2010, 05:25:37 PM by wyleu » Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #2 on: October 15, 2010, 05:58:21 PM »

Mike
You need to have the grounds of the one wire bus and the relay power supply commoned and connected to pin 9 of the ULN2803.
The power supply to drive the relays goes to ULN2803 pin 10 (the reverse diodes that Wyleu mentioned are provided internally and connected to this pin)  Datasheet is here http://focus.ti.com/lit/ds/symlink/uln2803a.pdf

You can optionally connect +5v to the DS2408 pin 3, (otherwise it must be connected to gnd), as I assume you have +5v from the 1 wire bus (you were driving LEDs previously) then it would be safer to use this rather than the relay supply.

Finally as the DS2408 outputs are open drain you will need to have pullups on them to operate the ULN2803 inputs
Logged
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #3 on: October 15, 2010, 06:53:04 PM »

Thanks for both replies.
wyleu : I didnt have the relays connected at all (actually they arent even relays they are solid state relays)
ericw : Thats really how i had it connected i think. the two earths going to pin 9 it didnt work ! so i added the +5v to the onewire vcc thats when it went poof!

strangely and more worryingly I have soldered in a new 2408 and am testing it with the original setup that worked before and although I can 'see' the new chip I still cant write to it?
so maybe i didnt blow the chip - but have done something bad to the server?Huh

I am using a EDS OWserver which is on my ethernet network and am using a browser to read the owserver page where you can manually write to the latch - as I said this was working fine before so I am now worried that the server is bumblebeed - although i can't see how.

mike
Logged
KenB
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2691


Energy Self Enlightenment


WWW
« Reply #4 on: October 15, 2010, 08:17:20 PM »

Mike,

Backtrack to the point where you had the LEDs working - that way you can prove that you probably haven't blown up the outputs of the DS2408.

As Eric says, the outputs of the DS2408 are open drain - you won't see any logic level change on them unless you take a resistor up to +5V from each output.   Try 10K.

It's not called "hard"ware for nothing you know ;-)


Good luck


Ken
Logged
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #5 on: October 16, 2010, 03:56:09 PM »

Thank you all.

I realised my breadboard (bought from china)  is rubbish and was causing problems when ever a wire was moved accidentally.

So I have made a proper cct on vero board.

Following the advice I have used 10k pullups on all I/O ports and the RSTZ pin.

I have commoned the grounds on pin 9 of the driver and put the local 5v on pin 10.

I can now read and write to the output latch as before (phew!)

I have tried a solid state relay and then tried just a LED wired to pin 9 grnd and the positive side to the driver output pin but neither works.

I am getting only 0.5volts on the outputs of the driver!  not enough to even power a led certainly not the relays
when i put a logic probe on a driver output i get both hi and lo leds lighting ?

as the driver is open collector do you think I should run vcc to the + side of the relay and then take the neg side to the output pin?
that seems logical.
to be honest this is a little beyond me.

mike
Logged
Alan
Guest
« Reply #6 on: October 16, 2010, 05:05:28 PM »

Hello Mike

Pin 9 ground
pin 10 + volts

Your relay or ( L.E.D. + resistor ) goes from pin 18 to pin 10

When pin 1 is at 5 volts the relay / L.E.D. resistor is on.

If its not working the ULN2803A or P.S.U. is Knacked

Regards

Alan
Logged
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #7 on: October 16, 2010, 05:50:30 PM »

Hi
I think its working now - it was definitely acting as a sink so as  pin 18 go's low you need the other side of the relay on pin 10  extrahappy

I have only tested one so far as its not on the breadboard so hard wired but i assume all will work ok.

one more doubt I have is with the solid state relays when it is on if I put a meter across the switched side it fluctuates from o ohms to dis

is that just my meter ? any reason why i should get that reading?
 Huh
Logged
Alan
Guest
« Reply #8 on: October 16, 2010, 07:33:55 PM »

Hi Mike

Depends what type of meter you are using ( Battery voltage at probes )
When testing on Ohms. Readings are a bit meaningless i.e. Go / No go, with solid state
relays. The leakage cant be tested with just a meter.

Typical expectations on a 600 volt relay would be
Unenergised about 18 M Ohm
+ 5 volts on the opto coupler about 300 Ohms ish.

Just stick a tungsten bulb as a load on the A.C. side.
On when on is good
Off when off is good
Still glowing slightly when off is not so good.

Got some here many years old and still going strong.

Regards

Alan

 
Logged
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #9 on: October 17, 2010, 02:17:55 PM »

Thanks
I will try that Smiley
Logged
wookey
Hero Member
*****
Offline Offline

Posts: 2672


WWW
« Reply #10 on: October 19, 2010, 02:43:53 AM »

Good work there mpooley (I've been meaning to do this for about a year), but why VB.net for the 'comprehensive CH controller and viewer' - now you've made it useless to any non-windows solution (which is most of the good ones IMHO). Had you picked a more generally-applicable language and it would be useful to everyone. I was hoping you'd taken a job off my to-do list for a moment there, but nope - still needs doing.
Logged

Wookey
wyleu
Guest
« Reply #11 on: October 19, 2010, 06:10:16 AM »

Agree with Wookey,
Take the time to go open source on development.

Python, Java, Perl to name but three.
Logged
stephendv
Sr. Member
****
Offline Offline

Posts: 439



WWW
« Reply #12 on: October 19, 2010, 09:03:29 AM »

Agree with wookey and wyleu, a proper language like java, python or ruby would be nice (perl excluded on purpose  Wink )

Failing that, would VB.NET work on the Netduino platform?:  http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=559
Logged

http://www.casanogaldelasbrujas.com
2.8kW PV, SMA Sunny Island 5048, 5 PzS 700 battery bank, stinky diesel.
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #13 on: October 19, 2010, 11:53:00 AM »

The answer to that question is easy.
I have been programming in VB.net for many years and I am comfortable with it.
I also have a pc win 7 network at home so thats what I wanted - sorry

I tried linux for a while but in the end it just was too much work.
Never looked at java or perl

Might do one day!  lovefirefox

PS I think VB,net IS a proper language - up to vb6 maybe you could say that but VB now has everything C# has ,so i dont really see any need to change now.
« Last Edit: October 19, 2010, 12:06:32 PM by mpooley » Logged
wyleu
Guest
« Reply #14 on: October 19, 2010, 12:15:37 PM »

Heads off to build large bonfire & check the ducking stool restraining straps... whistlie  lovefirefox
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!