Help with very simple 40Hz LED pulsing circuit - Page 1
Forum section: electronics / beginners

author: SimonF
author_rank: Contributor
timestamp: January 30, 2022, 07:21:54 pm
content: New to electronics. Trying to mod an LED bedside lamp so that it pulses at 40Hz and my dad can read by it. Apparently Light pulsed at 40Hz can help rid the brain of amyloid plaques that are linked to alzheimers (or however you spell that word). It would probably be less expensive and simpler to do this without an arduino, but I'm using an arduino pro mini because I know a little C++ coding and it's therefore easier for me.The lamp runs from mains (240V - I'm an Aussie) via a plug-in power adapter that converts it to 12V DC. The existing circuit is just a switch and 12 LEDs consisting of four parallel rows of three LEDs in series. There are no resistors or anything else.Here is the schematic I made to make it run at 40Hz (or so I thought):https://www.dropbox.com/s/ybkp6wtv1bizebk/40Hz%20LED%20lamp%20schematic.png?dl=0I tried various different resistor values. It worked for a normal LED when I was doing it on a breadboard and powering the whole thing from the arduino and a 5V power source, but it won't work when I wire it all into the lamp. Not sure what I'm doing wrong. Any help would be much appreciated.EDIT: should also mention that the last time I tried to get it going the transistor got pretty hot.

author: SimonF
author_rank: Contributor
timestamp: January 30, 2022, 09:21:30 pm
content: Yeah, that's why I'm trying to mod the lamp - hopefully help my dad.

author: mariush
author_rank: Super Contributor
timestamp: January 30, 2022, 09:49:04 pm
content: No diode between arduino ground and 12v ground.You can't have 12 leds in series powered from 12v.Each led has a forward voltage, for white leds that's around 2.8v...3.2v so if you have 12 leds in series, then you need a minimum voltage of around 3.2v x 12 = 38.4vWhat you can do is have groups of leds in parallel, and then connect those groups in series.And then you also need to limit the current going through the leds ... if you don't limit current, you'll blow the leds.So for example, your 12 leds could be arranged in 3 groups of 4 leds in parallel.The transistor has to be able to handle the current flowing through it.2N2222 (with 4 2's) seems to be rated for 800mA but the hFe is kinda small, I'm seeing 30...100 in various datasheets, so your base current would have to be bigger (hence smaller resistor on the base of transistor).The resistor on the base of the transistor is too big... you'll want around 1kOhm or less... see picturesSee also video below as a tutorial for how to use transistors.

author: ledtester
author_rank: Super Contributor
timestamp: January 30, 2022, 10:00:51 pm
content: I would first get a handle on the current draw of your LED strip when powered directly by 12V. Is it 50mA, 100mA, 200mA? That will help to size the base resistor.As it stands, your choice of a 5K base resistor is allowing less than 1mA of base current. I'd experiment with smaller base resistors -- e.g. 1K or even 500R. Note that an Arduino I/O pin is limited in the amount of current it can source -- it's something around 10-20mA.Alternatively, switch to using an N-channel MOSFET.Also, get the transistor working first without the Arduino involved, i.e. something like in this schematic:

author: Zero999
author_rank: Super Contributor
timestamp: January 30, 2022, 10:11:48 pm
content: Use a MOSFET, such as the IRL540, rather than a BJT. It doesn't require any gate current, which makes life easier.I'd just use the classic 555 timer, rather than an Ardunio, but it's a perfectly valid way to so it.

author: Brumby
author_rank: Unknown
timestamp: January 30, 2022, 10:37:08 pm
content: Yes. The 555 timer was justmadefor this sort of application and it can source/sink more current than an Arduino ... but I find the MOSFET direction much more appealing than the bipolar transistor, which makes that current capability somewhat moot.

author: Brumby
author_rank: Unknown
timestamp: January 30, 2022, 11:09:16 pm
content: Quote from: mariush on January 30, 2022, 09:49:04 pmHe doesn't. He has 4 parallel groups of 3 LEDs in seriesQuoteThat's another way of doing it.Both ways have the same issues with direct parallel connection of LEDs ... but we see a lot of that happening these days. If the characteristics of the LEDs in parallel are close enough, it will work.QuoteCurrent limiting is the best way to ensure longevity. The simplest way is to work out a suitable series resistor value. Determine the voltage drop you would want across such a resistor and the maximum current the LED array will safely operate at. Using Ohm's Law, you get a number. Consider this number theminimumresistance and choose a resistor which is higher in actual value.For example, if your calculation gives you 204 ohms, use a 220 ohm resistor. You can go higher with, say, 270 ohms which will reduce current (and therefore brightness) but will give you longer life of the LEDs.Needless to say, you will need to calculate the power being dissipated by this resistor, so that you use one that can handle it.As for power considerations ... make sure your LEDs stay cool and they will last a lot longer. If they get too hot to touch, then I would recommend a cooling solution, such as a heatsink.

author: ledtester
author_rank: Super Contributor
timestamp: January 30, 2022, 11:11:38 pm
content: Quote from: Labrat101 on January 30, 2022, 10:58:50 pmThere's been research which suggest 40 Hz may be beneficial to Alzheimer's patients. Just google40hz alzheimer light.

author: SimonF
author_rank: Contributor
timestamp: January 31, 2022, 01:08:11 am
content: Thanks to everyone for the informative responses. Have a couple of questions:It was suggested I lose the diode on the negative lead from the arduino to 12V ground. I'm most probably showing my ignorance with this question, but wouldn't that allow current to flow back into the arduino from the negative lead since the arduino is 5V and the lead it's connected to is 12V? Or will the current just prefer to go to 12V GND? Not sure I've got my head wrapped around what ground actually is.Would I be mistaken in thinking that a positive terminal consists of some material that has been deprived of electrons to some extent, which in turn causes it to attract electrons, and the ground is a source for those electrons? Perhaps even a super-saturated source of electrons?@Brumby - the unmodded lamp circuit had no resistors. Is it because the transistor is amplifying things a bit (as per the video posted on this thread) that I would need to limit the current after modding it?I did measure the current prior to trying to modify the lamp. It was drawing 74mA. The arduino (in a breadboard setup) pulsing a single LED with the same transistor as I would later use on the mod was drawing 27mA. The lamp power supply is only rated to output 150mA. I better check the entire system draw... So it's not working, as I mentioned, but consuming 44mA - running the arduino and some dissipated to heat maybe via the transistor? The transistor gets pretty hot. But the LEDs didn't light with either the original 5k or a 1k resistor. Thinking maybe in my bumbling I wrecked the transistor. It's all soldered and whatnot and since I don't have a dedicated lab space I'd have to unpack all my gear then pack it up again straight away to get back to what I'm otherwise doing, so I'll pull the transistor off a little later and test it.So if I do the figures on 74mA to find the resistor I should use on the base: (5 - 0.7)/0.002 = 2150ohms = 2.2kohms (rounding up as mariush suggested). I've already tried a 2k resistor, so I must have fried the transistor I guess. I'll try another later.I've got an assorted box of transistors, but no mosfets. Also don't have a 555 timer. I could order those, and probably will just so I can experiment and learn, but from Labrat101's post it sounds like I've got more research to do on the non-electronics end.@Labrat101 - everything I've read says lights flickering at 40Hz induce gamma waves in the brain, not Alpha Beta. I'll look further into it though.Thanks again to all responders. This seems like a really helpful community.

author: Manul
author_rank: Super Contributor
timestamp: January 31, 2022, 01:48:05 am
content: Quote from: Labrat101 on January 30, 2022, 11:15:58 pmThis 40Hz thing is obviously a huge topic and I don't pretend to know much about it, but I don't understand why sub-ppm precision is required? I have a hard time believing, that anything of biological nature could feel changes of something approaching ppm. Of course precision can not hurt, but I highly doubt, that it is so important, that a standard crystal oscillator is not enough.

author: SimonF
author_rank: Contributor
timestamp: January 31, 2022, 06:02:23 pm
content: Update:Pulled the transistor off, tested it, and it works. Pulled off a couple of LEDs then, thinking I must have fried them. They're fine. So I wired the old circuit back up to see if all the LEDs powered on with 12V. They did. Tried various different transistors, including the BC557 suggested in this thread. None worked properly, but I did get a feint glow, which compelled me to think I wasn't supplying enough current to the transistor base and I stepped down the resistance all the way to no resistor at all @5V. The glow was still feint.By this stage I was dispensing with the arduino (as suggested by ledtester) and using a lab power supply to provide the base with 5V. Still nothing. Anyone know what I'm still doing wrong?Think I'm going to have to order a mosfet as suggested. May as well get a 555 timer while I'm at it.

author: devinatkin
author_rank: Contributor
timestamp: February 03, 2022, 04:36:19 pm
content: Quote from: Manul on January 31, 2022, 01:48:05 amFrom spending time in research I'm going to guess that was the precision of the equipment they were working with, and given it's very annoying to gather this sort of data (Time consuming and expensive). It's likely that they simply read the value they were using with their equipment. That or it was calculated from some theoretical information about the molecules involved. But my first guess is that it was simply a case of, we used this lab equipment that worked with this precision so we're gonna give all our sig figs just to make sure that everybody is happy with us. If effectiveness peaks at a given frequency you aren't going to bother finding what the effectiveness is at a slightly different frequency when the only reason to find that is to spec down the device. It's medicine so people are typically happy paying hundreds of dollars.That being said given that spec OP should look at some good dedicated oscillators to try and get the accurate as I doubt the Arduino cuts mustard when it comes to ensuring it's oscillation frequency is that accurate. I gave digikey a quick look and one can get a 10ppb oscillator for like $90 on digikey. Paired with assembly line on the micro to ensure deterministic timing should make the timing good enough.

author: devinatkin
author_rank: Contributor
timestamp: February 03, 2022, 11:50:03 pm
content: Quote from: Labrat101 on February 03, 2022, 10:34:30 pmDo you by chance have any papers on it cause some of that isn't squaring with my understanding of the systems in play. I have no need to build such a system it just seems interesting. What is the theoretical mode of operation here that's causing the benefits. I pulled up a couple of papers on 40hz Alzheimer's lights and saw nothing on accuracy requirements. I also saw papers saying it didn't work, but that could very well be overturned research (They said it worked in mice but showed no benefits in humans). I'm sorry to discount your experience but what you've described doesn't square with what I found. There's a lot of room for placebo in this sort of treatment. Again I'd be happier to eat my words and I'll read any paper you send my way.I also wasn't able to find any papers in IEEE which again makes me suspect it's not genuine as anyone designing those sorts of devices would need the help of electrical engineers to obtain that level of precision. And assuming it came out of a research institution they'd be near guaranteed to publish there, even if it's not especially electrically novel.Edit by gnif: just fixed the quote tag

author: Manul
author_rank: Super Contributor
timestamp: February 04, 2022, 02:02:15 am
content: Quote from: Labrat101 on February 03, 2022, 10:34:30 pmTo me this level of precision looks really absurd. I'm quite sure, that all the precision is wasted after the signal enters the eyes and gets converted to nerve signals. Nerves and brain work on electrochemical process afterall, it is not high speed, it has plenty of jitter, noise and there is no super accurate timing reference involved. Like for example if you have musicaly trained hearing, you might feel the pitch shift by 0.1% (around 2 "cents"). Maybe someone extraodinary can distinguish less. But not 1ppm or 1ppb. I think even theoreticaly it is imposible, because nerve signal does not have a fixed speed, brain synapses fire somewhat chaotically by nature and so on. So every signal gets noise modulated and spreads, and that is our biological limit. Even brain size can literaly change depending on how much liquids you drink today. So where the precision can be? Thats my speculative take at least. I don't know if this 40Hz works or not. But if it works, arduino should be ok for that.

author: devinatkin
author_rank: Contributor
timestamp: February 04, 2022, 04:28:25 pm
content: Quote from: Manul on February 04, 2022, 02:02:15 amI could see a lot of precision being required if there's a chemical process occurring close to the eyes. I agree I don't thing the 1ppb precision is needed, but I could potentially see 1ppm if maybe it's a case of trying to hit some harmonic resonance of a molecule near the eyes. It's not really my field so I am guessing, but it fits with my limited understanding that a large degree of precision could be required to trigger some chemical reaction.

author: ledtester
author_rank: Super Contributor
timestamp: February 05, 2022, 08:23:10 pm
content: You should be able to modify either of these LED dimmers to alter the PWM frequency to 40 Hz:https://www.amazon.com/Hiletgo-DC12-24V-Controller-compatible-LEDwholesaler/dp/B073R7H52B/https://www.amazon.com/TronicsPros-12V-24V-Controller-Connector-Monochrome/dp/B016TLH9D4/Here's what the black one looks like inside:

author: langwadt
author_rank: Super Contributor
timestamp: February 05, 2022, 08:31:45 pm
content: Quote from: Labrat101 on January 31, 2022, 08:18:32 amand you of course wouldn't mind sharing those, so we can see it isn't just pseudo science nonsense

author: ledtester
author_rank: Super Contributor
timestamp: February 06, 2022, 04:38:47 am
content: Quote from: ledtester on February 05, 2022, 08:23:10 pmIn fact, this blog post discusses how to modify the black dimmer for 40 Hz operation:https://gammalighttherapy.com/blogs/gammalight/how-to-build-a-gamma-40-hz-led-dimmer