Hi I am upgrading my Ikea PM1006 Particulate Matter Sensor.
I connected it so i directly read the values. Following the manual it does a update every 20 seconds. The sensor also has a seperated FAN. I want to turn on this fan when the when it is updating the value. If i read correct, i should use an automation for this. But i can’t seem to figure out how to do this. Who can help. Below the components in my config which i would like to like to eachother.
I dont see anything about it having a fan in the manual. You’re a liar!!!
Lol I’m Jk. Is it a 2 wire fan or 3 wires? I was looking for it in the manual to see if its 5v or can use 3.3v, how much current it uses and are you sure its not PWM too? These are meant to be used with esp/microcontroller’s right? It should be ok then.
Is the goal to turn the fan on and cool it right before a reading or is it to cool it after a reading?
Do you need a logic level converter too? Looks like the signal Out is 4.5v.
So, you dont have a current limiting resistor on the base of the transistor? Thats bad bad news, youll keep burning it out or worse, damage your esp board. The diode is something you need too.
You’ll also want to remove the update_interval: 20s from the pm1006 sensor.
Yes, the transistor for example can only handle a very small amount of current. The current limiting resistor does just that, it only allows X amount of current so you don’t burn out the transistor.
The diode or in this case, the flyback diode is used to prevent sudden voltage spikes from inductive loads when they are turned off. When you turn that fan off, it’s still spinning and can cause a voltage spike that will damage electronics.
The “component_update” only works for some components so, if it gives you a compile error let me know and we can go another route.
seeing how the data voltage is 4.5v you will need a logic shifter too. This just steps up/down voltage back and forth. 4.5v will come from the sensor and into the logic shifter which steps it down to a safe and usable 3.3v. UART data being sent to the sensor will go out the esp32 gpio at 3.3v, the logic shifter will bump it up to 5v and send it to the sensor.
Thanks so much!! for all your replies. they all make sense to me and totaly understand why i should add the resistor and diode. The diode i didn’t had laying around anymore and will order one. The resistor is in, and with your example for the code i saw that i already had something like that in place so only had to add the fan and component update in there and it is working! Cool, this topic can be closed very quickly. Many thanks!
My current ikea vindriktning ESPhome code (still in development):
Sorry, saw i did not replied yet. The project is still in the make. Sensors are working but are not accurate, so that needs some work. When ready will post an update. As of now it takes a lot of time and not sure it is worth it. It is a fun project and learning a lot on how to advanced use esphome