Sunday, January 12, 2014

Major burst of progress

I've been slacking on documenting my pool automation project, but I'm about half way done now. This post will highlight the hardware aspect.

Features:
  • control Pentair Intelliflow VS pool pump and set run speeds as well as query status
  • monitor pH and chlorine (with ORP) levels in pool
  • control Pentair Intellibright LED pool light 
  • be able to turn waterfall on and off
  • be able to switch between pool cleaner and skimmer/pool drain 
  • capability to upgrade in the future to a solar pool heater. 
Here are the components used to get the features above:

RF board:
8 channel Relay board (GPIO interface)
ORP sensor kit (TTL serial interface)
pH sensor kit (TTL serial interface)

Around October I whipped up a PCB and sent it off to OSH park to fab in parallel with ordering all the parts from Digikey. The PCB design took longer than I wanted as my interest on the project waned somewhat because my final plan wasn't too solid (specifically the software part). Before submitting the design, I double and triple checked the footprints and connections in the schematic.

After getting everything in I dove into making a board. Despite the PCB being somewhat simple, I still made several mistakes. The first was with the RS485 package. I thought there was only 1 8-SOIC footprint (I took one from the Sparkfun Eagle library to make the part). Turns out there are many "widths" and I had ordered the 5.3mm part, not the 3.9mm. Oops. I some how managed to squeeze it onto the PCB with a lot of careful pin bending. IC parts are not meant for their pins to bend. I ruined a part when one of the pins broke off.

Everything else on the PCB assembly went pretty much ok. The next issue popped up when I could not communicate with the pool pump. I was fairly confident I had the right protocol information from the Internet.  After struggling all weekend I finally realized the part needed 5V, not 3.3V. Double Oops. I was able to sever the 3.3V trance on the PCB and send a floating wire from the 5V pin of the regulator over to the part. Success! I could communicate with the pump and tell it to turn on and off.

The next fun came when I tried to read a thermistor via the DAC chip. It just would not read, so I broke out the DSO Nano oscilloscope and saw signals toggling wrong. Despite I2C SPI specifying signals like "master in, slave out (MISO)", I still wired the chip up backwards to the Synapse module. Again, more PCB surgery with cut traces and floating wires and I got it to work.

This was a lot of mistakes with a single PCB. I've made several in the past that were a lot less error free. I think what got me in trouble was the PCB design being drawn out over several months. Lingering that long didn't allow me to focus on the details like I should have.

I decided to edit my PCB and make a new spin of the board with all the fixes. While I waited on the new PCB, I ran across some Maxxim RS485 parts I had sampled way back and forgot about. Great!, I said. No need to order 3 tiny parts from Digikey. I can just use the Maxim part. Well I got the new PCB rev in and went to town soldering all the parts on. However, the pump communication was dead again. After spending way too much time debugging the issue I re-read the Maxim datasheet and realized the part has a "low power mode" when the TXEN pin was off. There is a required wake time before the part can take data in, and I think the Synapse module is violating the timing. I don't have a logic analyzer to show it for sure, but I'm pretty sure that is the problem.  Going back to Digikey to see what I could find, I tripped across the original TI part, but in a 3.9mm width package. Woot! Since the old rev PCB was more functional at this point, I swapped it back into the system for more testing.

So with the Christmas break fast approaching and no project plans yet, I decided to order the ORP and PH kits to work on that over the break.  I was able to plug them up and get them working without a fuss. This was a nice change after all the painful milestones before. I even found all the plumbing parts to create a "sensor manifold" with out going to a commercial plumbing supply store. Just some 1/4" plastic tubing, a few adapters for icemakers/water purifiers, some 1/2" threaded PCV tubing and some probe adapters. Right after I bought the kits from Atlas Scientific, they started carrying the adapters themselves. I always hate paying for multiple shipping charges. Oh well.

At this stage I placed everything in the box outside and left it for several days. All of a sudden, the pump communication started to fail. Great. What's wrong now?  Turns out now my hacked wire supplying 5V to the RS485 chip had a cold solder. As I attempted to fix it, the 5V pin broke off the RS485 chip. Awesome. No more pump communication for me. Time to finally order the right TI part. Luckily I found the 24VAC transformer I need to power the valve acutators, so the shipping charges are less annoying now.

That's pretty much where the project stands today. I'm waiting for the Digikey order so I can restore communication to the pump again. I really, really hope getting that right part in will solve the intermittent communication issues with the pump I had.

My next post, which should be soon, will dive into how I solved the software side of things. Sometimes starting and failing to solve a problem just opens the door for new solutions later.

2 comments:

  1. You wrote "Despite I2C specifying signals like "master in, slave out (MISO)...". This sounds more like SPI than I2C.

    ReplyDelete
  2. Perhaps I'm doomed to forever mix up simple serial interfaces in my hobby. It is SPI and not I2C.

    ReplyDelete