My current project is to control the humidity in a glazing system. The task is to monitor 8 sensors and switch on 1 of 8 pumps when the right humidity condition has been met. So far I've got 8 inputs (from the sensors) and 8 outputs (to the pumps); I'll probably add a simple LCD display (one of those 16 x 2 ones) and link it all in to my home network.
At the moment I'm doing all my learning and this project on an Uno; which has got the 20 pins.
My questions are:
Will the Uno have enough input/output pins to do all of what I plan to include or should I use an Arduino with more pins (Mega?).
If I need to use a Mega then would the sketch I'm working on for the Uno be transferable to the Mega without too much ado?
Code will transfer easily to 1284/2560 based boards.
Are the sensors digital? Or do they have an analog level you want to monitor?
Uno only has 6 analog inputs broken out in the 328P DIP - if you use an SMD version in 32 pin TQFP, all 8 analog inputs are available.
Pumps will need some kind of buffering - simplest is controlling an NPN or a Logic Level N-channel MOSFET to connect - of pump motor to Gnd to turn it on.
I make PCBs. Others use Uno for development, then use a Promini in the design in place of the Uno.
Just making 1 of these? Maybe just wire one up on perfboard.
Here is Arduino functionality at lower left, with some custom circuitry around it,
and an adapter board to make a circuit easy to duplicate & use, in this case a MAX7219 for LEDs.
JonRon:
a display, presumably this is a parallel connection?
Probably, but post a link to the kit or a picture of the display.
JonRon:
I'm using DHT22 digital sensors and I'll do as you say with transistors to switch the pumps.
I'm surprised Bob (CrossRoads) didn't suggest this (he usually does) but a TPIC6x595 (where x is A, B, C or D, depending) might drive your 8 pumps with only 3 pins. But you will need to build a shield or a separate stripboard or something. Are you up for that or looking to avoid soldering?
That all looks excellent and I'll definitely go down the road of either solder up a pcb (or veroboard) or use a Pro Mini or similar.
Back in the early '70s I did do some electronics at college. That was a long time ago, components were a lot bigger and making pcbs with copper clad board, indelible felt pen, mini drill and ferric chloride was easy enough. So I'm certainly up for a bit of soldering.
So this TPIC6x595 sounds a good idea....where do I start with finding out more about how to use it?
Many many thanks
Ron
PS Here is a link to a page on Instructables. The LCD I'm using is the same as this one.
PaulRB:
There's also a challenge in working out ways to use what you already have.
Whats a "finder relay"?
Those tpics can almost certainly drive the relays directly. Its what they're designed to do.
just make sure the total load of all relays does not exceed the total package load for the TPIC
12v coils are probably less than 100mA so would be well within the capability.
On the other hand, it is a lot simpler if you don't have to add extra chips, and you just have more pins. The Mega has lots more pins, and is perhaps the simplest solution. It has 53 pins for digital input/outputs and 16 analog input pins (which might be used for digital input/output, depending on the chip).
You could do it with the Teensy 3.1 (my microprocessor of choice), but having to switch from 5v to 3.3v might be a problem.
Hi and thanks for all the replies.... a lot to take in....penetrating slowly.
The shift register route seems like quite a good one if I could get it to work. The relays I plan on using are made by Finder and have a 12v coil and draw about 45mA so if a TPIC6B595 can switch this then it'll save me making up transistor buffer. Any rate, I've ordered a 74HC595N from CPC in the UK http://goo.gl/pejJ91 so that I can experiment....probably something I should know about.
However the idea of all those pins on a Mega is very appealing, but are there good and reliable copies made which I can get in the UK? Or should I think about buying from abroad?
I ordered the 74HC595N mainly to experiment but I'll get a TPIC6B595 for the proper project.
Presumably I'd have to use a ULN2803 type driver for those relays if I used a Mega?
Haven't really found a good source in the UK yet for Arduino boards or copies....no doubt there is somewhere. If not then I can always buy from the USA (where the prices seem to a lot cheaper!)
Yes, ULN2803 if using Arduino outputs directly, or as buffer for 74HC595. TPIC6B595 can handle 12V directly.
Don't forget diode across the relay coil - cathode to +12C, anode to chip output.
US prices cheaper, but shipping is more?
Where in UK are you?
Ron, why do you need so many more pins? Future expansion? Your current requirements require only 15 and Uno has 20. If cost is a factor, a Pro Mini, Pro Micro or Nano 3 would also suit. Smaller too. And all those have the same chip and about 100 times more speed and memory than you will need for what you have described so far.
Cheapest place to buy from in UK is from China on eBay, same as everywhere else. Cheapest UK sources are, again, eBay. Megas from aroubd £12 versus £30+ in most other places.
I was thinking 8 input but only 7 output, 6 for the lcd and 3 for a tpic6x595, but 2 pins shared between the shift register and the lcd. Hadn't considered networking.
But actually, now Ron will have a 74hc595, he could use that to drive the lcd, daisy chain the tpic6x595 to it and need only 3 outputs, so use spi. Seem to remember ethernet adaptors also use spi.