I am attempting to make a teeny tiny counter for my daughter’s doll set!
I’d like to use Arduino to prototype, then miniaturize the RTC and LED controller and get it down to 1.5 or 3v (for battery size).
I’ve done some research, but wanted to say (hi!) and see if anyone can point me in a solid direction?
I’d like to mimic the cool style of a 7 segment display, but use individual 0805 LEDs to light each segment.
So basically press a button to start and have the LED count up from zero.
I’ve purchased:
-Arduino Nano Every
-0805 SMD LEDs w/ wire
-DS1307 RTC
-Other misc. parts
I have a basic parts kit as well (button, sensors, displays, etc.)
Looking forward to getting the conversation started!
Hi,
I don’t think you need a DS1307. The Arduino can handle time pretty accurately. Here is a short sketch. When you press the button, the display counts up to 1000 seconds and then starts over at 0 again.
#include "SevSeg.h"
SevSeg sevseg; //Instantiate a seven segment controller object
#define button A0
void setup() {
byte numDigits = 4;
byte digitPins[] = {2, 3, 4, 5};
byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
bool resistorsOnSegments = false; // 'false' means resistors are on digit pins
byte hardwareConfig = COMMON_ANODE; // See README.md for options
bool updateWithDelays = false; // Default 'false' is Recommended
bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
bool disableDecPoint = false; // Use 'true' if your decimal point doesn't exist or isn't connected
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
updateWithDelays, leadingZeros, disableDecPoint);
sevseg.setBrightness(90);
while (button != HIGH);
}
void loop() {
static unsigned long timer = millis();
static int seconds = 0;
if (millis() - timer >= 1000) {
timer += 1000;
seconds++; // 1000 milliSeconds is equal to 1 second
if (seconds == 1000) { // Reset to 0 after counting for 1000 seconds.
seconds=0;
}
sevseg.setNumber(seconds, 0);
}
sevseg.refreshDisplay(); // Must run repeatedly
}
If you wanted to have a little smaller Arduino that runs on low power, you can use the Arduino Pro Mini 3.3V. You would need to power it off of a 3.7V lithium battery with a 3.3V LDO regulator.