Clarification requested re: what ought to be a simple project

Hello!
I'm a tota "noob" coming to Arduino from a non-electronics, non-advanced-math background.
I'm confused about the following:
[1] Can I use a relatively-simple USB-->Nano-Every-->Breadboard-->ATTiny85 setup? Or do I really "need" to use an $18 to $100+ <!!!> board merely to flicker one little 0402-size LED...?
[2] If the abbreviated setup will do, can I then just use the MCU, with an appropriate battery (and resistor if necessary) to control the LED in the actual projects...?
[3] If 2 is true, do I really need to know all of the flavors of C, AND python, AND "git-speak", AND "Arduino-speak", to tell the MCU "alter the power to LED1 at pseudo-random interval X, and to LED2 at pseudo-random interval Y", or is there "one program to rule them all" so to speak...?
[4] If 3 is true, is that One Program the one that's downloaded from arduino.cc (i.e., the "IDE") - AND will that version even comminicate with the Nano and the MCU? (I saw someplace mention that I'd need "the old IDE", which I find confusing.)

The reason I ask all of that is:
I want to include the above LEDs in 1:120 up to maybe 1:100 scale miniatures. Due to the small sizes, using a commercial LED tealight to control the 0402s is completely impossible due to space constraints (since I'd also need extra battery power and extra resistors and so on just to deal with the silly relatively-gigantic commercial things). I actually tried that, and ruined the miniature I had been working on because I tried to force all the stuff to fit...

Although I can now buy pre-wired 0402s with an inline flicker widget, they're twice the cost of the parts that I (perhaps delusionally???) thought I could use for this, and to be honest, my budget is also on the miniature side, so costs matter. Plus, I'd have no control over the length of the wire leading from the flicker-unit to the LED.

Thank you for your patience in slogging through my post, and for any guidance that can be kindly given to this befuddled old "noob"...!

Whoa there, partner! You're way overthinking this from the getgo and you know, us cowpokes, we take it as it comes.

So what you need to do is, figure out on a piece of paper what you want to build. Jot down all the steps and then jot down what you think will be required to accomplish all this.

Do some reading, a little research to help manage your expectations. Make an attempt.
Get help here, following these conventions:
https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/681308

You've got a whole lot wrapped up in that initial post, you need to break it down.

cowp

Thank you for your response!
Just to clarify:
I don't want to blink the LED, I want a pseudorandom flicker. (I do understand that it's not truly random.)

I understand that a 555 - or more usefully for lower power, a 557 if I correctly remember the designator - will indeed blink and LED. So will transistors. But I've asked about the pseudorandom/"candle" flicker effect and have been told by several people that I need an MCU for that. I had looked at the PIC and decided I didn't want to take the gamble of paying for a third-party programmer where the common suggestion is "buy several because many of them don't work" - I don't have money for that. Someone suggested "Arduino" to me, and I've spent the past 2 weeks or so trying to find out what it is and how it's used.

That is how I ended up focusing on the ATTiny85, which I though I'd mentioned. Apologies if I didn't. At any rate, I chose the 85 because I assumed that more instructions would be required for flickering, than would be needed for merely blinking. So I went for the 8 rather than the 4 etc.

I had not seen mention made that the IDE and the "sketches" (instruction sets) are in "C". So that's new information to me.

I also do, in fact, realize that I can program the Nano board by connecting it to my computer via USB and using the software from arduino.cc. I'm confused as to whether I can then use that to program the ATTiny85 (sorry, I though I'd mentioned that MCU) with various functions. What I am not clear on is whether I can then do something like this:
battery--->?resistor?--->ATTiny85---->resistor---->LED (flickering)
or whether I have to use an actual commercial board to utilize the ATTiny85 functionality.

