Hi, I'd like you to help me program a 7-segment LED. I'm completely new to Arduino, and my grandson would like to do something like that. Drivers drive too fast. Is this even possible?
Best regards Tadek
Topic split from another topic. Please do not add your own questions to the end of other people's topics.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.
Thank you.
Sorry I cannot help, you have not given us enough information to help you. Which of the many Arduinos are your using? What 7-segment display, post a link to its technical specifications.
Highly unlikely. But again it depends on what you have and how you have connected it. Start with an annotated schematic that will at least give us an idea of how it is connected to the Arduino.
That sounds like a great starting project that could be a lot of fun for both of you.! However, Please keep in mind that we are not a free design or code-writing service. We’re more than happy to help with your design or code, but we need you to make an initial attempt. Please design and write your code the best you can, then post it along with an annotated schematic and an explanation of what’s not working properly. There is also a for hire section if you want to pay for it.
-
Show Your Work First: Before asking for assistance, make an attempt to design or write the code yourself. Share your work along with details about what isn’t working. That includes a preliminary schematic that you drew.
-
Provide Clear Documentation: Since we can’t see, touch or feel your project, share an annotated schematic (best) or a clear drawing of your setup. Clear Pictures are welcome, but avoid using Fritzing diagrams as they are wiring diagrams, not schematics, and are not ideal for troubleshooting.
-
Include Technical Details: If there is specific hardware involved such as displays, include links to technical information. There are often many versions of similar components, so precise details are essential. I will assume the processor is a UNO. Many times the processor is stated as ESP32, please state which one and post a link to it.
-
Reference Resources: For additional help, check out useful links and tutorials: Useful Links on Arduino Forum. Of course one of the better sources of information (in my opinion) is the Arduino Cookbook. Skim it cover to cover and stop on any project that interests you.
I believe you will find most if not all of your project explained in the Arduino Cookbook.
One of many tutorials on line:
This is a community of helpers. We are not a free design or code shop. There is a paid section if you wish to go that route, however.
SUGGESTION: The location you purchased the LED from will likely have library recommendations. Install that and then look at the examples. Pick the example closest to what you want to do and start modifying.
And NO, drivers don't drive too fast.
You will need to read about:
- how to control an LED (any LED) with an Arduino
- how to supply power to many LEDs
- 7seg COMMON ANODE and COMMON CATHODE
- The seven segments of a 7segLED (really, there are eight)
Here is a sketch written to use a 4-digit, 7-segment display. A few comments are in the code.
// using common cathode
/* SEGMENTS
A
---
F| G |B
---
E| |C
--- o DP
D
*/
int pinA = 2;
int pinB = 3;
int pinC = 4;
int pinD = 5;
int pinE = 6;
int pinF = 7;
int pinG = 8;
int D1 = 9;
int D2 = 10;
int D3 = 11;
int D4 = 12;
int DP = 13;
void setup() {
Serial.begin(115200);
for (int i = 0; i < 12; i++)
pinMode(i + 2, OUTPUT);
digitalWrite(D1, LOW); // turn this digit ON
digitalWrite(D2, HIGH); // OFF
digitalWrite(D3, HIGH); // OFF
digitalWrite(D4, HIGH); // OFF
digitalWrite(pinA, HIGH); // turn this segment ON
digitalWrite(pinB, HIGH); // ON
digitalWrite(pinC, HIGH); // ON
digitalWrite(pinD, HIGH); // ON
digitalWrite(pinE, HIGH); // ON
digitalWrite(pinF, HIGH); // ON
digitalWrite(pinG, LOW); // turn this segment OFF
}
void loop() {
}
Hello, thank you very much for your help.
Med venlig hilsen/Best regards/Mit freundlichen Grüßen/Pozdrawiam
Tadeusz Kobylarczyk
man. 3. nov. 2025, 03.57 skrev xfpd via Arduino Forum <notifications@arduino.discoursemail.com>:
Are you trying to make a speed sensor or just want to know how to connect a 7 segment display to an Arduino.
I'm trying to build a speed sensor and connect it to the 7th segment. HLK-LD2415H Arduino ESP 32 or another.
Med venlig hilsen/Best regards/Mit freundlichen Grüßen/Pozdrawiam
Tadeusz Kobylarczyk
man. 3. nov. 2025, 09.51 skrev Jim P via Arduino Forum <notifications@arduino.discoursemail.com>:
Well your title only mentions 7 segment display, so everyone will respond with help for a dispaly and not the speed sensor part.
You may want to change the title to include speed sensor and ESP32.
What you appear to be wanting is some help in adapting the code in the project described here: Help with 7 segment LED display to output to a seven segment display instead of the TFT display that is currently used.
It seems that the code is so structured that it would be reasonably straightforward to replace the TFT screen with a 7 segment display for showing vehicle speed. Some of the messages, say "coming"/"going" would get lost or need another solution. The code is written for a 3v3 board with two UARTs (from the comments an ESP32).
If it is intended that the 7 segment display is to be visible from the road, there are plenty of projects showing that these can be made from banks of leds (google for "seven segment display huge diy"). Otherwise use a standard display. I guess you need a maximum of 3 digits. You could break it down into two separate projects which could later be joined (a) speed measurement and (b) display.
As has been suggested in post #10, change your title. Maybe also update your first post to include a statement that the project will be based on an existing project and include a link.