Posts with «domotics» label

Fixing an enc28J60 based Arduino Mega ethertnet shield

Prototyping my home automation system i ran into troubles. I can’t make work two SPI devices on Arduino Mega. One is an ethernet shield based on enc28J60 made by ekitszone, other is a small module based on Nordic’s nRF24L01+ transceiver. Spot the problem without an oscilloscope was really frustrating, oscilloscopes are not hacker’s best friends for nothing. After checking and rechecking solder joints, my code, astral conjunctions, finally i found the real problem. Trivially MOSI and MISO signals of SPI bus on ethernet shiled are reversed. Detaching the shield from Arduino and using a breadboard to invert MOSI (pin 51) and MISO (pin 50) make everything work (to be true, my code doesn’t use ethernet yet but the transreceiver works like a charm now). I don’t know which batches are affected but if you are in trouble with these shield using enc28J60 datasheet and a tester try to figure out if this is your situation. Happy hacking.

Eraclitux 05 Jun 19:15
arduino  domotics  hardware  tips  

Fixing an enc28J60 based Arduino Mega ethertnet shield

Prototyping my home automation system i ran into troubles. I can’t make work two SPI devices on Arduino Mega. One is an ethernet shield based on enc28J60 made by ekitszone, other is a small module based on Nordic’s nRF24L01+ transceiver. Spot the problem without an oscilloscope was really frustrating, oscilloscopes are not hacker’s best friends for nothing. After checking and rechecking solder joints, my code, astral conjunctions, finally i found the real problem. Trivially MOSI and MISO on ethernet shiled are reversed. Detaching the shield from Arduino and using a breadboard to invert MOSI (pin 51) and MISO (pin 50) make everything work (to be true, my code doesn’t use ethernet yet but the transreceiver works like a charm now). I don’t know which batches are affected but if you are in trouble with these shield using enc28J60 datasheet and a tester try to figure out if this is your situation. Happy hacking.

Eraclitux 05 Jun 19:15
arduino  domotics  hardware  tips  

EIA 485 over unused pairs of ethernet cable [Test]

To carry out my plan of a home automation system (domotics) made by me I am experimenting the use of the EIA 485 communications protocol. Having wired the house with lots of cat5 cables and knowing that two of the four pairs of which it is composed are not used to the speed of 100 Mb, I tried to pass the signal on these wires to see if the two streams (TCP/IP and the EIA 485) could coexist without major problems. Here’s how the test was performed:

I defined my own communication protocol as the EIA 485 only defines the physical parameters, as Master-Slave, half duplex with 14-byte frame consisting of address, the slave’s actions, 5 bytes for data and one byte for checksum and other embroidery. For each frame received correctly, the slave sends an acknowledge to the master after performing the required action. The baud rate was set to 9600 bits/s serial communication 8-n-1 (8-bit data, no parity, 1 stop bit). To test these, the master cyclically sends once per second, request to slaves to put high one of their pins to turn on and off a LED. One of the pins of the PIC was connected to another LED programmed to turn on in case of the frame error, the bit FERR in the RCSTA register is set to 1 if the stop bit is erroneously detected as zero.

I’ve programmed a simple Arduino as a master, another Arduino and a pic

16f88 as a slave. In the photo appear beside the master and slave, the PIC16F88 is placed at the other end of the network cable about 10 meters long. For the test I did not use terminating resistors nor bias resistors since with these distances it’ not required. A pair of wires is connected to pins A and B integrated the MAX485, the other was used for the reference (connected to ground, to avoid groundloops …) it according to a daisy chain connection scheme. Throughout the test I have maintained a steady stream of  TCP/IP traffic node continuously pinging the node at the other end of cable. Result is that in over an hour of practice there was never a frame error (FERR bit was never set) and all the frames have been received correctly (no checksum errors). The TCP / IP traffic has not suffered any errors or delays (0% packet loss and response times in the standard). Now we have to run the test with a much longer cable!

In spare time i started to work on an Arduino shield (with relative library) for simple eia-485 communication. If you want to help me doing this consider a small donation.

Eraclitux 02 May 14:03

EIA 485 over unused pairs of ethernet cable [Test]

To carry out my plan of a home automation system (domotics) made by me I am experimenting the use of the EIA 485 communications protocol. Having wired the house with lots of cat5 cables and knowing that two of the four pairs of which it is composed are not used to the speed of 100 Mb, I tried to pass the signal on these wires to see if the two streams (TCP/IP and the EIA 485) could coexist without major problems. Here’s how the test was performed:

I defined my own communication protocol as the EIA 485 only defines the physical parameters, as Master-Slave, half duplex with 14-byte frame consisting of address, the slave’s actions, 5 bytes for data and one byte for checksum and other embroidery. For each frame received correctly, the slave sends an acknowledge to the master after performing the required action. The baud rate was set to 9600 bits/s serial communication 8-n-1 (8-bit data, no parity, 1 stop bit). To test these, the master cyclically sends once per second, request to slaves to put high one of their pins to turn on and off a LED. One of the pins of the PIC was connected to another LED programmed to turn on in case of the frame error, the bit FERR in the RCSTA register is set to 1 if the stop bit is erroneously detected as zero.

I’ve programmed a simple Arduino as a master, another Arduino and a pic

16f88 as a slave. In the photo appear beside the master and slave, the PIC16F88 is placed at the other end of the network cable about 10 meters long. For the test I did not use terminating resistors nor bias resistors since with these distances it’ not required. A pair of wires is connected to pins A and B integrated the MAX485, the other was used for the reference (connected to ground, to avoid groundloops …) it according to a daisy chain connection scheme. Throughout the test I have maintained a steady stream of  TCP/IP traffic node continuously pinging the node at the other end of cable. Result is that in over an hour of practice there was never a frame error (FERR bit was never set) and all the frames have been received correctly (no checksum errors). The TCP / IP traffic has not suffered any errors or delays (0% packet loss and response times in the standard). Now we have to run the test with a much longer cable!

In spare time i started to work on an Arduino shield (with relative library) for simple eia-485 communication. Keep seeing my blog for news.

Eraclitux 02 May 14:03