Which Arduino to buy for this project?

Good Afternoon and Happy New Year to all :slight_smile:

I’m making my first forray into Arduino device development and need some assistance. A bit of background may help. Im a confident Windows C# developer and Web developer (PHP/MySQL etc). I did some basic electronic engineering at university, developing a LED dice.

I am currently developing an application that will replace one used by my father. It connects to a hardware kit based on the LPT parallel port of a PC, however a new PC is required and there is a wish to move towards USB and a more modern system. I was pointed in the direction of Auduino as the best way to do this (however I am open to suggestion).

The hardware has 2 sides to it:

  • An output side that can control 8x relays that will control the power (12V DC) of certain items each individually depending on the signal sent from the application. The old system used a ULN 2803A transistor to control these relays. I am happy to continue with this component or again something different if suggested.
  • The input side which should be monitoring 4x photo resistors and send a signal to the application when the photo resistor is “dark”

The currect hardward is wired as per these diagrams:

Output Power Control


Input Light Sensors

The application itself will be developed in C#.

So the question is, well any advice? Am I going about this the correct way? Should I be looking elsewhere? And if Arduino is the way to go which one should I be purchasing.

I would appreiciate trying to keep the costs as low as possible. :slight_smile:

Thanks to anyone who can assist!

Your project looks to be very doable using an arduino Uno even.

For the relay outputs side you really can't build much cheaper then those Asian E-bay sellers have to offer. An example. http://www.ebay.com/itm/New-5V-8-Channel-Relay-Module-Board-Electronic-for-Arduino-AVR-PIC-MCU-DSP-ARM-/390568253990?pt=LH_DefaultDomain_0&hash=item5aefae9a26

The input side shows 4 photo transistors only, and there would be a need for more components to interface these 'sensors' to be read by an arduino input pin.

You should be able to do this with an Arduino UNO, Micro, Pro Mini or Nano. The hardware can be pretty much the current setup you use.

The application itself will be developed in C#.

C# will be a problem on Arduino as it uses C++. You could convert C# to C++ or if it must be C# then look at using a netduino

Thanks for the link to the relay module. I thought I would have had to buy these seperately. A nice block with 8 on it like that is exactly the thing to keep costs down! My ULN transistor can then connect in and control these :)

As for the phototransistors any advice on what additional components I would require?

Would an UNO definately be enough for this? I dont want to purchase it then find out I need something bigger :(

Thanks.

Riva: You should be able to do this with an Arduino UNO, Micro, Pro Mini or Nano.

Thanks Riva. Will go look at these links :)

My ULN transistor can then connect in and control these

No need - the Arduino can control them directly.

Riva: C# will be a problem on Arduino as it uses C++. You could convert C# to C++ or if it must be C# then look at using a netduino

I realise the code on the Arduino itself will need to be C++ and thats fine. But the Windows application that the end-user is using will be C# and I was pretty sure that was ok with Arduino? Am I missing something?

wildbill:

My ULN transistor can then connect in and control these

No need - the Arduino can control them directly.

Oh! Right this is why I was asking, really not sure what to get and where to start!! Argggg! lol

Hope someone can help! I know its going to be a long slo but I just need to get my head round this!

tip2tail:

Riva:
C# will be a problem on Arduino as it uses C++. You could convert C# to C++ or if it must be C# then look at using a netduino

I realise the code on the Arduino itself will need to be C++ and thats fine. But the Windows application that the end-user is using will be C# and I was pretty sure that was ok with Arduino? Am I missing something?

Nope. The arduino uses simple serial communications via a virtual comm port. So any PC language or application programs that know how to utilize PC comm ports can work with an arduino project/application.

What did the current PC app do? If it was merely monitoring the LDRs and switching the relays accordingly, then all of that logic can be put into an Arduino and do away with the PC.

Or was there some user input required, that I didn't pick up on?

tip2tail:

Riva: C# will be a problem on Arduino as it uses C++. You could convert C# to C++ or if it must be C# then look at using a netduino

I realise the code on the Arduino itself will need to be C++ and thats fine. But the Windows application that the end-user is using will be C# and I was pretty sure that was ok with Arduino? Am I missing something?

Nope your not missing anything, I missed the fact the C# was for the Windows interface. :blush:

You can write the PC application in any language you like. It'll just need to be able to talk the the arduino over USB which will appear to your app to be a COM PORT. As you already know, the Arduino piece will be C/C++. Your app will send commands which the arduino sketch will parse and act on. Similarly, the sketch will send whatever data you require back to you by the same mechanism.

An Uno will be enough - you can get started with one and a relay board such as the one retrolefty linked to above and worry about the phototransistors later. The arduino can switch those 5V relays directly, so you can control each of your 12V devices from a digital pin using digitalWrite.

JimboZA: What did the current PC app do? If it was merely monitoring the LDRs and switching the relays accordingly, then all of that logic can be put into an Arduino and do away with the PC.

Or was there some user input required, that I didn't pick up on?

The application itself is a timer/controler for a Slot Car (Scalextric) race track. The software currently used was designed for Windows 98, and is no longer being developed. The club would like to add some new features, and move to a more modern PC setup. The application is there to control various aspects of each race, so can't do away with the PC :)

wildbill: You can write the PC application in any language you like. It'll just need to be able to talk the the arduino over USB which will appear to your app to be a COM PORT. As you already know, the Arduino piece will be C/C++. Your app will send commands which the arduino sketch will parse and act on. Similarly, the sketch will send whatever data you require back to you by the same mechanism.

An Uno will be enough - you can get started with one and a relay board such as the one retrolefty linked to above and worry about the phototransistors later. The arduino can switch those 5V relays directly, so you can control each of your 12V devices from a digital pin using digitalWrite.

Thanks @wildbill :)

I will be purchasing an Uno shortly and one of those relay boards. I see on eBay loads of Uno starter kits - would that be the best thing to buy?

Thanks,

Starter kits typically contain a Uno and some breadboard, and then a whole pile of other stuff like sensors, LEDs, the odd small motor, small servo, switches, resistors, a diode or two... stuff like that.... which might never get used since you have a project in mind.

OTOH, there's then loads of junk to tinker with in idle moments.

Make sure you get a USB A-B cable- they're a little unusual and you might not have one lurking around. The "B" is the sort of square looking end.

JimboZA: Make sure you get a USB A-B cable- they're a little unusual and you might not have one lurking around. The "B" is the sort of square looking end.

Is that not the standard USB printer type cable? I have a couple of them around! :)

Thanks,

tip2tail: Is that not the standard USB printer type cable? I have a couple of them around! :)

Yes it is the standard printer cable. But except for Arduinos and printers, pretty much everything has moved from the standard type B cable to USB micro cables (with a few holdouts clinging to USB mini cables).

Zombie post alert! ;)

I have FINALLY bought myself an Arduino Uno R3 and a load of components.

Just now getting started. I found myself playing about with CmdMessenger.

Is this the best library to use with C# ?

Mark