Help from some of you electronics gurus (Hot Tub hardware hacking)

Okay, so I guess I have no excuse on the Arduino. :slight_smile:

If that looks right to you Toodles, I’ll go ahead and get it ordered. I don’t think I’d need USB or USB cable for it - I’ll do some more reading. I might need it for programming the thing. :stuck_out_tongue:

I’ll probably get the USB board, the more I’m looking at it. :\ Just for the sake of simplicity and learning. The SPI interface is what I need, right?

http://www.arduino.cc/en/Tutorial/SPIEEPROM

Yup, the clocked serial is usually called SPI. As for which arduino to get, in your situation I’d get a Decimelia from here:


Its cheaper from her, and she includes some rubber feet to stick on the bottom.

Since I expect you’re going to want whatever connection going to your computer, you’ll want an Arduino that has the USB chip on board. The Decimelia has that, is the official mass produced product and already tested. For a first time foray into this stuff, itll be nice knowing the board works out of the box, and is easy to test.

How I see the connections going: Assuming that 8 pin molex is the only connection from the topside controller to whatever other electronics is in the tub, have the wires from the molex connector all split and going to a cable jack of some sort you make on the box itself (RJ45, Dsub9, whatever) and that cable going indoors. Put the arduino’s power select jumper so its NOT on USB, so the board is powered from the power and ground connections in the cable. Once you figure out which wires are for the clocked serial, you’ll connect those the appropriate clock and serial in points. Have the rest going to other digital inputs so you can eventually figure out how/if they control the buttons.

Before running the wire indoors, do you testing close to the hot tub with a short cable; if the frequency is too fast, and the cable too long, it could cause read problems not present in a shorter cable.

All of that is assuming you want full I/O from the PC. If you just want to read the seven segment displays, just grab another one of those motorola chips and three seven segment displays and duplicate the wiring.

If deciding to go over a parallel port, the only reason you’d need to know how fast the serial clock speed is just to find out if its too fast; I’ve seen programs using the LPT that record accurately at 100KHz, but they all seem to choke too much faster than that. The clock line on your topside controller is controlled by the other electronics inside; theres nothing on the topside controller that will tell you the speed, and even if you found crystals on the other controllers, they are likely divided to a slower rate. The arduino WILL handle any frequency present there, and shouldn’t have any problems until the >1Mhz range. If the clock frequency is low enough, you can just read the parallel port as fast as you can, save the values for a while, take the bits for the clock and data lines and use it to sort out the data sent.

Yeah, I was going to get the Decimelia. So - just wanting to make sure I understand you - if I wire it up that way, the original topside would still function, right?

Also, on the button presses, I’m thinking that if a button is wired to pin 10, all I should have to do is set pin10 = LOW to emulate the button press…basically the board would internally ground pin 10. I just need to double check to make sure the buttons are wired directly and not through another IC.

I actually hope there is a second IC, because remote temperature control is going to be a pain otherwise. Press the temp button once and release to see the current “programmed” temperature, and eventually it will switch back to the current temp or error code. You then have to press and hold to cycle the temperature down, or release, then press again and hold to cycle the temperature up. I would much rather find that I can send a binary code for a temperature and set it that way. MUCH simpler.

Keep in mind this is describing surgery via text from a bajillion miles away, so there could easily be something I miss; I make no guarantees :slight_smile: But yes, ou can draw a bit of power off of the power line, and read the status of the serial connections, all without interfering with the operation of the actual topside controller.

If its wired common ground, that’s exactly right. After you get the connections to the arduino going, you can easily write a small sketch to report the status of the line while you walk outside, hit the button a couple of times, and walk back in to see what it says. It may be low when not pressed and high when pressed, but once its connected to an Arduino input, it should be a cinch to identify.

[/quote]
Assuming you figure out how the buttons work, having an arduino function do the repeated actions at specific intervals is easy.

Having the arduino do something at a specific interval is one thing. Telling it to set the temperature to 80 at midnight, and bring it up to 105 at 3:30p is another entirely. I’d have to be constantly sampling and reading the display output whilst pulling the pin low until the numbers match, then set the pin high (or vice-versa, as you pointed out). I just don’t like that logic. :slight_smile: Much easier to just tell the controller to set the temp at 80 or 105. Oh well - this is quite the hack.

I appreciate the help - the arduino doesn’t seem like such a monstrosity to me anymore. A little explanation goes a long way - I appreciate it.

I just noticed - I’d rep you, but I can’t for some reason…

You’re not Prem.

