DFR0645 LED Display and the Nano


I’m having issues looking for some information to help me with a setup I want to make.

Put simply I want a a button membrane with each individual button to display something different on the LED display with a separate button to initiate the selection. I’ve never worked with i2c devices before and I’m thinking it is possible to output a set number (for this it’ll be 60, 90, 120) but having troubles working it all out.

So you’ll press one on the membrane and ‘60’ will be displayed, another button would then begin that timer to perform a certain function. Does this sound doable?


Hi Jake,

That definitely sounds doable! We’re there a specific range or products you were looking to achieve this with? And was your project meant to interact with another system?

I would starting your search by looking for an Arduino Uno, some momentary push buttons and 7 segment display!



Hey Liam,

The system will be activating a solenoid. So here is the low down:

Power button.
4 button membrane keypad for selecting a time delay.
LED display (the DFR0645) for showing the time delay selected.
An initiation button for starting the delay (or just to straight up initiate the solenoid, the one option on the keypad.
Power source that will power the nano (needed for size) and solenoid separately (with a transistor or relay to switch power to the solenoid).
I’ve done some coding before but will need to learn as I go (which is a good thing) however I’m just not sure on the I2C part of it. So far I’m aware of including such things as wire.h and some other commands and I figure I’ll be doing some code to monitor button presses and if/else statements to display the right time delay on the segment display.

I pretty much have all the components (other than a stinking mini USB to plug in to the PC haha

1 Like

Hey Jake,

I’ll let Liam know and see what ideas he had in mind for your project when he’s in. Although, if you’re looking for a power supply, as well as a way to control the solenoid, as long as the draw and voltage aren’t higher than the listed limits, the L298 can take the appropriate input for your solenoid, while also providing a regulated 5V output that you can use for your Nano to power it rather than having to use a separate supply.

Core Electronics | Support

1 Like

I guess for me atm is how to code using I2C.

1 Like

Once you have an I2C device, try to find a guide with code examples.
There’s a library for almost everything.



DFR’s Web site has a product Wiki and example.Gravity 4 digit display.

I may be ‘preaching to the converted’, but the other thing is to take a ‘structured’ look at coding and divide the job into bits you can work on.

  1. handle button presses
  2. convert them (do some processing) e.g.
    a) set the time to 60, 90 or 120 seconds
    b) display the time
    … other stuff
  3. operate the relay (use your operate button)
  4. go back and wait for the next button.

since you’re concerned about the IIC and display, use their example to print different times and wait 1 second between displaying them. Then change that code to only change the time when you press a button. then add the relay operation, tidy up the code, make sure the times you set are OK for what you want, document how it works…

above all, ENJOY.


Thanks for your response Dave,

Let us know if you need any help with the code your writing to do this Jake, we’ll be in touch if you need anything. Depending on the microcontroller you’re using we’ve got a few workshops free and available on the site if you need any pointers on the syntax of a particular language or how to use the different devices together.

Very good advice Dave! :slight_smile:

@Jake122538 FYI, we’ve got some good tutorials on using TWI/IIC:

And it’s also covered in Chapter 5.3 of our Arduino for beginners workshop:

1 Like

Thanks guys. :smiley:


You’re welcome Dave,

Let us know if there’s anything else that you need.

1 Like

Legends. When I start having a crack I’ll come back and let you know how it goes. It is a project for work and I’m hoping it’s the initial building blocks of doing more electronic projects