Electronics-Related.com
Forums

Simple Ethernet Board with Register

Started by Klaus Kragelund October 29, 2013
Klaus Kragelund <klauskvik@hotmail.com> wrote:
> I could use a raspberry pi, but I am looking for something simpler. In > some cases I just need to set or clear a relay.
A piece of twisted-pair Ethernet cable supports up to 7 relays; use relays with (say) 5 V coils and feed the cable with 6 V or 9 V or whatever you need to overcome the voltage drop. (Watch out for the current in the return wire.) If you later need more than a relay at a location, you can unplug the Ethernet cable from the relays and the relay driver and plug it into a real Ethernet port. Or, use RS-232 or RS-485, which pretty much every microcontroller already supports. Use one pair in the Ethernet cable for serial data and another for power. Again, when it's time to upgrade to "real" Ethernet, just unplug the cable and swap.
> Do anyone know of a very simple board with an ethernet Phy on > (possibly with a logic output), that can be used for this?
If you only need to drive one relay, and the PHY provides the "link LED" function, wire the relay coil to the PHY's LED output. Then, disable or enable the Ethernet port at the other end under software control; then you need zero code on the microcontroller next to the relay. :) (If the PHY also provides a 10/100/1000 LED output, and you can control that on the other end, you can run more than one relay.) Matt Roberds
On Tuesday, October 29, 2013 4:18:44 PM UTC-7, mrob...@att.net wrote:
> Klaus Kragelund <klauskvik@hotmail.com> wrote: >=20 > > I could use a raspberry pi, but I am looking for something simpler. In > > some cases I just need to set or clear a relay. >=20
> A piece of twisted-pair Ethernet cable supports up to 7 relays; use > relays with (say) 5 V coils and feed the cable with 6 V or 9 V or > whatever you need to overcome the voltage drop. (Watch out for the > current in the return wire.) If you later need more than a relay at a > location, you can unplug the Ethernet cable from the relays and the > relay driver and plug it into a real Ethernet port.
If i understand it correctly, the existing cables are running IP over Ether= net (and thus Internet). That's the reason of OP's choice of Ethernet boar= d. It may or may not be a good idea. But as long as he is doing so, his d= esign must co-exist with IP, including but not limited to, DHCP, TCP and UD= P, etc. If we are free to pick the media (Cat-3,4,5,6), then i choose none and go w= ith RF. Power is likely available close to whatever equipment he is contro= lling anyway.
On Tue, 29 Oct 2013 06:59:18 -0700 (PDT), Klaus Kragelund
<klauskvik@hotmail.com> wrote:

>Hi > >For a home automation project, I need to control some devices via an ethernet connection. > >I could use a raspberry pi, but I am looking for something simpler. In some cases I just need to set or clear a relay. > >Do anyone know of a very simple board with an ethernet Phy on (possibly with a logic output), that can be used for this? > >Perhaps something like a W5100 based board. > >https://www.sparkfun.com/datasheets/DevTools/Arduino/W5100_Datasheet_v1_1_6.pdf > >Regards > >Klaus
How about a MPS430 ? $35, Looks like a CS8900 on it and lots of I/O. <http://microcontrollershop.com/product_info.php?cPath=98&products_id=741> Cheers
On Wednesday, October 30, 2013 1:49:49 AM UTC+1, edward....@gmail.com wrote=
:
> On Tuesday, October 29, 2013 4:18:44 PM UTC-7, mrob...@att.net wrote: >=20 > > Klaus Kragelund <klauskvik@hotmail.com> wrote: >=20 > >=20 >=20 > > > I could use a raspberry pi, but I am looking for something simpler. I=
n
>=20 > > > some cases I just need to set or clear a relay. >=20 > >=20 >=20 >=20 >=20 > > A piece of twisted-pair Ethernet cable supports up to 7 relays; use >=20 > > relays with (say) 5 V coils and feed the cable with 6 V or 9 V or >=20 > > whatever you need to overcome the voltage drop. (Watch out for the >=20 > > current in the return wire.) If you later need more than a relay at a >=20 > > location, you can unplug the Ethernet cable from the relays and the >=20 > > relay driver and plug it into a real Ethernet port. >=20 >=20 >=20 > If i understand it correctly, the existing cables are running IP over Eth=
ernet (and thus Internet). That's the reason of OP's choice of Ethernet bo= ard. It may or may not be a good idea. But as long as he is doing so, his= design must co-exist with IP, including but not limited to, DHCP, TCP and = UDP, etc.
>=20
Correct, the usage of the cabling can only be in the extend that only 4 wir= es are used for 100BaseT and below, so if I upgrade to 1000BaseT it conflic= ts with the usage of wires. Cheers Klaus
On Tue, 29 Oct 2013 11:34:38 -0700 (PDT), edward.ming.lee@gmail.com
wrote:

