Need advice on what programable chip to use

Thread Starter

whtupdo

Joined Jan 16, 2008
8
Hello all. What a great forum, I’ve been searching for information on my project for a few weeks and haven’t found what I was looking for until I found this forum. You guys are doing a great job, congrats!

Now to my project which I need some advice on.

The purpose of my project is to design a programmable circuit to help control parameter in my saltwater fish tank. There are a few companies that make these devices but they start at $250, I think I can make something for much less.

Here are the things I need my circuit to control:
Read temp sensor (variable resistor)
Read two float switches (open/closed)

Turn on 12v fan if temp is high
Turn on heater if temp gets too low (via relay)
Turn off pump if float switch closes (via relay)

My question; what is the best (cheapest and easiest) reprogrammable chip to use to accomplish my needs. I don’t have much software experience, so I would like to program in BASIC. I’ve seen project boards that would work for this project but they are more $ than I want to spend. I would also like to design my own circuit so I know how it works, and of course to learn how to design something like this.

Thanks in advance,
Ryan
 

beenthere

Joined Apr 20, 2004
15,819
You really don't need anything programmable for these functions. A thermistor or LM35 temperature sensor can sense the water temp. The a pair of voltage comparitors can control the fan and heater. The float switch and a relay is all you need for the pump.
 

Thread Starter

whtupdo

Joined Jan 16, 2008
8
Thanks Beenthere, I bought all thecomponents and got the circuit set up.

I still have a little problem that I can't seem to figure out. I have built the circuit, which works. However it is to precise. The resistance on the themistor will become equal to the resistance on the pot, which is what I wnat. When there is a slight resistance change on the thermistor the fan or heater relays start clicking on and off. what I get in the end is two relays clicking all the time trying to equal each other out.

Any suggestions on how to fix this?

Thanks,
Ryan
 

hgmjr

Joined Jan 28, 2005
9,027
Can you post a schematic of your circuit? Having a schematic to look at can really help us help you.

hgmjr
 

lightingman

Joined Apr 19, 2007
374
Yes...If you are using comparators for sensing the voltage change, you will need to introduce hysterisis into the circuit... basicaly you connect a resistor from the output to the input of the comparator (try 470K to 1M) to start, this will create a dead spot in the output state change with respect to the input voltage..... This is about as simple as I can explain it without the schematic... Hope it helps...Daniel.
 

hgmjr

Joined Jan 28, 2005
9,027
That's a plan. With a schematic in hand, it should be a straightforward solution.

If you possibly can, please post as PDF or PNG format files. Some of us work at companies that block links to images on the web.

hgmjr
 

Gadget

Joined Jan 10, 2006
614
If you are still interested in a cheap programmable chip using basic, check out the PICAXE series. I use them all the time. Only a few bucks each, and just a few extra components and an RS232 lead to program using free software.
 

Thread Starter

whtupdo

Joined Jan 16, 2008
8
Hello again. Here is the schematic of my circuit. Thanks for the help.

Gadget, I'll look into the PICAXE. the comparator circuit will work for what I'm doing, but I'd still like to learn about programming chips.



Attachment below if the image gets blocked
 

Attachments

hgmjr

Joined Jan 28, 2005
9,027
What is the coil current needed to energize your relays.

There is a good possibility that the relays will not energize with the hookup you have. It looks like your comparator has an open collector output and that is why you have a 1K resistor pull-up on their outputs. That means that the comparator cannot source current.

What you will need to consider is to eliminate the 1K resistor pullup and then connect the coil between the V+ and the output of the comparator. If the logic is not what you needed as far as which level energizes the relay and which level de-energizes the relay then all you need to do is swap the plus and minus input connection of the comparator to reverse the logic.

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
Hello again. Here is the schematic of my circuit. Thanks for the help.

Gadget, I'll look into the PICAXE. the comparator circuit will work for what I'm doing, but I'd still like to learn about programming chips.
If you do decide to explore microcontrollers you will do well to compare the features of the microchip PIC family and the atmel AVR family before you make a final decision on which one you select.

They both have their strengths and their weaknesses so by comparing them you can determine which one has the features that most clearly fit your applications.

Don't forget to price the software and hardware development tools before you decide between the two.

hgmjr
 

Thread Starter

whtupdo

Joined Jan 16, 2008
8
What is the coil current needed to energize your relays.

There is a good possibility that the relays will not energize with the hookup you have. It looks like your comparator has an open collector output and that is why you have a 1K resistor pull-up on their outputs. That means that the comparator cannot source current.

What you will need to consider is to eliminate the 1K resistor pullup and then connect the coil between the V+ and the output of the comparator. If the logic is not what you needed as far as which level energizes the relay and which level de-energizes the relay then all you need to do is swap the plus and minus input connection of the comparator to reverse the logic.

hgmjr
The coil current for the relay is 360mW. I have the circuit built the way it is showed on the schematic. The relays do energize but it sounds like it is a bit weak. I'll try your suggestion of removing the pull up resistors tonight. Thanks.

Any thoughts on making this less precise? I was thinking if I could somehow use a third input to make a dead spot. I would like to keep the resistance on the thermistor between 9.5k and 10.5k.

All suggestions are welcome and very much appreciated!

Thanks, Ryan
 

hgmjr

Joined Jan 28, 2005
9,027
The coil current for the relay is 360mW. I have the circuit built the way it is showed on the schematic. The relays do energize but it sounds like it is a bit weak. I'll try your suggestion of removing the pull up resistors tonight. Thanks.
...
Keep in mind that my suggestion was not only to remove the pullup resistors but to actually substitute the relay coil in place of the pullup resistor. In effect, the relay coil becomes the pullup resistor. Make sure you add a flyback protection diode in parallel with the relay coil so that the flyback voltage will not damage your comparator. The direction of the diode would cathode toward the positive power supply rail and the anode toward the output of the comparator.

This will only work if the energizing current for the relay is less current that the comparator can sink. If the comparator is not able to energize the relay in this configuration then you will most likely need to add a power transistor between the comparator output and the relay to provide the drive current needed.

hgmjr
 
Top