New to Ardunio

Hey everybody,

I'm brand new to Arduino, and I only found it by accident. But it looks really exciting.

I was wondering if Arduino could control a solenoid, via buttons. Each button opening certain valves for a set amount of milliseconds?

Cheers for your time,

Mikey C

Yes it can and it's something the Arduino is very good at. Just make sure you connect the solenoid properly (probably with some kind of transistor and a protection diode) so that you don't draw too much current from your Arduino output.

Korman

Cheers for replying.

Would it matter which Arduino board I used for such a task? What are the limitations of Arduino?

Is there a good detailed website on how the coding works?

Sorry for all questions, I'm just wanting to get my teeth stuck into Arduino.

Mikey C

If you just need to do this one task, any Arduino will do, although the Arduino Mega will be an overkill.

The limitations of the Arduino is, that has only 2kb of RAM, only 1 serial, 13 digital and 4 analog input/output pins. It's not your PC, it's a micro-controller. As far as micro-controllers go, the Arduino is a very well balanced package perfect for small to medium tasks interfacing real world things with a a few buttons or a simple lcd display. If you run into the limits, another platform is probably better. Again, for your task it's a very good platform with enough reserves for future upgrades.

With the regular Arduino based on the ATmega168 or ATmega328, you have two basic flavours, one running on 5V and one on 3.3V. As you can imagine, your driver for the solenoid will probably differ a little. Apart this, it's all up to you, whatever you like best. If you prefer a standard compatible solution where you can put shields on, go with the Arduino Uno, Duemilanove or compatible. If you're into soldering and prefer a smaller footprint, go with the Nano, Pro or Lilypads.

If the Arduino doesn't have an USB-connector on-board, (eg Pro, Lilypad), you will need a TTL to USB converter sold by exactly the same shops which sell you the Arduino. Wit the added cost of the cable, the smaller Arduino will end up costing the same as the one with on-board USB.

If you want to support the original designers of the Arduino, get the Arduino Uno.

For the coding, start here: http://arduino.cc/en/Tutorial/HomePage
For questions, you're in those forums in a good place.

And before I forget it, if your new to electronics, get a small breadboard, a few resistors, cables, buttons and leds and a sorter box to store it all to get started. Many suppliers have starter packs available with a useful selection.

Korman

Thanks for the advice and help.

I've read the link, and read many more pages about Arduino now.
But I'd like to clarify my project idea.

I'm hoping to control 4 solenoid valves (normally closed), using 4 momentary and 1 switch. The buttons control 2 valves each, for different amount of times. The switch would control all 4 valves at once. Is the Arduino Duemilanove a good option?

If the above is possible, is there any scope to add anything else or would that be too much for the RAM/microcontrol.

Thank you for you patience,

Mikey C

Is the Arduino Duemilanove a good option

yes

is there any scope to add anything else

Yes what else do you want, what you asked for is only taking a tiny fraction of the processing power.

I was thinking of upgrading from 4 solenoids to 10-16. But as I'm still learning I don't know if there's enough space to fit them on.

Is the coding a problem with my 4 valve prototype idea? Eg. Button 1 turns valve 3 on for 1 second, and valve 4 for 6 seconds? Button 2 turns valve1 on for 4 seconds and valve 2 for 7 seconds?

Cheers

I was thinking of upgrading from 4 solenoids to 10-16. But as I'm still learning I don't know if there's enough space to fit them on.

If you mean does the Arduino (well the Duemilanove anyway) have enough pins for 16 valves and 5 switches the short answer is no. BUT, it's a very simple thing to expand the number of IO "pins" you can use. You could easily experiment with your 4 valves then add the others. The hardware will be slightly different though so don't go making a PCB :slight_smile:

Is the coding a problem with my 4 valve prototype idea? Eg. Button 1 turns valve 3 on for 1 second, and valve 4 for 6 seconds? Button 2 turns valve1 on for 4 seconds and valve 2 for 7 seconds?

That's very simple.


Rob