Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


MikeAqua

8036 posts

Uber Geek
+1 received by user: 3826


#324300 25-Mar-2026 16:51
Send private message quote this post

I'm trying to design a device to monitor half a dozen 12V DC circuits and display the status of each.  I would appreciate feedback on the general concept I have so far.  Also the best way to build it.  I'm thinking of using perf board.  If it works for a year and a day, I'll getting something made by PCB way or whoever. 

 

I should note this is for fun.  I'm not prototyping a commercial product or anything I will rely on for safety.

 

Basically, for each circuit I want the following states and outputs for 

 

  • Power to switch (input nominal state) - solid amber (could be a ring instead)
  • No power to switch (caution state) - flashing solid amber 
  • Power at switch output (alert state) - solid red
  • Power at switch output uninterrupted for x seconds (high alert state) - flashing red symbol

What I've come up with so far: -

 

  • Brains: Microcontroller like an Arduino or perhaps an ESP32 
  • Power: Voltage converter to convert ~12V DC to 5V to power the microcontroller. 
  • Input: Two opto-isolated relays per circuit to convert 12V DC to 5V signal
  • Output Option A: One amber LED and one red LED per channel
  • Output Option B: A small colour screen
  • Bonus Output: Peizo activated by high alert state on one or more circuits and a silencing switch

