Mini Business Ad on Arduino Board!
by alexuisedmonds11 in Circuits > Arduino
14 Views, 0 Favorites, 0 Comments
Mini Business Ad on Arduino Board!
.jpg)
In this project, I created a LED advertisement display using an Arduino board, an SH1106 OLED screen, and a row of LEDs. The LEDs animate from left to right and back to catch attention, while the OLED display shows a custom bitmap—perfect for a mini digital business ad.
I designed this project to both grow my computer science skills and promote my business, Hair by Lexx. Learning how to animate ads and display logos helps boost my brand's visibility in a fun and tech-savvy way!
Supplies
To recreate this project, you’ll need:
- Arduino board (Uno, Nano, or Mega)
- SH1106 128x64 OLED display
- 12 LEDs (adjust as needed)
- 220Ω resistors (1 per LED)
- Jumper wires
- Breadboard (optional, for easier connections)
- Computer with Arduino IDE installed
Hardware Setup
OLED Display Wiring
VCC → Arduino 5V
GND → Arduino GND
SCL → Arduino A5
SDA → Arduino A4
LED Wiring
Connect LEDs to Arduino digital pins 2–13.
Use a 220Ω resistor in series with each LED (between the cathode/short leg and GND).
If you're using more or fewer LEDs, update the numLEDs variable in your code accordingly.
Install Required Libraries
In the Arduino IDE:
Go to Sketch > Include Library > Manage Libraries.
Search for and install: U8g2 (for the OLED screen).
Make sure the Wire library is installed (usually comes pre-installed).
Upload the Code
Paste the following code into a new Arduino sketch:
Convert Your Image to Arduino Bitmap
You’ll need to convert your logo or ad image to a format the Arduino can use.
Follow these steps:
- Use black and white only (no grayscale).
- Stick to bold shapes, icons, or text.
- Ideal image size: 128x64 pixels.
- Use tools like Canva to design, then export as PNG.
- Convert with images2cpp
- Upload your PNG.
- Set the following:
- Width: 128
- Height: 64
- Output format: Arduino code
- Drawing mode: Monochrome
- Resize method: Scale to fit or Stretch to fill canvas
- Check “Swap” if the image preview looks rotated.
- Click Generate Code.
- Copy only the contents inside the curly braces { ... }.
Example:
Add to Your Sketch
Paste the bitmap array below the others in your sketch.
Declare it near the top:
Add it to the bitmaps[] array:
Upload and Run in the Arduino IDE
Go to Tools > Board and select your Arduino model.
Select the correct Port.
Click Upload.
Once uploaded:
LEDs will animate left to right and back.
OLED will display your bitmap for 2 seconds per loop.
Troubleshooting Tips
OLED Issues:
- Check all wiring (especially SDA/SCL pins).
- Make sure you installed the U8g2 library.
- Confirm your display is SH1106, not SSD1306 (they use different drivers).
LED Issues:
- Double-check pin assignments and resistor placement.
- Make sure numLEDs and startPin match your actual setup.