7 ms·
Learning basic electronics by building fireflies
- Workaccount2 1y agoThe 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 1y agoI 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 1y agoLike $2 if you're patient
- alias_neo 1y agoYou 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 1y agoI 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 1y agoWhat toolchain do you use to compile Rust for it? I have about had enough of undebuggable random Arduino segfaults.
- bombela 1y agoThe main Rust compiler. https://doc.rust-lang.org/nightly/rustc/platform-support/avr-none.html https://doc.rust-lang.org/nightly/rustc/platform-support/avr...
- stavros 1y agoDo you know of any sort of tutorial for this? I'd love to have a play.
- bombela 1y agoI do not, sorry. You can read the datasheet of the chip learn everything about it. You can then search online for some implementation of firmware uploader/programmer like "avrdude". Those chips are very simple, all controlled by toggling bits and values in registers.
- stavros 1y agoI'll try that, thanks.
- alnwlsn 1y agoFor 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 1y agoIf 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…
- dgacmu 1y agoYou actually can: The Puya PY32 ranges from about $0.08 on up (well, $0.15 if you only want to buy 5, but the cheapest one is $0.0959 in qty 200 and $0.0676 in qty 5000+). ARM Cortex m0 in a 10-pin ESSOP-10 surface mount package: https://lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_PUYA-PY32F002AA15M6TU_C5292058.html?s_z=n_PY32 https://lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC... Kind of mind-blowing. 24mhz 32-bit computer for under a dime. But you'll learn more about the analog-ish world and not need to deal with SMD if you go the 555 route. And it'll save you power vs the astable monovibrator with NPN transistors.
- dccoolgai 1y ago555s are so much fun. It's bananas how much you can do with that chip and a few dirt-cheap resistors and capacitors. Make has a really nice little book where they walk you through some simple projects on a breadboard with 555s, transistors, etc. https://www.amazon.com/How-Use-Breadboard-Make-Handbook/dp/168045403X https://www.amazon.com/How-Use-Breadboard-Make-Handbook/dp/1...
- bluescrn 1y agoSearch YouTube for '10 cent microcontroller' to learn about the absolute cheapest chips. For £3.50 you can get an ESP32 module with WiFi and Bluetooth (e.g. https://thepihut.com/products/esp32-c3-mini-development-board 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)
- andoando 1y agoYou can get a bluetooth/wifi enabled microcontroller like a Pi Pico 2 for $5 or a full on computer running linux for $15 (Pi zero 2)
- the__alchemist 1y agoBuy any dev board that includes an LED. Nordic, ST, Espressif... doesn't matter for something like this.
- diggan 1y ago> 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.
- JKCalhoun 1y agoThis would include people building guitar pedals.
- btbuildem 1y agoHonestly, it's the easiest onramp for people coming from a software background. Analog circuits are HARD, but rewarding. And as you ramp up to various ICs, things start to ~~~ make sense ~~~ in a wonderful way. Oh, and also the battery life!
- JKCalhoun 1y agoYeah, for me, analog is the exciting domain — my undiscovered country. I have played with vacuum tubes as well and thoroughly enjoyed it. Transistors were, for some reason, seemingly unknowable to me. But I made a kind of "transistor playground" [1] based around Forrest Mims III book [2] and then enjoyed playing with them. [1] https://imgur.com/a/dChq4AZ https://imgur.com/a/dChq4AZ [2] https://archive.org/details/forrest-mims-basic-semiconductor-circuits https://archive.org/details/forrest-mims-basic-semiconductor... Edit: actually, I had forgotten it was a transistor logic playground for I made for creating logic gates with transistors. Based on another Forrest Mims book: https://archive.org/details/engineersmininot00mims https://archive.org/details/engineersmininot00mims
- zavec 1y agoThat looks awesome, nice work! Very clean.
- justaj 1y agoI still can't get over the fact that all electronics schematics is actually in reverse and everyone is still fine with that.
- the__alchemist 1y agoCould you explain? Most of what I work with seems non-directional, except in cases like Diodes and transistors.
- deleted 1y ago[deleted]
- stevevets 1y ago"That is not a hair question."
- hobs 1y agoAs 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 1y agoI 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 1y agoI 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 1y agoDo you happen to know of any good modern alternatives to those vintage Radio Shack kits?
- macintux 1y agoYou might check out this store that opened recently in rural Indiana. https://tekshack.com/collections/educational https://tekshack.com/collections/educational
- supportengineer 1y agoYes there was one called Snap Circuits that I got for my kids.
- mlekoszek 1y agoOh, I remember these. Those kits were a lot of fun.
- 1y ago
- BashiBazouk 1y agoMy 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 1y agoHow small could you make this? Could you (maybe not with diy tools) make it the size of a firefly?
- bombela 1y agoThe 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 1y agoMuch smaller. Definitely smaller than the LED itself. https://hackaday.com/2025/03/19/worlds-smallest-blinky-now-even-smaller/ https://hackaday.com/2025/03/19/worlds-smallest-blinky-now-e...
- polishdude20 1y agoI wonder if you could do some sort of RF harvesting to get the led to blink at like 0.25 hertz
- behnamoh 1y agoI 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 1y agoI 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 1y agoI 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.
- dqh 1y agoThis sounds incredible and makes me want to go through a similar learning process. I don’t suppose anyone could recommend a book or course along these lines?
- JKCalhoun 1y agoA lot of us started out putting together some of the circuits in Forrest Mims Radio Shack books [1]. He does a good job of explaining how they work as well. And then there is an amazing site with (thousands of ?) electronics hobbyist magazines archived [2]. If you want to start browsing, they often ran series in their issues along the lines of "getting started in electronics". Regardless, some awesome projects in there. But if you want to go back pre-transistor (ha ha) the U.S. Navy had a great series on learning electronics [3]. Def. analog. [1] https://archive.org/search?query=Forrest+Mims https://archive.org/search?query=Forrest+Mims [2] https://www.worldradiohistory.com/Popular-Electronics-Guide.htm https://www.worldradiohistory.com/Popular-Electronics-Guide.... [3] https://archive.org/details/basic-electronics-volumes-1-5-by-valkenburg-van.-z-lib.org https://archive.org/details/basic-electronics-volumes-1-5-by...
- bee_rider 1y agoFireflies 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 1y agoI 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.
- relwin 1y agoLe Dominoux do something similar, triggered off each other, and uses a 555: https://youtu.be/PQOjkuJtBfM?si=8J2taYoicQEtJJJB https://youtu.be/PQOjkuJtBfM?si=8J2taYoicQEtJJJB
- ethan_smith 1y agoThis is achievable with a simple photoresistor and transistor arrangement - real fireflies actually synchronize this way. Adding a CdS photocell in series with a resistor to the base of your existing trigger transistor would make the circuit flash in response to external light pulses while maintaining its autonomous oscillation.
- x______________ 1y agoI was thinking along the same lines, create artificial fireflies to attempt and lure others back into the neighborhood.. But then again, fireflies use their lights to attract mates, and I'm thinking now that their phosphorus-based communication might be more complex than just a randomly emitting diode. I can picture it now... "You're into WHAT?!? Nope, I'm out of here!"
- yojo 1y agoOnly 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_populations https://en.m.wikipedia.org/wiki/Decline_in_insect_population...
- yapyap 1y agojesus christ
- johnisgood 1y agoFunnily enough, I moved to another apartment which is right by the main road (the sound pollution is driving me crazy, not recommended), and now I have an insect problem. Every night I am fighting moths and dragonflies. Never had an issue in my previous apartment. Both are deep in the city, although the current one has more greenery nearby.
- korse 1y agoCongratulations, you just independently discovered BEAM robotics.
- alias_neo 1y agoThis 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 1y ago> 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-of-ecological-armageddon-after-dramatic-plunge-in-insect-numbers https://www.theguardian.com/environment/2017/oct/18/warning-...
- SAI_Peregrinus 1y agoAlso 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.
- BobbyTables2 1y agoI have memories of the front of the car being caked in bugs from night driving and long daytime trips. Doesn’t seem to happen anymore…
- rickydroll 1y agoAs I understand it, fireflies are vulnerable to lawn chemicals and light pollution. They spend something like 2 years as grubs and then a few weeks as adults above ground. Lawn/in-ground pesticides kill the grubs, and light pollution interferes with finding a mate.
- ubermonkey 1y ago30 years ago, when I moved to Houston, a 1910s-1920s residential area called the Heights was somewhat famous for its fireflies -- though longtime residents would tell you they were drastically diminished from what they'd been in the 60s or 70s. By 20 years ago, they were almost entirely gone.
- octaane 1y agoAs 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 1y agoI'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.
- Auracle 1y agoI live in Minnesota and the struggle is tough. Either my yard is completely unenjoyable for the family due to mosquitoes and deer flies some years or I kill 50 insects that I don’t want for every one that I do. I put up deer fly traps every year and that helps, but this year in particular has been awful for both them and mosquitoes. Luckily for the bugs my sprayer is broken and I haven’t had time to fix it. I deliberately avoid the place on our property where fireflies are, on the years that I do spray. We really need a better solution. Just to be clear, if we go outside right now we instantly have multiple deer flies trying to land on us and bite, which is only a distraction for the mosquitoes. Without swatting I’d probably get a mosquito bite a minute midday or maybe 5-10 a minute at 7pm.
- goda90 1y agoYou can target mosquitoes more directly with mosquito dunks. It's a block of dehydrated bacteria that produces a toxin believed to only impact the larva of mosquitoes, fungus gnats, and black flies. Basically you make sure all standing water in the area is drained or has a mosquito dunk in it. You can make buckets full of yard debris and water and a mosquito dunk to attract mosquitoes to lay their eggs that then get killed. You can also try to increase the number of predators. Create habitats for bats, dragonflies, mosquito larva eating fish, etc. I've found picaridin lotion to be much less annoying than DEET spray but still effective this year.
- bariumbitmap 1y agoThis post made me feel things. In Phillip K. Dick's "Do Androids Dream of Electric Sheep?", the inspiration for the movie Blade Runner, wild animals have died out due to the after-effects of war and most people can only afford electric animals as pets. Here the ingenious circuit design and debugging to make an electronic firefly is made all the more poignant by the fact that artificial lighting disrupts firefly reproduction and communication,[0][1] meaning that LED light pollution at night is one of the main reasons firefly populations are declining. [0] https://doi.org/10.1002/ece3.4557 https://doi.org/10.1002/ece3.4557 [1] https://doi.org/10.1098/rsos.220468 https://doi.org/10.1098/rsos.220468
- btbuildem 1y ago> so I searched the web and found tinkercad.com has a circuit simulator where you can drag and drop all the components and see if and how it works. It worked for simple circuits, but for mine, the astable multivibrator, it didn’t for some reason. I tried falstad.com/circuit; the same thing happened. It also didn’t work. I searched the web for the reason, and I’ve noticed that sometimes these simulators don’t work well for complex circuits. If anyone knows of a hobby-grade circuit design and simulation software (on macos! or online), I'd be so grateful to have it mentioned. I've tried kicad, diylc, fritzing, and a few other options, and nothing really "works". It's like the minds of people who created these are broken in a certain tragic way that just does not yield itself to making useable software. The holy grail for me would be something that allows to design the electronic, then spatial aspects of circuits -- from testing the functionality, to making the board (and bonus points for stripboard support!)
- 867-5309 1y ago> astable multivibrator come again?
- 01HNNWZ0MV43FF 1y agoAstable means that it keeping switching, like a clock signal, as opposed to a lightswitch which is bistable (will stay where it is in either position) https://en.wikipedia.org/wiki/Multivibrator https://en.wikipedia.org/wiki/Multivibrator
- iaaan 1y agoThe naive programmer in me wants to assume, "It can't possibly be that hard to simulate a circuit," and get to work on prototyping my own simulation engine but the fact that this apparently has not ben adequately solved yet gives me pause.
- fc417fc802 1y agoIt depends on what level of detail you want the simulation to have. Boolean logic is easy. Analog circuits operating in certain (very limited) domains are straightforward. But - noting that what follows is well out of the realm of my experience - in other domains you have to account for things like RF characteristics and quantum effects in the semiconductors. Imagine trying to simulate something that used water in tubes to implement logic, except it's analog logic and there's resonance and some of the joints start leaking when they exceed a certain pressure and etc.
- fsckboy 1y ago>I love fireflies. But in recent years, they stopped coming for reasons I don’t know. there were fireflies all over in my childhood, we played with them all the time. but I hadn't seen them in decades. Then one summer there there were... in the heart of New York City of all places. Crazy beautiful.
- ungreased0675 1y agoThis is why I miss Radio Shack. I live in a fairly large city and there’s nowhere local to buy electronic components.
- andreareina 1y agoI wonder how much of the simulators not working is due to these circuits taking advantage of parasitics. IIRC the original joule thief circuit doesn't have a capacitor despite one being required for boost circuits; physical components have stray resistance/inductance/capacitance that have real effects on the circuit.
- fatih-erikli-cg 1y ago[dead]
- penguin_booze 1y agoIf I wanted to restart my on-and-off interest in electronics, is there an online or a physical chain of stores from where I could buy basic components piece meal?
- sintezcs 1y agoI really loved that you started with a multivibrator scheme instead of arduino