Sunday, December 23, 2012

Finished with the shower controller!

Since my last post, I basically gave up for a few months. Then my friend Drex asked me if I wanted to work on electronics projects with him on Sundays. I said yes. It was the push I needed to start again!

I became newly excited because I would get to show him what I had done. Then one day, we talked about the issue of taking temperature data and how to make the device react to it in a way that didn't suck. Turns out he spent his senior year of college doing exactly that! In two weeks, he helped me get it to react in a way that worked. And it actually works!! It could be improved in some ways, but the gap between not working at all and working enough to actually use was bridged!

All that's left to do is improve power usage and to make it compensate faster. That will slowly happen as I use it more.

Thursday, September 13, 2012

Less Grrr

In my last post, I was extremely frustrated because my digital temperature sensor was being troublesome. Instead of obsessing and raging, I decided to try my thermistor ($4 from adafruit). It remains to be seen whether it's responsive enough, but at least it's waterproof and easy to use! I found code on the adafruit learning site, integrated it with my sink controller code, tested it, and now I'm ready to attach it to the sink!!

However, right now the thermistor just tells the device when to stop blasting the hot water and change to a preset warm. It's still too primitive to compensate for changes in temperature. This is my next step, and it's a pretty big one: write code that will sense the temperature and compensate in a way that isn't (a) super-slow or (b) oscillating between burning and freezing. These sensors have some lag time, so we need to make sure we're compensating for the temperature right now and not the temperature 5 seconds ago.

One cool thing I could possibly do is use my new math skills (I'm in an engineering math class because I'm in CCSF's electronics certificate program!) to determine the slope (!!!) of how fast it's increasing, which could possibly allow me to determine the temperature it's at before it can actually sense it.

Here's my test to see if the above idea is feasible: start at room temperature, then apply a known temperature and see how long it takes to reach it. Then graph the results in Excel. The known temperature is under my tongue, which is about 98 degrees! I'll let you know if it works.


Sunday, July 29, 2012

GRRR


It's been almost three weeks since I tested the digital temperature sensor and then extended it using twisted pair ethernet cable. In that length of time, I've lost a lot of ground knowledge-wise. And the damn thing isn't working! It's not working, and I can't tell what I'm doing wrong. I can't even tell if I'm supposed to set the data pin to INPUT or not. The tutorial doesn't do it, but I can't see how it would work if they don't do it. I would reference the code I was using, but my computer ran out of battery and shut off without warning, and apparently I never saved my work, which boggles my mind. I'm very frustrated! I really don't want to remove my heat-shrink tubing and solder that I fought so hard to make. These wires are really tedious! But I'm going to do it because otherwise there are too many stupid variables to tell whether my code is right or not.

GRRRR!!!

Tuesday, July 10, 2012

Extending the digital temperature sensor

This was the really difficult part with my last analog sensor, which was analog. Anything beyond being plugged directly into the Arduino would cause the sensor to give me all sorts of unreliable readings. This digital sensor is supposedly immune to this issue, which is why it costs $4 instead of $2 like the analog sensor. The only thing I'm not quite sure about is the pull-up resistor that needs to go between pins 2 and 3 (basically connect pins 2 and 3 via a 4.7K resistor). I'm guessing it needs to happen where the pins enter the Arduino and not up near the sensor itself. Hopefully I'm right.

In terms of the larger plan, this step will allow me to measure the temperature of the water coming out of my sink, and the servos will adjust it to compensate for changes. Once it's all working, I should be able to move the apparatus to my shower! Of course, then I'll have to deal with waterproofing, loosening up the knobs so the servos can turn them, and a few other things.

But first things first: I'm going to extend the new digital temp sensor about 18 inches.

Update: I did it! Although I haven't tested it yet. I took two twisted pair strands from a solid-core ethernet cable, twisted them together, and attached the sensor to the end. It's a little stiff, but it should conduct really well. I'll let you know when I start testing it. The step after that will be to attach it to my sink!!

Monday, July 2, 2012

Digital Temperature Sensor!

A quick update: I've just gotten my new digital temperature sensor working! It's supposed to be better at transmitting over distances. It looks exactly the same as the analog one.

Sunday, July 1, 2012

It verks!!

I'm super excited to report that I did everything I set out to do!! I implemented multiple settings and also a new power supply so the arduino can finally function without the computer attached!! I'm totally psyched because it's actually useful!!


I'm totally living in the future!!

Getting the sink controller to be useful

In my last post, I had created a setup with a single switch that only had full-blast warm or full off. This doesn't encompass the full range of use for my bathroom sink, so I'd like to flesh that out a little more. I also found what I thought was the perfect power supply, but for some reason everything behaved very erratically, possibly due to de-coupling. This means that I may need to put capacitors between my power supply and my servos and/or arduino. However, this isn't a critical issue at the moment, as I can always just use the power setup I had previously. What's important at the moment is getting the apparatus to be useful.

If I can make it easier to get the right temperature using the device than it is manually, I will consider the project successful. I think that by having several of the most common settings rigged to buttons, I'll be able to achieve this.

I bought a breadboard and a bunch of clicky buttons. Each button will be one setting. After talking with Kerry, my first iteration of this idea will have the following settings:

  • Full cold - filling water bottles, rinsing a glass
  • Medium cold - putting a small amount of water in a glass
  • Low cold - wetting a toothbrush
  • Medium warm (full-blast hot to make it heat up quickly, then reduce)
  • Off

I'll need 5 pins as inputs, and I'll need to make a "state" that changes when each pin is activated. I had the issue before where pins that weren't getting an input would return random values, but I've just read about enabling the Arduino's internal pull-up for digital pins! This means I don't need to waste time adding pull-up resistors to all my pins. Thank goodness. Here I go!