I do know that the Nano can be programmed and then itself be a "translator" between the computer and the ATTiny85 (or 45 or other flavors of the ATTiny....I'm focused on the 85) and thereby send instructions, but I'm not clear on the battery--->MCU--->LED possibility.
Or in other words, place the MCU between the battery and the LED. It simply has not been clear to me whether that is doable.

It seems to me that the main advantage of the"digispark" mini-board (which still costs more than the MCU alone) is that it has an integrated USB connection, but it's made me question whether I can arrange things as above, directly powering the ATTiny85 which would then connect to the LED. I've seen descriptions of the larger boards being used for LED effects, but using such would be insane.

I have in fact been looking all over, and trying to find applicable tutorials. I of course will continue to look. I'm not starting from Zero; if anything, I've found so much information that I feel like I'm trudging through a swamp of tangential data.

I apologize if that constitutes not being "willing to put in some effort".
I also apologize for wasting anyone's time.
Please feel free to delete my post.

I will meanwhile get back to solitary trudging through the information swamp looking for some solid intermediate ground or tree root.
Thank you for your time.

You can ask that it be, but don't.

One thing that might help is to work towards getting one or a few LEDs flickering without worrying about how small the thing in front of you is.

It is more challenging to develop code for the smaller chip, not code challenges but lack of resources for seeing what your code is up to, longer code-upload-cry and try again cycles and so forth.

On a budget I would say start with the UNO available in the wokwi simulator, where you will find all the parts you need.

With it you can work through th basic examples. I haven't lately, but flickering like a candle has been done many times. Take a google and the trick is to add Arduino to any search to focus your results.

If (when!) you have a few LEDs acting plausibly, get a cheap UNO and some real LEDs, as all things look different when you make them for real. LEDs must be seen in the final lighting circumstances. You could do this by placing only the LED in the model for now.

The code should work with minor changes for any Arduino, and you can simulate the smaller chip first, then begin the part where you program the small chip using the UNO as a programmer, which takes some setting up but has been done by many ppl and is way less fussy end to end than the digispark USB thing - as soon as I found something for the digispark boards I had that I could burn and just forget, I did. No mre digispark problems.

One thing will be the battery life. How are you planning to turn on and off the device? There are tiny rechargeable cells and batteries of them that might work well.

a7

Hello, 777, and thank you for your reply.

If my post is even marginally useful to someone, then it can of course stand. I only didn't think it was, based upon the initial response. Especially since I'm confused as heck, not lazy and certainly not dimwitted. Merely confused because the information is like a deluge and much of it has seemed contradictory.

Oh!, I have to say that the Wokwi simulator (https://wokwi.com/) IS fun, tho' the interface takes a wee bit of getting used to - I ended up with some amazing squiggles at first, LOL! But it is nifty once one sees how it works.

What's amazed and confused me about "candle flicker" is that I was sure it's Old Hat, barely a step up from the Stirling engine. So I suppose that I might need to try The Way Back Machine to search archived info.

Meanwhile, I'm going to take the plunge and order the Nano Every and start there, mostly because the price is so affordable that I can get a breadboard kit with it and a few of theATTiny85 "dip-8" chips. I have a number of both "regular" and small "wired" LEDs (and sundry other tidbits) that can be used with the breadboard.
If I accumulate enough skill and expand my projects, I can always look at the Uno and/or others with more capability. Hopefully keeping it simple for now...

OH, you had asked about battery life. My initial models involved mounting small push-button switches for each section of the house. The buttons were located under the "porch" and the batteries and so on, as well as the musical movement, are in the "basement".

I had considered something that could be plugged in and recharged, but didn't have room because those first ones had so much space wasted by the kludgy 3mm-flickering-LED-plus-optical-fibers. It's so darned ugly that I want to rip the guts out of that one and toss ALL of it. The static lights are OK, but the fireplaces are so awful that it makes my teeth hurt to look at them.

So for now, I'll work around the existing CR2032 holders, and consider a plug-in modification in future models. I definitely much prefer the idea of rechargables, rather than disposables. So that is a great idea. Something to keep in mind :wink:

I'll keep slogging away with the "flicker"-related searches and tutorials of course, and things will eventually start to organize themselves. It's definitely not the most efficient learning strategy and, although it's allowed me to succeed in the past with a variety of skills and areas of knowledge, I just had hoped for an improved (read: more efficient and time-saving) strategy with this specific skill set, since a significant number of the various things I need to do are fairly physical, which just takes my old body a lot longer to do nowadays.

But hey, who needs sleep, right?
LOL! :sweat_smile:

and

make me add that I too would get the classic Nano, not the Every. You will not need the extra stuff on the Every and you will not miss the occasional difference that makes a real difference.

a7

Here's a pseudo computer running a pseudo random LED on a pseudo Nano...

And an ATtiny85 with a button.

Hello, and thank you for your reply!

This does clear part of my confusion!

BlockquoteThe role of the UNO is just as a programmer. The tiny doesn't have a USB port, so you either have to buy a programmer or use another Arduino as a programmer.

Excellent! I had gotten befuddled because I saw several posts where people were trying to show what they had done, but didn't specify that the MCU could then be used independently from the board used to pass the information/program from the computer to the MCU.

That's the cornerstone I was seeking, the foundation so to speak.
Thank you!!!

Isn’t the every cheaper than the “classic nano”? (Except that there are very many very cheap “clones” of the classic nano.)

I’m still unclear what you thought cost $100…

A nano of any variety is capable of programming the smaller Attiny chips. I’m not sure that I’d recommend the tiny85 - it is less capable and more expensive than some of the newer Attiny chips like the attiny1604.

You have a choice, even using the arduino IDE, of Arduino, pure (but somewhat limited) C++, pure C, or assembler. You don’t need to learn all of any of them, and you won’t need any python expertise.

I’ve fit the “pseudo random flicker on 6 leds” on a tiny 8pin micro (pic12f675?, attiny11?), so flickering one on a 4K+ avr should be pretty easy.

Hello Westfw,
I'm not sure whether you were asking me, or Delta_G, but I have to thank you for alerting me to the possibility of clones. Looking at the Classic Nano sold on the arduino.cc website, and these other Nano 3.0 boards, I'm 99.96% sure that these others are clones. I don't want to be "penny wise and pound foolish", but on the other hand, a couple of the vendors have been reliable, and offered good quality, with other items... Well, I'll have to look more deeply into that and give it more thought.

One thing seems to be sure, though, which is that the Classic is the superior choice. As Delta_G noted, and others have agreed, things run more smoothly on the Classic, which I take to mean that I'm less likely to run into random bits of weirdness.

Regarding the ATTiny85, I was looking at the combination of MHz, clock speed (which I assume is different?) and the memory. I honestly didn't have even a remote idea regarding how much of each might be needed even though I assumed my project was simple, so I thought that the "85" was the best balance of capability and cost. I admittedly have no clue whatsoever what resources are actually needed to drive 3 to 6 candle-flicker LEDs, and I was trying to hedge my bets.

The other factor, of course, was the size - the "85" is small enough that I can easily fit one, and probably several!, into my miniatures, and the version that's "SMD", if I have that correct - that has flat connectors that get soldered onto a board, as opposed to the one with "legs" that's "through hole" - anyway, it looks like the flat one is flat enough to be accommodated by a slender shadowbox-type scene, even maybe a greeting card. (If the chip can simulate flames, then it can also simulate stars in the night sky that "twinkle" due to the effects of the atmosphere...)

So, that's my reasoning for choosing the "85" - I realize that what I want to do, is to electrical engineering and design what stacking a few alphabet blocks is to the architectural know-how of Gehry doing the Walt Disney Concert Hall or the Barcelona Museum. But I'm sure even he stacked a few blocks when he was a toddler :wink: In terms of electronics, I'm just a very OLD toddler, LOL! :wink:

Re: the "$100", when I had first started looking into the idea of programming a microcontroller, I saw an array of "kits" and "flash chips" and things I don't even remember at this point, though I had looked into the PICKit (I also had considered the PIC12F675), and the only PICKit currently produced by the manufacturer, version 5, is well over $100, and the earlier versions were all third-party items, with the common advice in the reviews being "buy two or three because they don't all work" - with "two or three" adding up to the cost of the most recent OEM item. I also was getting the impression that I "actually need" a whole board (such as the Nano) to run one silly flickering LED. It was maddening! Now I know better, because Delta_G and others confirmed that the Nano CAN function as the basic connection and "translator" between the computer and the Microcontroller, via a few breadboard connections. Sort of like a UN translator bridging someone speaking in one language, and those who need to hear it in their own language.

So, that's the story.
I'm still focused on the ATTiny85 (the "20PU") but have decided to nix the "Every" and go with the "Classic Nano". The only decision now is, do I go for clones from a manufacturer I've gotten good items from, or go "luxury class" and order one directly from arduino.cc...

Last but not least, I think that the "arduinospeak" is going to be enough of a challenge for my "alphabet blocks"-level of knowledge at this point. Delta_G and others have been very kind in offering links to various tutorials and simulators, which look excellent and offer step-by-step tutorials for programming the chip.

So the proverbial waters are beginning to clear, Hooray!

Thank you, xfpd! I'm exploring all of the links that you and others have kindly provided :smiley:
When I'd started looking into this microcontroller-directed-candle-flicker topic, I had no idea what was relevant, and ended up totally confused, so I do appreciate the guidance!

Thank you for the additional Wokwi links, xfpd - when I had first looked at it, I didn't realize that it had more than that one simulator <blush...>
It's actually a rich resource, so it was great that you offered those links :smiley:

A pickit gets you both programming AND debugging, across a wide range of product lines (pic16, pic18, pic24, pic32, spi avr, updi avr, pdi xmega, TPI tinyavr, assorted microchip ARM chips, etc.)

There are much cheaper solutions if all you need is programming of a particular avr, including sketches that run on an arduino (or clone.)

Also, there is the MPLAB SNAP that seems to support most of the features of a pickit, but is only about $40. (And it used to go on sale “frequently”, but it’s been a while…)

Another cheap route is the “Curiosity” and “xplained mini” development board from atmel. They have an on-board debug chip that can usually be coerced into programming off-board chips as well.

You trying to make like a campfire LED effect?

  1. Wiring Issues:
  • Verify that the SPI pins are correctly connected: MOSI to MOSI, MISO to MISO, SCK to SCK, and SS (Slave Select) to SS.
  • Inspect for any loose or faulty connections which might disrupt communication.
  1. SPI Modes and Clock Settings:
  • Ensure both Arduinos are configured to use the same SPI mode (a combination of clock polarity and phase).
  • Confirm that the SPI clock speed is appropriate, as setting it too high can result in data transfer errors.

Here's code for a 16 piece Neopixel ring, if it's something like what you're after. It's an oldie in my sketchbook, haven't made this in years, but it was pretty good back then as I recall.
Adapted slightly from, and credit to original sketch author, Mark Kriegsman, 2012.
In other words the good parts are his; if it doesn't work, may be one of my changes. Should be good though.
https://blog.kriegsman.org/2014/04/04/fire2012-an-open-source-fire-simulation-for-arduino-and-leds/
I used a little plastic "wood effect" campfire thingy to house this about three inches deep with the Neopixel ring in the bottom and some orange and red tissue paper in and around the top with a little fan in the bottom (not connected to Arduino, just to power) to blow the tissue paper strips around like "flames".

This code/library may have been updated by now, it's been years, so you may have to look into that. Otherwise:

/*See original library sketch for the explanations
  by Fire2012 by Mark Kriegsman, July 2012 
  
  Burns slowly like late night around a campfire, about to self-extinguish
  . After ten minutes, quickly goes out. If powered by a supply that doesn't
  run out, such as a wall wart, the fire should rekindle for another ten minutes,
  in about 42 days (if I recall correctly), when the millis() time overflows 
  
  */

#include <FastLED.h>

#define LED_PIN     4
#define COLOR_ORDER GRB  //grb default
#define CHIPSET     WS2812//2811 dfault
#define NUM_LEDS    16

#define BRIGHTNESS  200 //200 default
#define FRAMES_PER_SECOND 8 //8 seems about the speed I remember of campfire


long timer = 600000;

bool gReverseDirection = false;

CRGB leds[NUM_LEDS];

void setup() {
  delay(3000); // in case you forgot to turn external power on, oops prevention
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.setBrightness( BRIGHTNESS );
  delay(100);

  while(millis() < timer)
  {
      Fire2012(); // run simulation frame
  
  FastLED.show(); // display this frame
  FastLED.delay(1000 / FRAMES_PER_SECOND);
  }
  delay(100);
}

void loop()
{ 
if (millis() > 600000 && millis() < 610000){
    fadeToBlackBy(leds, NUM_LEDS, 20);
   FastLED.show();
}

/*do nothing. In about two weeks the fire will rekindle when the millis() timer overflows*/
else 
{
}

}


#define COOLING 80//55
#define SPARKING 120 //120

void Fire2012()
{
  static byte heat[NUM_LEDS];

    for( int i = 0; i < NUM_LEDS; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS) + 2));
    }
    
    for( int k= NUM_LEDS - 1; k >= 2; k--) {
      heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
    }
      
    if( random8() < SPARKING ) {
      int y = random8(7);
      heat[y] = qadd8( heat[y], random8(160,255) );
    }

    for( int j = 0; j < NUM_LEDS; j++) {
      CRGB color = HeatColor( heat[j]);
      int pixelnumber;
      if( gReverseDirection ) {
        pixelnumber = (NUM_LEDS-1) - j;
      } else {
        pixelnumber = j;
      }
      leds[pixelnumber] = color;
    }
}