Once you get things going and have handled ways to read/write what you need, you just have the sketch waiting for input from the USB serial connection. That’ll show up as a regular serial port on your system. Done right, you could have a simple cron entry for ‘echo set 080 >> /dev/sttywhatever’ at 00:00 and ‘echo set 105 >> /dev/sttywhatever’ at 03:30; or the equivalent for whatever OS its attached to.

Oh I know that. :slight_smile: It’s the logic that the arduino will need to have.

Did I mention I code in perl? C is going to be a trip. The simple stuff I’ve seen in the examples is no big deal, I can handle that. But doing something like set pin 10 = low; while (line 11 somehow adds up to > 85){ sleep; } set pin 10 high; - that just seems messy is all. :slight_smile:

You’re absolutely right though - once I have logic that works, I’ll give myself a sane API to make the changes remotely.

I’m tempted to toss this into the mix:

http://www.national.com/mpf/LM/LM34.html

Since I’m going to have a board anyway - the thing returns resistance in ohms - that if you shift the decimal point, is actually the temp in fahrenheit. :slight_smile: I was thinking of taking a slightly similar tact as this guy:

http://www.vonslatt.com/opamp.shtml

Take an old radio antenna, seal it closed with solder, filled with thermal paste. Put the LM34 inside it, and wire it to a couple of the analog pins on the arduino. That would then give me two seperate temperature readings, the one the master controller has, and my homebrew jobby. If there’s massive variance in the two, something is likely up. Redundancy is always a good thing, and I get the feeling the LM34 is precisely the sort of thing the arduino excels at handling.

Just in case you’re not familiar with how these things work, this is justing a celcius thermistor:

http://www.green-trust.org/2003/temperature/default.htm

Now THAT is a dirt cheap temperature sensor. :slight_smile:

y’know - the more I’m looking at this stuff, next time I do a hot tub, I may do an “open source” hot tub controller. I’m sure there’s more logic to it than I realize, but holy cow it gets easy to sense the temperature, run the heater and blower, etc. Top side controller doesn’t have to be complicated, and remote API would be a simple thing to do. Almost wish I had known about this before dropping $900 on a kit. :\

Oh well, live and learn - just means when I move to my next house, I can afford a nicer shell. :wink: Word of warning to those treading my footsteps - TUB COVERS ARE EXPENSIVE!!! You’ve been warned. If you’re getting a used tub free or near free, make sure the cover is in good shape. If it isn’t, you’ll drop as much as $500 on a decent cover. You can get a cheap one for $100 or so, but it’ll absorb moisture like a sponge, and soon become so heavy that you won’t ever want to move it. If I were better with vinyl, I could have made one from blueboard. I still might go that route later.

Hey, here we go…

So I just need to hunt down some stainless brake line, and order an LM34. I’ve already bought the arduino from your source, so it should be here early next week. I can make the temperature probe, and if that works nicely, I can get another thermowell to hold it. YAY!

I’m figuring that if I can get the temperature sensor working, you drill a hole in the shell (CAREFULLY - using a forstner bit), then shove the probe into one of these:

http://www.spaguts.com/Product.aspx?ID=16

That way you get direct water contact, but the probe is out of the way. If I had a better way to get direct water contact without drilling into the shell, I might jump at that, but the only other thought would be to try installing into the skimmer bucket.

Okay - so the LM34’s (I ordered 2 of them) and the arduino should show up either tomorrow or monday. I’m pumped. :slight_smile:

As for the topside, I have to somehow remove the sticker on the thing and it’s on there GOOD. Have no idea of how to get it off without damaging the topside itself. :frowning: I can’t tell where the microswitches are hooked in without removing the very top. Ugh. It’s never simple, is it?

Oh well - I called the manufacturer, I’m hoping to get a second one to have in case I screw this one up. :wink:

The LM34’s arrived today. VERY cool. Hook the red wire to the 5V line, hook the black wire to the Vout pin, and set the multimeter to 200Ohm. Tada! Instant digital thermometer. SWEET! :wink:

Now if that arduino would just hurry up and get here. I’m getting impatient! :smiley: I even went looking for pH electrodes to monitor the water chemistry, and I’ve never even wired up an arduino before. :stuck_out_tongue:

My arduino showed up on Saturday. This thing is DEAD SIMPLE. I love it. :slight_smile: I’m already reading room temperature off the LM34, and logging the data. Just need to wire to the topside, and get a thermowell for the LM34. YAY!

maybe youll actually get to enjoy the tub one day lol

Glad its working for you. Have you tried reading the serial data from the topside yet, or are you just playing playing with the thermometer?

ATM, just playing with the LM34, and getting used to interfacing with it. I have to find a way to get the stupid sticker off the top of my topside - I guess I could just solder to the botton where the IC is, but the nice solder points are at the top, not to mention the switch connections. Grrr - that’s some seriously impressive glue.