attiny85 with 12v pwm on led strip

Hi, I am considering to use attiny85 for my upcoming yet one of my very first project involving custom circuitry.

I am stumped with the fact that the attiny85 only operates between 2.7-5.5v while the digipots only mA max current.

I wanted to hook the attiny85 with the sound sensor then will detect the current reading from sound sensor, eventually will determine the led strip brightness. Think of it like a sound reactive led lights.

I've found an instructable to poorman's led buck converter but I wanted it to be simple. I thought of using mosfets/transistors but I don't want to generate unnecessary heat and power loss.

Using an uno or micro would be a waste as well since I only need about 2-4 pins for this small projects.

Basically I wanted to have attiny85 able to drive pwm up to 12v.

Please guide me

Most of that post does not make sense.

3.3volt or 5volt is normal for Arduino boards/processors. Where does the digipot fit in. What sound sensor (link). Sound sensors do not output current. They output an analogue (or digital) voltage. A 12volt LED strip does not need 12volt PWM. Common 12volt RBG strips are usually PWM-ed with three logic level mosfets. Again, we need a link to the strip you have. There are many different ones. Where does the buck converter fit in. Powering the Arduino? Who cares if you only use three pins of a $2 Nano.

Tell us what you want to do, and what parts you have available. Not how you think you should solve it. Leo..

Using a MOSFET driver is of course the way to do it, as you found out yourself already, because the ATtiny can't handle 12V let alone the current required to run an LED strip. A MOSFET used properly will not produce much if any heat.

Do note that most cheap sound sensors have a digital output, while it seems you're looking for an analog output.

I try my best on clarifying what I'm trying to do here.

I wanted to use the led strip in conjunction with sound sensor. If there are no sound, the led will not lit. If the max threshold of the sound sensor limit reached, 12v will be supplied. If in between, it will be either from 0 to 12v.

For this, I am also thinking of using a 18650 battery with charger module that can be found off of banggood.

What I also had in mind is that I want to have a switch where the switch will determine the mode of the led. State 1 is only on mode, state 2 is sound sensor mode

This actually an improved version of what I made last year which only powered by 8 AA Batteries and on/off switch. Total Power consumption is roughly 200-400 mAh.

The led strip I used is similar to this https://www.banggood.com/10M-SMD-3528-Waterproof-RGB-600-LED-Strip-Light-Controller-Cable-Connector-Adapter-DC12V-p-1088074.html?rmmds=buy

This whole idea is to upgrade my project even further

Sorry, my explanation is suck

sarf2k4: I wanted to use the led strip in conjunction with sound sensor. If there are no sound, the led will not lit. If the max threshold of the sound sensor limit reached, 12v will be supplied. If in between, it will be either from 0 to 12v.

Which sound sensor?

The led strip I used is similar to this [...] Sorry, my explanation is suck

Agreed... "Similar to" is meaningless if you're looking for suggestions, as it's not the same as what you really have. Difference may be negligible, may be big, may be catastrophic.

I think the generic sound sensor that has 4 pins, vcc, gnd, digital and analog. Was thinking whether or not if I'm able to use the sound sensor's analog output to drive the led without arduino? Of course, using mosfet.

Forgot to mention that I'm going to use white led colour.

sarf2k4: I think the generic sound sensor that has 4 pins, vcc, gnd, digital and analog.

Part number?

Was thinking whether or not if I'm able to use the sound sensor's analog output to drive the led without arduino? Of course, using mosfet.

Won't work. Mosfets that are not open completelyget very very hot and your analog signal has to be just the right levels to cover the linear part to begin with, so between Vgs(th) and the fully open voltage.

Was thinking either this

https://www.banggood.com/Sound-Sensor-Detection-Module-LM393-Chip-Electret-Microphone-p-929245.html?rmmds=search

or

https://www.banggood.com/Microphone-Voice-Sound-Sensor-Module-For-Arduino-p-76461.html?rmmds=search

Cheap sound sensors with LM393 are (loud) sound threshold detectors. The analogue part, if it has an analogue output (4 pins), sucks (not very sensitive). More expensive ones (Adafruit, Sparkfun) also include a mic preamp and envelope output. Leo..

Would you recommend the lm393, the 3 pins or the other 4 pins?

sarf2k4: Would you recommend the lm393, the 3 pins or the other 4 pins?

I think Wawa's post can be summarised to "neither".

Those sensors are fine if you want to flicker your LEDs in tune with the base, assuming the base is sufficiently loud compared to the rest of the noise coming out of your speakers.

If you want your LED strip to go brighter/dimmer with the sound, then you need a sensor with analogue output.
Or better, with an envelope (rectified/smoothed) output.
Leo…

It may be easier to tap directly into your amplifier, by the way.

But I still got to hook the sensor up with the arduino right? Was thinking of using the "range" function.

I never thought of tapping from an amp. I was thinking to make this light portable

Or both - add a second input, which can be connected to a line out of an amp, if available.

It’ll be quite easy to detect whether you have a signal there, if so use it, if not use the sound sensor (or add a switch that you can read with the ATtiny to set which input to use, or even have the switch connect the input you want, you don’t care much about signal quality anyway).

3 lighting modes... that is good one too.

  1. always on
  2. sound sensor
  3. from the line in

I will try once everything has arrived and ready. But I still kind of concerned from the line out of an audio jack. Is it okay to directly on to the attiny or do I have to assemble more components to protect the circuit?

I quick Google search tells me what I suspected already: you need some form of signal processing.

Suggested in an old thread on this forum are the LM3914, LM3915 & LM3916 chips, these are apparently designed to produce a 10-LED VU type signal from an audio signal. Using a bunch of resistors you can turn this into an analog signal (one resistor between A0 and GND, one from each output to the analog in, and you have 10 different voltage levels to detect - if that flickers too much add a bit of code that smooths the transition).

sarf2k4: If there are no sound, the led will not lit. If the max threshold of the sound sensor limit reached, 12v will be supplied. If in between, it will be either from 0 to 12v.

This is not PWM. You are wrong thinking that you'll control the LED brightness by altering voltage. How will the LEDs be powered?

Just checked some of those suggested, they will output 10 pins which will drive 10 leds. Can those somewhat be converted into a single channel acting like pwm so the led strip can be dimmed based on the LM chips?

An ATtiny could do that part just fine.

Using a bunch of resistors you'll be getting different voltages (how to connect exactly depends on how the chip works exactly), read that with an analog in pin, then use that to convert it to a PWM signal on another pin. The ATtiny could also take care of jumps, instead of the 10% jump in one go you do 10 1% steps a few ms apart.