WOW! That's some good and interesting information!
Thanks! I looked at a few this morning (was offline yesterday) and those are some good ideas. I'll hang on to all of this information, to be sure.

For now, I do think that I should start with the Nano to program the chip, in part because everyone has pointed me to such good tutorials for that, so I'll start with the proverbial "baby steps" so to speak until I have a better - or, OK, some :wink: - idea of what I'm doing.

Thank you!
I'll look into "fastLED" and your script to understand what you did.
I'm not making a campfire exactly; I have some tiny (some 1:120 scale; some 1:100 scale) houses that I want to build. I've been adding "static" LEDs with no problem, but I've been trying to figure out how to make a small circuit, that I can attach to my own LEDs (specifically, pre-wire 0402 SMDs or, the largest, 0603) to simulate a fire in the fireplace(s).
I can now buy some pre-made ones but to get it looking like I want, I'd have to spend more than I'd spend even on a programmer PLUS the microcontrollers. Plus, I don't know that I'd be able to configure then physically or in terms of flicker rate.

I know it's about as far from "earth shaking" as a project can get, Heh! :wink:

Anyway, thank you for the information! It looks very applicable.
BTW, the video is amazing :wink:

Have you tried just using analogWrite() to get an effect like that? Maybe that's all you need for your application. From the IDE example sketches, this one written by Tom Igoe:

/*
  Mega analogWrite() test

  This sketch fades LEDs up and down one at a time on digital pins 2 through 13.
  This sketch was written for the Arduino Mega, and will not work on other boards.

  The circuit:
  - LEDs attached from pins 2 through 13 to ground.

  created 8 Feb 2009
  by Tom Igoe

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/AnalogWriteMega
*/

// These constants won't change. They're used to give names to the pins used:
const int lowestPin = 2;
const int highestPin = 13;


void setup() {
  // set pins 2 through 13 as outputs:
  for (int thisPin = lowestPin; thisPin <= highestPin; thisPin++) {
    pinMode(thisPin, OUTPUT);
  }
}

void loop() {
  // iterate over the pins:
  for (int thisPin = lowestPin; thisPin <= highestPin; thisPin++) {
    // fade the LED on thisPin from off to brightest:
    for (int brightness = 0; brightness < 255; brightness++) {
      analogWrite(thisPin, brightness);
      delay(2);
    }
    // fade the LED on thisPin from brightest to off:
    for (int brightness = 255; brightness >= 0; brightness--) {
      analogWrite(thisPin, brightness);
      delay(2);
    }
    // pause between LEDs:
    delay(100);
  }
}

Just another option.