Author Topic: webserver relai and Opto cupler - board selv made  (Read 5727 times)

Helmut

  • Newbie
  • *
  • Posts: 3
    • View Profile
webserver relai and Opto cupler - board selv made
« on: March 09, 2009, 02:55:11 PM »
i have built a board for 24 relais and a board for 24 opto iso Input 4 - 230 V AC or DC.
By AC you must  more measure to built a result.
Wy? :zero-cross


http://www.ip-symcon.de/forum/f19/hutschienen_24_relais_webserver-5484/#post45350
and
http://www.ip-symcon.de/forum/f19/hutschienen-modul-fuer-embedded-webserver-6659/#post54749

Have anybody a Code for many ( ~25) dallas 18b20 1-wire Temperaturen, come into the webserver?

regards
sorry for my english.....

grognut

  • Hero Member
  • *****
  • Posts: 55
    • View Profile
Re: webserver relai and Opto cupler - board selv made
« Reply #1 on: April 05, 2009, 01:00:49 AM »
Hi Helmut,

Your English is better than my German.
I followed the links but they are in German so I could go much further.

Are you asking why you may need zero crossing or how to detect an a.c. input though the opto couplers?

I have code for the DS18S20 which I believe is similar to the 18b20.
I have used the SKPang 1-wire interface board and some of his supplied routines. I can send my code but it is not very tidy but it has worked for several years over 30m of cat5e cable.

Let me know if you feel that it is useful to you.

Regards
Grognut

Helmut

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: webserver relai and Opto cupler - board selv made
« Reply #2 on: April 05, 2009, 10:19:36 AM »
If I built this with a 50Hz AC Optocouplers I have in the sine wave only a small zero.
With a simple optocoupler 10 ms, 0 volts.
Better still would be a capacitor power supply.


The 1-Wire program is written in C?
I will place this code in the Webserver and have the temperatur as temp1, temp2....
Do you built this in the modtronix Webserver?
regards Helmut

grognut

  • Hero Member
  • *****
  • Posts: 55
    • View Profile
Re: webserver relai and Opto cupler - board selv made
« Reply #3 on: April 05, 2009, 01:17:24 PM »
Hi,

There are two ways to get a steady signal from 50Hz.
1) Supply side: assuming you already have a diode and a high voltage, current limiting resistor in series with the opto diode you need to place a capacitor across the diode. I'm not quite sure what value you need but it must be sufficient to supply enough current into the opto diode for approx 20ms. When the supply voltage is under the value to energise the opto diode the capacitor will discharge into the diode and keep it on until the supply voltage reaches a high enough voltage.

2) Isolated side: assuming the opto is a open collector transistor you will need a capacitor across the pull up resistor. When the opto transistor is on the the capacitor will be charged to the isolated supply voltage. When the opto transistor switches off the capacitor will discharge through the pull up resistor and the voltage will rise slowly.


The software I have is written in C and is working on  a modtronix webserver. I will tidy up the code and add comments and put on this forum for all. It will take me a few evenings.


Good luck,

Grognut.

Helmut

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: webserver relai and Opto cupler - board selv made
« Reply #4 on: April 05, 2009, 01:21:58 PM »
Thank you,
i'm waiting for the code.
The zerocross circurit is not the problem.
Best regards
Helmut

grognut

  • Hero Member
  • *****
  • Posts: 55
    • View Profile
Re: webserver relai and Opto cupler - board selv made
« Reply #5 on: April 09, 2009, 11:05:02 AM »
Hi Helmut,

I was hoping to add comments to the code but I don't have time so I'm posting it now.

The wind direction software was written by me, based on an algorithm I found on the web. I would like to give credit to the author but I can't remember who it was. I will post the credit at a later time.

I had a few problems talking to the wind direction unit as you see in the code, but it worked in the end. Unfortunately I haven't had a chance to install the anemometer because I haven't got easy access to my roof. It's the AAG device by the way.

As I said in an earlier post the hardware interface I use the DS2482. I used SKpang's board (http://www.skpang.co.uk/catalog/product_info.php?cPath=33_35&products_id=136) which worked well. It comes with an RTC and locations for eeprom. If you don't use the DS2482 you will need to write low level drivers for the one wire system. It's not difficult, I have done it before on an 8051 and the Dallas web site is good for info. I may be able to help you with this if you need it. The biggest problem is that the timing requires interrupts off for up to 500us which may be a problem in some systems, ie buffering in a uart with less than a two byte buffer at 19200 baud.

If you need any explanations I will help as well as I can.

Good luck

Grognut