> >> >So, for $10 we have an IP server with ethernet. >> Does Microchip provide sample code for this kind of application? I >> guess you need to allow for both the USB and Ethernet stacks, and some >> additional software? > >Yes, you can link in both libraries and call them from your main. >Yes, of course, you have to write your main code. >
Not the main code, the USB Class driver for the USB-to-Ethernet adapter. I only see USB to serial in the CDC. Best regards, --sp
On Wednesday, October 30, 2013 11:46:20 AM UTC-7, Spehro Pefhany wrote:
> On Tue, 29 Oct 2013 11:34:38 -0700 (PDT), edward.ming.lee@gmail.com >=20 >=20 > >> >So, for $10 we have an IP server with ethernet. > >> Does Microchip provide sample code for this kind of application? I > >> guess you need to allow for both the USB and Ethernet stacks, and some > >> additional software? >=20 > >Yes, you can link in both libraries and call them from your main. > >Yes, of course, you have to write your main code. >=20 >=20 > Not the main code, the USB Class driver for the USB-to-Ethernet > adapter. I only see USB to serial in the CDC.=20 >=20
There is a TCP stack library and a USB host library. Your main code call t= he host functions for USB emulation. Within the USB library functions, you = need to put in hocks to call the TCP functions. But you also have to deal = with the unique USB chip set. So, it's doable but still lots of work. We were heading that direction, but switched to RF instead. It's a lot sim= pler to just SPI the RF chip (MRF24J40).
On Tuesday, October 29, 2013 9:59:18 AM UTC-4, Klaus Kragelund wrote:
> Hi > For a home automation project, I need to control some devices via an ethernet connection. > I could use a raspberry pi, but I am looking for something simpler. In some cases I just need to set or clear a relay. > Do anyone know of a very simple board with an ethernet Phy on (possibly with a logic output), that can be used for this? > Perhaps something like a W5100 based board. >https://www.sparkfun.com/datasheets/DevTools/Arduino/W5100_Datasheet_v1_1_6.pdf > Regards > Klaus
How about this: http://www.ebay.com/itm/Mini-ENC28J60-Ethernet-LAN-Network-Module-For-Arduino-51-AVR-SPI-PIC-STM32-LPC-/130964384329?pt=LH_DefaultDomain_0&hash=item1e7e15ea49 I have driven this board with an AVR Mega328P, but anything that does SPI will work. Al told, you'll end up with about $5 worth of parts, and a half-hour or so to build, if you're doing more than one. Then you'll need a relay.
On Tue, 29 Oct 2013 17:49:49 -0700 (PDT), edward.ming.lee@gmail.com =
wrote:

>On Tuesday, October 29, 2013 4:18:44 PM UTC-7, mrob...@att.net wrote: >> Klaus Kragelund <klauskvik@hotmail.com> wrote: >>=20 >> > I could use a raspberry pi, but I am looking for something simpler. =
In
>> > some cases I just need to set or clear a relay. >>=20 > >> A piece of twisted-pair Ethernet cable supports up to 7 relays; use >> relays with (say) 5 V coils and feed the cable with 6 V or 9 V or >> whatever you need to overcome the voltage drop. (Watch out for the >> current in the return wire.) If you later need more than a relay at a >> location, you can unplug the Ethernet cable from the relays and the >> relay driver and plug it into a real Ethernet port. > >If i understand it correctly, the existing cables are running IP over =
Ethernet (and thus Internet). That's the reason of OP's choice of = Ethernet board. It may or may not be a good idea. But as long as he is = doing so, his design must co-exist with IP, including but not limited to,= DHCP, TCP and UDP, etc.
> >If we are free to pick the media (Cat-3,4,5,6), then i choose none and =
go with RF. Power is likely available close to whatever equipment he is = controlling anyway. The use of Ethernet does not imply a connection to Internet, nor does a connection to Internet necessarily mean Ethernet (it could be DSLAM = direct or some AAL device). ?-)
Klaus Kragelund <klauskvik@hotmail.com> wrote:
> On Wednesday, October 30, 2013 1:49:49 AM UTC+1, edward....@gmail.com wrote: >> On Tuesday, October 29, 2013 4:18:44 PM UTC-7, mrob...@att.net wrote: >> >>> A piece of twisted-pair Ethernet cable supports up to 7 relays; use >>> relays with (say) 5 V coils and feed the cable with 6 V or 9 V or >>> whatever you need to overcome the voltage drop. >> >> If i understand it correctly, the existing cables are running IP over >> Ethernet (and thus Internet). That's the reason of OP's choice of >> Ethernet board. > > Correct, the usage of the cabling can only be in the extend that only > 4 wires are used for 100BaseT and below, so if I upgrade to 1000BaseT > it conflicts with the usage of wires.
OK. I thought you would be running new cable for the home automation devices, rather than connecting to an existing network. That's why I suggested using all 8 wires for your own purposes. Matt Roberds
On Wednesday, October 30, 2013 10:53:37 PM UTC+1, rangerssuck wrote:
> On Tuesday, October 29, 2013 9:59:18 AM UTC-4, Klaus Kragelund wrote: > > > Hi > > > For a home automation project, I need to control some devices via an ethernet connection. > > > I could use a raspberry pi, but I am looking for something simpler. In some cases I just need to set or clear a relay. > > > Do anyone know of a very simple board with an ethernet Phy on (possibly with a logic output), that can be used for this? > > > Perhaps something like a W5100 based board. > > >https://www.sparkfun.com/datasheets/DevTools/Arduino/W5100_Datasheet_v1_1_6.pdf > > > Regards > > > Klaus > > > > How about this: > > http://www.ebay.com/itm/Mini-ENC28J60-Ethernet-LAN-Network-Module-For-Arduino-51-AVR-SPI-PIC-STM32-LPC-/130964384329?pt=LH_DefaultDomain_0&hash=item1e7e15ea49 > > > > I have driven this board with an AVR Mega328P, but anything that does SPI will work. Al told, you'll end up with about $5 worth of parts, and a half-hour or so to build, if you're doing more than one. Then you'll need a relay.
This one is really nice, only 39USD: https://www.spark.io/# Cheers Klaus