Best way forward for multiple I/O

So this is ultimately what I'm trying to achieve (complete Arduino Novice).

The idea is the keypad will input a single digit. This will deliver a one line text to the LCD confirming the sequence.

LEDs will fire at the same time as the solenoids depending on keypress to give a visual representation of what's happening. Solenoids will fire into a water table so wave patterns can be observed.

Switch block is there so individual solenoids can be disabled, no matter the sequence. (This is to simulate a failed component). I have 2 MOS FET boards on order to "fire" the solenoids.

I've got the LEDs firing in a few of the sequences I need and I'm continuing with the programming. It's a bit "clunky" at the moment, but as I'm new to this, it's getting my head round things.

As you can see from the block diagram, I need WAY more pins than my UNO has got. I think it's about 39 in total. What's the best way forward?

An Arduino Mega seems like the obvious answer. Otherwise I would use module(s) with MCP23017 or similar. Assuming you don't need PWM on the solenoids?

1 Like

Select a LCD using a I²C interface.

1 Like

Don't think so as they're 12v push-pull

If the LEDs are to echo solenoids, can you wire them on the pins that connect to the MOSFETs?

1 Like

Quibble - does your LCD really need 16 pins? Sure, there are 16 connections, but how many are data, vs power, gnd, LED, and contrast?

Anyway, it could be done with anything with 9 input/output pins, provided it has I2C. I'd do it with a Nano.

  • I2C display
  • I2C 16 bit device (prefer MCP23017) for 8 LEDs and 8 Solenoids
  • 7 pins for the keypad

Yes, a Mega would be a good option, particularly if you'll decide next week to add more solenoid/LED pins.

By the way, depending on your MOSFET driver's input needs, and your LED currents, you could probably drive the LEDs and the FETS from the same output pins, since as I see it, you're just using the LEDs to show you what the solenoids should be doing.
YMMV

1 Like

@wildbill a
@camsysca

True and clever both of yous. On the other hand, having the LEDs mirror the solenoids but enjoy their own pins gives information lost in the case of a solenoid or MOSFET failure.

Think nuclear power plant - the valve must be closed, the lamp is red.

Of course in something majorly critical, valve stays woukd be in a closed loop for better verification. I hope. :expressionless:

a7

1 Like

Yes, but having them on separate pins means you're never quite sure the software actually set them both the same...
Besides, in either case, a DVM is the better telltale.

I agree with the other opinions given.

Get an i2c backpack for your LCD. These often contain a pcf8574 chip. Several of the commonly used arduino 1602 LCD libraries have option for i2c backpacks like these.

Use a pfc8574 chip or module between the Uno and keypad. There is an Arduino keypad library that supports this. Be sure to set the i2c address to a different one than the LCD backpack uses.


This module has pass-thru connector which would allow you to daisy-chain the LCD backpack off it.

Connect the LEDs and mosfet board to 8 Uno outputs. An Uno output should be able to drive an LED (with series resistor) and a mosfet input at the same time with no problem.

1 Like

Yeah, I've had dumber better ideas. While I was busy with the cat I though maybe one LED directly on the pin that drives the MOSFET and another in parallel with the solenoid.

a7

1 Like

Thanks for that. Like I said, I'm new to all this but not averse to having a go. I've seen the comments about the arduino uno being abe to hanlde driving the LEDs (and R220) as well as having enough to drive the MOSFET so that'll save some pins.

The pass-through is something I didn't know about/realise, but had been looking at 20x4 LCDs with one of these modules already fitted.

The pass-through connector is designed for attaching multiple of that same board together. It should also work fine connecting an i2c LCD to it, but check that the Vcc/Gnd/SCL/SDA pins are in the same positions, and if not, wire accordingly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.