February 9, 2013

Getting Arduino Online with an ENC28J60

After learning that an ethernet shield could be purchased for Arduino for under $10, I knew it was time to take my Arduino online. If this is your first time hearing that a $10 or less shield is available I encourage you to search you favorite search engine for the ENC28J60. On Ebay I picked one up for $5 from Hong Kong. But lets get into the meat and potatoes of how to connect one of these boards to and Arduino and start using it.

Instructions

  1. Download the Ethercard library from
    https://github.com/jcw/ethercard/blob/master/README.md. The current version available supports the Arduino v1+ IDE and is compatible with DHCP. The link provided points to the download page with instructions on installing the library into your Arduino IDE.
  2. Physically wire the ENC28J60 board to the Arduino using the pinouts below:
    • ENC -> Arduino
      • VCC -> 3.3V
      • GND -> GND
      • SCK -> Pin 13
      • SO -> Pin 12
      • SI – Pin 11
      • CS -> Pin 8
    • I cut down an old Parallel ATA (PATA) cable (which is a Insulation Displacement Contact (IDC) connector) to plug into my ENC28J60’s SPI header
    • Pinout Diagrams
      • 10th wire -> CLK   | INT  <- 9th wire
      • 8th wire ->   WOL | SO    <- 7th wire
      • 6th wire ->    SI       | SCK  <- 5th wire
      • 4th wire ->    CS      | RST  <- 3rd wire
      • 2nd wire ->   VCC   | GN    <- 1st wire (starting from bottom of PATA cable)

      Arduino ENC28J60 SPI Pinout

      Parallel ATA Cable (PATA) & Related SPI Connection on ENC
      (Check to confirm your ENC’s SPI matches)
      PATA Wire SPI Left SPI Right PATA Wire
      10th CLK INT 9th
      8th WOL SO 7th
      6th SI SCK 5th
      4th CS RST 3rd
      2nd VCC GND 1st
      The PATA cable count starts in the lower
      right-hand corner of the SPI connector.

      Arduino with ENC28J60

      ENC -> PATA -> Arduino Pinout
      ENC PATA Arduino
      VCC wire 2 3.3v
      GND wire 1 GND
      SCK wire 5 Pin 13
      SO wire 7 Pin 12
      SI wire 6 Pin 11
      CS wire 4 Pin 8

       

  3. Download BackSoon.ino from
    https://github.com/jcw/ethercard/tree/master/examples/backSoon
  4. Open backSoon.ino in the Arduino IDE . Confirm the myip, gwip, and mymac variables are correct in the sketch. These are the static network settings that will be used if DHCP fails.
    • myip = This is the Arduino’s unique ip address. If there is another device on the network with the same IP, you will have problems.
    • gwip = This is your gateway’s ip address.
    • mymac = This is the unique MAC address for the Arduino. If there is another device on the network with the same MAC, you will have problems.
  5. Plug your Arduino board into you computer via USB (to power and program).
  6. Upload the backSoon sketch to Arduino.
  7. [OPTIONAL] Open up your network’s router to the screen where you can see clients connected to the router.
  8. Open up Arduino’s Serial Monitor. This will allow you to see what Arduino is doing.
  9. Plug an ethernet cable into the ENC28J60 and look for the ENC/Arduino to show up on your router.
  10. Reset Arduino with the physical button.
  11. Patiently wait for the Serial Monitor to display the Arduino’s IP address. Within about 10 seconds you should see something like the following:
    IP: 192.168.1.107
    GW: 192.168.1.1
    DNS: 24.49.173.40
  12. Open your web browser of choice, surf to that IP, and rejoice when you see the following:
    Arduino OnlineIn your router’s DHCP administration panel you should see an entry for the Arduino. Router Arduino DHCP Entry

Connection Loss After Extended Periods?

If you are having issues with the ENC28J60 losing connection, try adding a heat-sink. See the notes below from Brad on October 10,2013 regarding his experience.

Sources

~Nathan

November 6, 2011

Arduino Engine Fan Controller

Yesterday I put a good part of my day into taking the next steps of having my Arduino power the cooling fan for my truck. This will likely be the same Arduino that will be the remote start too assuming it can handle multiple operations.  In the video below I demo the functional logic of the circuit with features an automatic temperature based control and a manual push button for those occasional 100* F Summer days. The next step is to wire this circuitry into the existing fan relays and remove the previous circuitry I built. I have nicknamed this project and the Remote GSM Car Starter the S10Duino.

~Nathan

August 14, 2011

Remote Car Starter

Remoter Starter Diagrams

Remoter Starter Diagrams

Today Matt and I worked on our remote car starter project. We are building a remote car starter using Arduino, an electronic prototyping platform. This is a completely original project, we are not starting with any set of plans or instructions. It is all custom built. The remote starter is going to address the challenge of most reasonably priced remote car starters…that being how to I start the car when I upwards of a 1/4 mile plus away? Or more importantly while I am comfortably sitting at my desk at work or in the lab. We are building our remote starter using a cell phone as the communication device between us and the vehicle. Our short term goal is to be able to start/stop the car by telephone. Long term the platform will be able to handle more complex operations such as texting, responding to queries for information, and preprogrammed operations like running for a set duration.

Today we focused on documenting the necessary logic to safely start the vehicle and gathering information on how we are going to interface with the car. Seeing as these are cars made by GM they do not exactly have an api we can interface with. No the “interface” we will be using is good old analogy signals via copper wire controlled by a digital logic via the Arduino. So once we documented the control logic we worked on identifying our copper interace elements. Thankfully most car’s electrical diagrams can be found online.

Our next steps are to start building our car “API”…in layman’s terms we are going to start soldering wires in that we can wire up to relays that will connect to a DB-9 connecter to interface with Arduino.

~Nathan

March 20, 2011

Arduino Temperature Logger

This is my first temperature and date/time data logger built with Arduino. I am using 4  DS18B20 temperature sensors along with a I2C EEPROM.

~Nathan