1

I want to simply switch a relay like Majenko describes it for my last question. (time based switching of a relay)

That's the code I came up with based on the documentation:

int relayPin = 2; // pin where relay is attached
long mins = 5L;

void setup() {
    pinMode(relayPin, OUTPUT);
}

void loop() {
    digitalWrite(relayPin, HIGH);
    delay(mins * 60L * 1000L);
    digitalWrite(relayPin, LOW);
    delay(mins * 60L * 1000L);
}

Now I want to use a real device and have been looking around, but there are tons of different boards, so some shopping advice would be really great. What I would like if possible:

  • Closed casing to reduce risk of people touching stuff. (also for a "professional" look)
  • Built in power supply from 220V AC.
  • Outputs strong enough to work without external logic, just connect the relay and go.
  • Small size and low cost, in case I start using these everywhere in the house i don't need to reevaluate. :)
8
  • 1
    No ordinary Arduino will by itself meet all of the case, AC power input and output strength requirements, but there are various combinations of things that may, including relay boards with built in drivers. The self-contained products that actually do all that off the shelf are typically industrial devices called PLC's, rather than hobby devices like Arduinos (but they are not cheap). Unfortunately as it stands your question is not clear enough about a specific goal, too broad in possible approaches, and too ultimately dependent on personal opinion to be a fit here. Oct 17 '16 at 19:42
  • Thanks for the comment, basically it contains the answer to "can i have it all?" .. Which parts could I remove to make it better suited for the site? i'd prefer going with an arduino, so will take whatever fits best. I'm more the software guy, so the less wiring the better! :) Oct 17 '16 at 19:52
  • 1
    The part of the project represented by the Arduino itself is the trivial one; as you'll see from other questions here on that it is also subject to endless bike-shedding of opinions (including "don't use an Arduino at all"), and reducing it to that would only see closure as a duplicate of an existing question of that sort. The more challenging part of the question has to do with packaging it, running it off mains power, switching loads, etc - but that is also where it starts to veer beyond the mission and expertise of this site. Oct 17 '16 at 19:54
  • 2
    The problem with finding what you want is that most Arduino development systems are made by small(ish) companies and designers. As soon as you add a mains power supply into a product it suddenly comes under lots more rules and regulations and testing requirements, all which massively increase costs beyond what a small company making only a small number of devices can reasonably afford and still keep the retail price at a sellable level. It's only when you start creating thousands and thousands of a product that the testing and certification costs become a negligible percentage.
    – Majenko
    Oct 17 '16 at 20:31
  • 1
    That is why most devices use an external third party power supply instead of integrating it.
    – Majenko
    Oct 17 '16 at 20:31
0

For beginners, use an Arduino Uno. It is ready to use and quite expendable with shields. They have the USB to SERIAL chip on the board. Only week point is that it is sometimes large from space sensitive projects.

enter image description here

For more advanced users, I would suggest the Pro Mini (my personnal favorite). It is small, powerful and even has more pins then the UNO. The main disadvantage is that it requires an FTDI connector for the USB to SERIAL. Note that this NOT recommended if you use a lot of I2C.

enter image description here

Finaly, there is the overkill option. Only use this if you are considering to get one Arduino to rule them all!. It's the Arduino Mega 2560. It is the overkill of the overkill. So many GPIOs and ANALOG inputs. It is also unique for its core which is different the then normal ATmega328.

enter image description here

Then finaly there is the most easy to use one, the Red Board by Sparkfun. It combines the best of each Arduino in one. Note that this one is not manifactured and backed by Arduino.

enter image description here

That is pretty much a summary of all of the most popular types of Arduino that there is.

[EDIT]

Note that none of them has an included case and a circuit that can reduce 220V to 5V. If you really want a case, get an UNO. There are many cases for it. For transforming 220V to 5V, use an 5V wallplug. If you have something like a 12V wallplug, you can also connect it to the Arduino but you have to make sure you connect it to the Vin port.

6
  • With 5V wallplug you mean a USB thingy? that works? Oct 17 '16 at 20:00
  • any wallplug that output 5V should work, even the phone chargers could work. just pick the right USB type for it. hope it helped anwser your question
    – Dat Ha
    Oct 17 '16 at 20:01
  • almost! you don't happen to have an easy solution for attaching the relay directly? :) Oct 17 '16 at 20:07
  • connect the relay to one of the digital output of the arduino. thats the only and fastest way
    – Dat Ha
    Oct 17 '16 at 20:08
  • a relay shield could also work, you simply stack in directly on the uno. no wires needed
    – Dat Ha
    Oct 17 '16 at 20:09
1

Personally I would recommend a chip from the ATtiny series (ATtiny85 for example - it has 5 programmable pins and costs about $1 - $3).

Even though it is not really an Arduino board - it is really great as you can easily program it from another board from within the Arduino IDE, and it is really lightweight and cheap.

Watch this Youtube video for a guide to set it up - it is really useful.

Otherwise you can simply give "attiny85 arduino setup" a google

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.