Relay boards with an API

Thread Starter

infy

Joined Jun 18, 2020
10
Hi everyone - I'm doing some high level thinking on a DIY project. I'm exploring paths that won't require a high commitment in time or investment. If there's no such path I'll just shelf this for another day when I do have the resources.

The objective is very simple. I'd like to have an API to control a 12v 10-30 amp relay board to manage automotive systems. I'd like to have a scalable number of channels.

A REST API would probably be the most straightforward way to read and set on/off states of a relay channel. But I'm open to any other type of interface as long as I can programmatically access it. There are some off the shelf solutions but they depend on proprietary software and would have to be hacked which isn't ideal.

There has to be something like this available?
 

MrSoftware

Joined Oct 29, 2013
1,956
My advice is take a step back and define the high level functionality you want, and start there. What is it interfacing to? If it's connected directly to a micro controller, a REST API is not going to be the best fit. One common mistake is to jump into a specific technology before the requirements are laid out. Try to avoid that mistake by laying out your requirements first. Also these days it's very common for ideas to already be in production. Have you checked amazon, ebay, sparkfun, alibaba, etc.. to see if something very close to what you want doesn't already exist?
 

Thread Starter

infy

Joined Jun 18, 2020
10
Very good points. It will likely be an Android (or iOS) device directly interfacing with the relays and providing a rich UX. It would act on user UI inputs and also subscribe to a web service to allow remote control of settings with a data plan. Since pins are a problem on consumer devices the simplest path to a relay is probably a wireless HTTP interface. But I'm open to any suggestions.

I've modified my search terms and I'm getting a little luckier. This seems like a possible solution.. although it's limited on amps:
http://denkovi.com/wifi-8-relay-board-web-tcp-ip-telnet-http-api-smtp

I'm still browsing elsewhere.
 

MisterBill2

Joined Jan 23, 2018
7,697
Mr. S is totally correct. FIRST you need to define what it is that you want to control, and exactly what aspects of it you want to control. Then youneed to understand just what is actually needed to provide the control of the functions to make whatever you are controlling do just what you want.
AND, Really, for most automotive systems the only controlling that you can do with a single high current relay is switch them on and off. That is fine for lights, but even controlling a fan takes more than on/off control.
And a nitrous oxide injection system needs more than just switching on to provide much benefit.
 

Thread Starter

infy

Joined Jun 18, 2020
10
Just turning lights and accessories on and off is fine for now. No engine management.

The Denkovi hardware is interesting but it looks like they're based in Bulgaria and I'm not entirely ready to deal with a supplier across the world. I'm a little surprised I haven't found another option more readily available. There are a few Arduino options on Amazon but having another module in between seems like adding unnecessary complexity to a system.

Engine management may be a longer term goal. It's completely analog. There are no electronics in there. Apart from electronic ignition and an alternator. I'd like to get an ADC on the tachometer, temps, oil pressure, and etc to add some safeties like an automatic shut off and alarms. But that's a bit more complex topic than flipping accessories on and off and outside the project scope.
 

MisterBill2

Joined Jan 23, 2018
7,697
OK, Now I have a better understanding of what the package would be doing. One handy thing could be a security feature so that others would not drive off or rip-off.
I suggest a great deal of consideration about any internet connection. If it is connected then it is hackable, and that could be a big inconvenience.
 

MrSoftware

Joined Oct 29, 2013
1,956
My second advice; build a proof of concept first, before you custom design. There are tons of relay "shields" for arduino, and REST API code for arduino is readily available. I worked on some escape room projects that used arduino with REST API's for some of the props, so check some escape room projects for the REST code if you have trouble finding it. Although those projects used wired ethernet, there must be radio shields for arduino. Grab some off the shelf hardware, cobble it together and give it a test. That will save you time and you'll learn about things that you didn't expect, which you can roll into your custom design. This is why you see lots of "development boards" and development kits out there, to make it possible to build proof of concept projects easily before going to custom hardware.

Arduino is a great proof of concept platform for someone who doesn't have a lot of embedded experience because they've made it about as simple as embedded can be, plus there is a ton of online support. When you start moving towards custom hardware, if you want wireless check out the dev boards from Nordic and Rigado they produce boards with ARM processors coupled with various radios (Bluetooth, WiFI, ...). The learning curve will be very steep if you're new to embedded software, but you'll get a ton of functionality plus a radio in one module that has already passed FCC certification. There are multiple good solutions, Nordic/Rigado are just a couple I have used myself.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
7,697
The challenging part of using an arduino will be the packaging of the parts so that they can still live while being in an automotive environment. Power and connections to the outside world can be quite the challenge.
 

MrSoftware

Joined Oct 29, 2013
1,956
The challenging part of using an arduino will be the packaging of the parts so that they can still live while being in an automotive environment. Power and connections to the outside world can be quite the challenge.
I don't think you would use one for production, but you can toss it into a project box for a proof of concept. There are a bazillian boxes available, all different shapes and sizes and IP ratings. For example polycase.com is one of many online sources.
 
Top