[HN Gopher] Learning basic electronics by building fireflies
       ___________________________________________________________________
        
       Learning basic electronics by building fireflies
        
       Author : signa11
       Score  : 146 points
       Date   : 2025-07-29 17:00 UTC (5 hours ago)
        
 (HTM) web link (a64.in)
 (TXT) w3m dump (a64.in)
        
       | Workaccount2 wrote:
       | The juxtaposition between the cleanliness of the software and the
       | absolute travesty of a schematic is jarring. But it still works!
       | 
       | I applaud the author for wading into analog electronics. Pretty
       | much everyone nowadays would just put a timer on a micro and be
       | done in 2 minutes. No fun in that. There is something to be said
       | about the minimal elegance of purely analog designs, and a
       | special rewarding feeling for wrangling electrons in their native
       | habit rather than their boxed up binary bins.
        
         | jabedude wrote:
         | I haven't touch anything like this in a good while, how cheap
         | could I get a simple Arduino style chip with a few gpio to
         | drive a yellow LED in 2025?
        
           | roboror wrote:
           | Like $2 if you're patient
        
           | alias_neo wrote:
           | You could grab any Atmega328p or similar DIL on eBay for a
           | couple of quid, maybe less in batches.
           | 
           | I've got dozens of them in my electronics drawers I don't
           | really use anymore since ESP32 dev boards are so cheap and
           | capable for home projects.
        
           | bombela wrote:
           | I have a bag of attiny13a that cost me $0.20 per chip. It is
           | fully self contained. Just add a very small capacitor, give
           | it from 2.8V to 5V. And then you program it the way you want.
           | You can even program and debug it via a single pin if you
           | wish.
           | 
           | At this cost for a hobbyist it's just hard to beat. It can be
           | anything you want it to be in a few lines of code.
           | 
           | I personally write Rust for it, not Arduino C++, but it would
           | work just the same.
        
             | Liftyee wrote:
             | What toolchain do you use to compile Rust for it? I have
             | about had enough of undebuggable random Arduino segfaults.
        
           | alnwlsn wrote:
           | For an "official" answer (programmable from Arduino IDE,
           | genuine new chips) you can get an ATTINY202 from DigiKey or
           | Mouser for $0.50 in qty. 1.
        
           | cluckindan wrote:
           | If you just need it to blink at some interval, get a NE555
           | for a dime.
           | 
           | Granted, you can almost get a microcontroller for that
           | price...
        
           | bluescrn wrote:
           | Search YouTube for '10 cent microcontroller' to learn about
           | the absolute cheapest chips.
           | 
           | For PS3.50 you can get an ESP32 module with WiFi and
           | Bluetooth (e.g. https://thepihut.com/products/esp32-c3-mini-
           | development-boar...)
           | 
           | (A regular Arduino board might still be the best choice if
           | you're just learning/tinkering though)
        
         | diggan wrote:
         | > Pretty much everyone nowadays
         | 
         | I think it depends on the ecosystem. It's true much of the
         | "maker" community tends to embrace whatever solution is the
         | cheapest, fastest and easiest to get something working out the
         | door, but on the other hand, the DIY synth community tends to
         | be the opposite (in my experience at least), favoring simple
         | schematics and "back to basics" building, even sometimes going
         | as far as trying to skip any sort of prebuilt ICs.
        
       | stevevets wrote:
       | "That is not a hair question."
        
       | hobs wrote:
       | As a electronics tinkerer just getting started I loved that
       | moment when I first opened up some analog device and just ...
       | recognized everything. A great little writeup!
        
       | supportengineer wrote:
       | I was programming well before I was learned anything about analog
       | electronic circuits. I had the Radio Shack 160-in-one like anyone
       | else and I could follow the directions but I didn't understand
       | what was happening because I was thinking of it as an orderly
       | pipeline, almost like a conveyor belt, where each component was
       | doing a task. It wasn't until college when we studied LRC
       | circuits in physics that it finally clicked for me. What the
       | individual components do by themselves is not very interesting
       | but it's their behavior when you put them together, that the
       | magic happens. Essentially you are creating a vibration, a wave.
       | You are creating a resonating system. Your waves can be in
       | various dimensions like current and voltage. You can adjust the
       | magnitude and frequency of the waves to perform useful tasks.
        
         | ourmandave wrote:
         | I begged and begged, but never got the 160-in-one. =\
         | 
         | I did put together a lot of Radio Shack project-in-a-boxes
         | though.
        
         | AlanYx wrote:
         | Do you happen to know of any good modern alternatives to those
         | vintage Radio Shack kits?
        
           | macintux wrote:
           | You might check out this store that opened recently in rural
           | Indiana.
           | 
           | https://tekshack.com/collections/educational
        
           | supportengineer wrote:
           | Yes there was one called Snap Circuits that I got for my
           | kids.
        
           | morninglight wrote:
           | I cannot say enough good things about this store. I've been a
           | customer for many years and have never been disappointed. You
           | can find things cheaper online, but for a kid without a
           | credit card these guys are great. They even have a brick and
           | mortar store for local pickup.
           | 
           | https://www.electronics123.com/
           | 
           | https://www.electronics123.com/contactus
        
         | nerdsniper wrote:
         | I had RadioShack's "ScienceFair"-brand (co-branded with
         | RadioShack) "Advanced Electronics Lab - 300 projects" kit when
         | I was very young. https://www.ebay.com/p/2254341989
         | 
         | I just found it again yesterday at a _very_ old-school
         | electronics shop. The kind of delightful place packed wall-to-
         | wall  & floor-to-ceiling with stuff where each category (test
         | equipment, passive & active components, motors, motor drivers,
         | audio, video, hobby-everything) is either super well organized
         | (passive "jellybean" components) or a giant pile of eclectic
         | offerings stretching across 40 years of technological history
         | (test equipment).
         | 
         | I bought it for nostalgia, and I might fix it up or even
         | upgrade it to give to my niece when she's old enough. But
         | looking through it confirmed something I'd long suspected:
         | 
         | 1) Things like LRC circuits don't make sense without an
         | oscilloscope. I have one now but REALLY wish I had one as a
         | kid, even a crazy-cheap incredibly low quality one would have
         | been amazing.
         | 
         | 2) The book was VERY poorly written, seemed rushed and
         | minimally thoughtful - there was no real explanation of
         | fundamentals that could be used to drive creativity and
         | exploration. I wish I'd had a book which explained concepts
         | better. I didn't start understanding electronics in any
         | interesting way until I took calculus-based electromagnetic
         | physics in college.
         | 
         | Using the kit was mainly fun for me to blow up old-school red
         | LED's. It gave me familiarity with electronics schematic
         | symbols, breadboards, and some very basic tinkering. That young
         | childhood familiarity made me much more comfortable around
         | electrical pursuits throughout my life.
        
       | BashiBazouk wrote:
       | My kid is about to learn a bit of electronics as I plan to
       | replace some PS5 joysticks with TMR replacements. Cracking open
       | without destroying, documenting dissemble so we know where
       | everything goes back and quite a bit of de-soldering, re-
       | soldering. Should be interesting...
       | 
       | I remember in high school signing up for this electronics stuff.
       | I was just learning what a resistor was and a few engineer kids
       | over the two semesters bought and built an original Apple I kit.
       | Ah, growing up in the silicon valley...
        
       | xixixao wrote:
       | How small could you make this? Could you (maybe not with diy
       | tools) make it the size of a firefly?
        
         | bombela wrote:
         | The size of a button cell if you have the patience to solder
         | SMT parts, or make PCBs (at home or ordered). You can also
         | purchase breakout board PCBs designed to adapt SMT (surface
         | mount) chips to DIP (legged parts). You can quite easily use
         | them to solder SMTs on it, cutting traces and bridging others
         | with solder to make your own circuit.
        
         | alnwlsn wrote:
         | Much smaller. Definitely smaller than the LED itself.
         | 
         | https://hackaday.com/2025/03/19/worlds-smallest-blinky-now-e...
        
       | behnamoh wrote:
       | I hold a BSc in electrical engineering and even I still don't
       | fully understand how circuits work, especially the ones that
       | involve transistors. I tried various mental models to think about
       | the "flow" of current/electrons, but nothing works 100% of the
       | time. Maybe that's just how my brain works: I like _algorithmic_
       | thinking (A - B - C) as opposed to holding the entire circuit in
       | my mind and solving for V or I.
        
         | alias_neo wrote:
         | I suppose the BEng in Electronic Engineering I did is more in
         | line with this sort of thing. I did Electrical Engineering
         | (BEng) too but that was more power and control, motors, etc, it
         | didn't really crossover much into this territory.
        
         | blackguardx wrote:
         | I have a B.S. and M.S in EE. In undergrad, I took a class where
         | we had to solve a different problem using a new analog circuit
         | each week. At first, we could only use BJTs, resistors, and
         | capacitors. Eventually, we made 555 timers from discrete
         | transistors and "unlocked" that IC for future use. At some
         | point we were allowed to use opamps and other ICs as well.
         | 
         | This class was the hardest class I have ever taken in my life
         | but it really gave me an intuitive understanding of analog
         | electronics that I still have 20 years later.
         | 
         | I don't there there is any quick substitute for just putting in
         | the work. All these posts about AI learning are the same. The
         | magic isn't AI, but the motivation to learn. The AI might help
         | some folks get more excited about the process, though.
        
       | bee_rider wrote:
       | Fireflies flash in response to lights. I wonder if a
       | photoresistor sensitive enough to respond to his "firefly" can be
       | found. Then he could rig it up so his fireflies communicate with
       | each other. And maybe real fireflies as well.
       | 
       | It would have to be pretty danged sensitive I guess.
       | 
       | Extra points if the circuit can be rigged up to respond to
       | changes in brightness, so that it doesn't constantly trigger in
       | daylight....
        
         | convolvatron wrote:
         | I did an art piece at the San Francisco insect zoo, and each
         | firefly has a photodiode. the piece is all mounted in a fairly
         | dark area with some filters over the windows for the bugs. they
         | can see each other blink well enough.
        
       | yojo wrote:
       | Only tangentially related to the enthusiastic circuit hacking:
       | the reason the author stopped seeing living fireflies may be the
       | drastic, worldwide decline in insect populations, with biomass
       | declining in the range of 2-10%/year[0].
       | 
       | https://en.m.wikipedia.org/wiki/Decline_in_insect_population...
        
         | yapyap wrote:
         | jesus christ
        
       | korse wrote:
       | Congratulations, you just independently discovered BEAM robotics.
        
       | alias_neo wrote:
       | This takes me back. I remember learning all of this in high
       | school, some decades ago now.
       | 
       | I distinctly remember the first time I hooked up a 555 timer,
       | then it was decade counters, 741 op amps, logic gates and such,
       | then learning the resistor colour codes and blowing up
       | electrolytic capacitors on the bench supplies for fun.
       | 
       | For my 6th form Electronics project I built an 8-bit ADC,
       | parallel to serial converter, then serial back to parallel and an
       | 8-bit DAC as output all from discreet components and logic ICs.
       | 
       | The first half (input stage) was enough for the top grade, but I
       | enjoyed it so much I spent most of my lunch times in the lab
       | building more and more onto it.
       | 
       | I can feel that joy in OPs post.
       | 
       | I later went on to do my degree in Electronic Engineering.
       | 
       | Thanks for that piece of nostalgia and sharing the fun with us
       | with such a wholesome project!
        
       | stared wrote:
       | > I love fireflies. But in recent years, they stopped coming for
       | reasons I don't know. No tiny, glowing dots in the dark like they
       | used to. I miss them more than I expected.
       | 
       | Light pollution, and even more: pesticides.
       | 
       | Population of all insects fall dramatically.
       | 
       | "Three-quarters of flying insects in nature reserves across
       | Germany have vanished in 25 years" -
       | https://www.theguardian.com/environment/2017/oct/18/warning-...
        
         | SAI_Peregrinus wrote:
         | Also people removing fallen leaves. They lay their eggs in leaf
         | litter, if there's no leaf litter there won't be any fireflies
         | looking to mate.
        
       | octaane wrote:
       | As an aside, the disappearance of insects is noticeable
       | elsewhere. I'm a big fishing guy, have been my whole life. Many
       | old-timers I know have commented on the lack of insects.
       | 
       | We've all noticed that certain flies and lures have stopped
       | working, or at least, have significantly reduced efficacy. We
       | think it's because for at least several generations (fish have
       | short lifespans), they haven't been exposed to those insects.
        
         | somerandomdude2 wrote:
         | I've heard that too. But, from my experience, it's mostly
         | insecticides: people want mosquito-free and flea-free (and
         | ants, roaches etc) yards, and spray/spread poison that kills
         | them. Unfortunately, it kills everything. I cancelled my yard
         | service and noticed that birds started coming back, chasing the
         | food supply. Butterflies cover my lantana, and I see fireflies
         | at night.
        
       ___________________________________________________________________
       (page generated 2025-07-29 23:00 UTC)