Notes

 

  • Device will be deployed on a boat and will monitor pump circuits.  It's non-critical as other alert systems are in place
  • Colour scheme is night vision friendly
  • 12v supply will vary a bit in real world use
  • I'll design and print an IP 67 case for it.  v1 enclosure will probably be a systema case
  • I'm not sure if this will need a heatsink?
  • I might also add brightness adjustment via an analog input/sensor or perhaps just day/night mode via a toggle switch (because they're cool)




Mike


Create new topic
elpenguino
3579 posts

Uber Geek
+1 received by user: 2943


  #3473668 25-Mar-2026 17:05
Send private message quote this post

  • Brains: Microcontroller like an Arduino or perhaps an ESP32 
  • Power: Voltage converter to convert ~12V DC to 5V to power the microcontroller. 

Most microcontrollers these days are 3.3V (or lower)

 

  • Input: Two opto-isolated relays per circuit to convert 12V DC to 5V signal

I wouldn't bother with relays to isolate the DC input - just use resistors.

 

  • Output Option A: One amber LED and one red LED per channel
  • Output Option B: A small colour screen
  • Bonus Output: Peizo activated by high alert state on one or more circuits and a silencing switch

Most microcontrollers can sink more current than they can source so it's easier to drive a PNP with an active low than drive a NPN with an active high.

 

 

 

FWIW I find perf board very time consuming and error prone to build. I just go straight to PCB for prototypes.

 

Have fun.





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21




k1w1k1d
1718 posts

Uber Geek
+1 received by user: 1325


  #3473680 25-Mar-2026 17:29
Send private message quote this post

Resistors would be easier/cheaper if all circuits have a common negative.

 

Is the 12v from starting or house batteries? 

 

Assume this is bilge pumps?


richms
29111 posts

Uber Geek
+1 received by user: 10226

Trusted
Lifetime subscriber

  #3473681 25-Mar-2026 17:36
Send private message quote this post

Amber is a red and green LED together, and 3 pin ones exist for this exact reason.

 

No need for relays on the inputs, just the optoisolator and a pull up resistor to the input pin. Relay just adds another point of failure. 

 

While you can just put 12v into a microcontrollers input with a large resistor to drop it and rely on the diodes to the supply to clamp it, this gives you a very high input impedance which in a noisy environment will get false triggers. At worst you want a lower value resistor and a zener diode to clamp the voltage, but this is just as much messing around as an optoisolator for component count.





Richard rich.ms



elpenguino
3579 posts

Uber Geek
+1 received by user: 2943


  #3473682 25-Mar-2026 17:40
Send private message quote this post

richms:

 

While you can just put 12v into a microcontrollers input with a large resistor to drop it and rely on the diodes to the supply to clamp it, this gives you a very high input impedance which in a noisy environment will get false triggers. 

 

 

Code out false triggers with checks over multiple periods before assuming high = active (or whatever the state is).





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21


MikeAqua

8036 posts

Uber Geek
+1 received by user: 3826


  #3473875 26-Mar-2026 09:34
Send private message quote this post

elpenguino:

 

  • Brains: Microcontroller like an Arduino or perhaps an ESP32 
  • Power: Voltage converter to convert ~12V DC to 5V to power the microcontroller. 

Most microcontrollers these days are 3.3V (or lower)

 

  • Input: Two opto-isolated relays per circuit to convert 12V DC to 5V signal

I wouldn't bother with relays to isolate the DC input - just use resistors.

 

 

 

 

I'll use whatever is appropriate for the board I buy.  I was looking at an Arduino micro which is (according to Arduino) 5V.  But if I go with ESP32 then yeah 3.3v

 

The thought with the opto-isolators is also to avoid damage due to transient voltage spikes, as they are pump circuits.

 

Resistors would be more compact but ... will they generate a lot of heat?  Is heat emitted as simple as the voltage drop x current?

 

 

 

 

 

elpenguino:

 

Most microcontrollers can sink more current than they can source so it's easier to drive a PNP with an active low than drive a NPN with an active high.

 

FWIW I find perf board very time consuming and error prone to build. I just go straight to PCB for prototypes.

 

 

Can you explain the first sentence in a little more detail.

 

RE Perf board, maybe I'll try it on breadboard first and then go straight to PCB.  I've never properly designed a PCB before, but it would be very useful tool to pick up.

 

Thanks for your help, much appreciated.





Mike


elpenguino
3579 posts

Uber Geek
+1 received by user: 2943


  #3473892 26-Mar-2026 10:14
Send private message quote this post

MikeAqua:

 

I'll use whatever is appropriate for the board I buy.  I was looking at an Arduino micro which is (according to Arduino) 5V.  But if I go with ESP32 then yeah 3.3v

 

The thought with the opto-isolators is also to avoid damage due to transient voltage spikes, as they are pump circuits.

 

Resistors would be more compact but ... will they generate a lot of heat?  Is heat emitted as simple as the voltage drop x current?

 

 

 

Yes, resistors would dissipate power but you would use high values and the power dissipated would be trivial.

 

If you're aiming for a very robust solution then addressing transients on the inputs is a 'must'. Opto-isolators is one approach (not sure what the opto-isolated relay achieves over a plain opto-isolator) but you can also go for resistors with transient protection diodes.

 

And if you're generating transients with pumps etc you should be addressing them at source, to protect other gear.

 

 

 

 

 

elpenguino:

 

Most microcontrollers can sink more current than they can source so it's easier to drive a PNP with an active low than drive a NPN with an active high.

 

FWIW I find perf board very time consuming and error prone to build. I just go straight to PCB for prototypes.

 

 

Can you explain the first sentence in a little more detail.

 

 

The easiest way to drive the LED is to use a transistor as a switch. The transistor needs current fed into the 'base'. NPN type needs positive current. PNP needs negative current.

 

Micro output pins can deliver more negative current than positive.

 

This all depends on the load you need to drive and I dont want to over-complicate it for you (may have already lol).

 

To drive a modest load like a LED or a piezo you can use a cheap NPN like BC547 and a high output signal.

 

You shouldn't drive loads directly from the output pins, BTW.





Most of the posters in this thread are just like chimpanzees on MDMA, full of feelings of bonhomie, joy, and optimism. Fred99 8/4/21


 
 
 

Support Geekzone with one-off or recurring donations Donate via PressPatron.
MikeAqua

8036 posts

Uber Geek
+1 received by user: 3826


  #3473894 26-Mar-2026 10:15
Send private message quote this post

k1w1k1d:

 

Resistors would be easier/cheaper if all circuits have a common negative.

 

Is the 12v from starting or house batteries? 

 

Assume this is bilge pumps?

 

 

The starter and house batteries have a common negative.  Whatever I do all circuits will have a common negative.

 

The 12v will be one from one of the starter batteries (the one that powers all the pumps). The start batteries and house battery are connected at times by automatic charging relays which causes some or all of them to have a common positive.

 

The pumps are two bilge pumps, a livebait pump, a washdown pump and an anchor warp washer pump (reduces mud build up/corrosion in the anchor locker).  





Mike


MikeAqua

8036 posts

Uber Geek
+1 received by user: 3826


  #3473922 26-Mar-2026 10:36
Send private message quote this post

elpenguino:

 

Yes, resistors would dissipate power but you would use high values and the power dissipated would be trivial.

 

If you're aiming for a very robust solution then addressing transients on the inputs is a 'must'. Opto-isolators is one approach (not sure what the opto-isolated relay achieves over a plain opto-isolator) but you can also go for resistors with transient protection diodes.

 

And if you're generating transients with pumps etc you should be addressing them at source, to protect other gear.

 

 

 

The easiest way to drive the LED is to use a transistor as a switch. The transistor needs current fed into the 'base'. NPN type needs positive current. PNP needs negative current.

 

Micro output pins can deliver more negative current than positive.

 

This all depends on the load you need to drive and I dont want to over-complicate it for you (may have already lol).

 

To drive a modest load like a LED or a piezo you can use a cheap NPN like BC547 and a high output signal.

 

You shouldn't drive loads directly from the output pins, BTW.

 

 

Opto-isloators it is.  You're right I don't need the relays. 

 

Transients ... I learned about those the hard way when a bad connection to a starter motor fried a fishfinder. The boat has two starter batteries and a house battery.  Anything that can cause a transient is connected to one starter battery. All the electronics (which includes lights these days) are connected to the house battery.  The idea is that any transients are absorbed by the starter battery or house battery, so they can't electronics.  This is how most marine 12v systems are wired.

 

In addition, the main feed to all the electronics is via a BEP surge isolator.  That diverts any transients to a slow-burn circuit breaker on the negative side of the circuit breaker. 

 

This won't protect the device I'm contemplating however as its 12v connections to the switches will be unprotected and exposed to transients from the pumps.  I could use snubber didoes as you say.  I'm never really sure where to put them - close to the pumps or close to the board?   The cable runs will be about 10m each.  I do have some very chonky snubber diodes somewhere, leftover from a failed attempt to use solid state relays to control bilge pumps (they got too hot, despite my best attempts at passive cooling).

 

I think the output loads will be tiny.  I was thinking of connecting the LEDs directly to the Arduino.  But transistors are a better idea.  I've never used them before so a learning opportunity.





Mike


MikeAqua

8036 posts

Uber Geek
+1 received by user: 3826


  #3473944 26-Mar-2026 11:11
Send private message quote this post

richms:

 

Amber is a red and green LED together, and 3 pin ones exist for this exact reason.

 

No need for relays on the inputs, just the optoisolator and a pull up resistor to the input pin. Relay just adds another point of failure. 

 

While you can just put 12v into a microcontrollers input with a large resistor to drop it and rely on the diodes to the supply to clamp it, this gives you a very high input impedance which in a noisy environment will get false triggers. At worst you want a lower value resistor and a zener diode to clamp the voltage, but this is just as much messing around as an optoisolator for component count.

 

 

That's good to know on the three pin LEDs.  While looking them up I also stumbled across two pin RGB LEDs that will work with Arduino via PWM.  They would allow all sorts of colours and patterns.

 

Opto-isolators should also deal with transients (hopefully without going pffft).  The circuits being monitored have pumps drawing up to 20A.





Mike


MuzaNZ
45 posts

Geek
+1 received by user: 36

ID Verified

  #3473961 26-Mar-2026 11:39
Send private message quote this post

Since you're going to use this for a boat, have you looked at the Open Chart Plotter project?

 

Its an open source project that started off as just a charting tool, but has expanded with multiple plugins that include monitoring sensors and inputs.

 

You can install it on a Raspberry Pi and use an old tablet or ipad as the screen.

 

 

 

https://opencpn.org/OpenCPN/info/downloadplugins.html

 

 


MikeAqua

8036 posts

Uber Geek
+1 received by user: 3826


  #3474007 26-Mar-2026 13:38
Send private message quote this post

MuzaNZ:

 

Since you're going to use this for a boat, have you looked at the Open Chart Plotter project?

 

Its an open source project that started off as just a charting tool, but has expanded with multiple plugins that include monitoring sensors and inputs.

 

You can install it on a Raspberry Pi and use an old tablet or ipad as the screen.

 

https://opencpn.org/OpenCPN/info/downloadplugins.html

 

 

I have as it happens.  I mostly fish in the Marlborough Sounds and the council here collected some great high-resolution bathymetry, all of which is publicly available.  Another project on the do-one-day list is to build an open plotter unit, using hr MacArthur hat, which allows NMEA (both types) integration and takes a 12v supply.  It went on the backburner, when I bought a modern outboard, which sends NMEA 2k data to the plotter.  Also finding a suitable monitor for an open boat was an issue too (minimum IP67, daylight viewable).

 

I'm currently working on transforming the public data into a format suitable for a Lowrance chart plotter and fish finder.  I've found a how-to by someone who has done it.  It's a long, complicated process, that I haven't fully got my head around yet.





Mike


Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.