I use a Flame sensor (connect to pin0) to detect the fire and turn the pin1 to 1 when the sensor is nearby a candle, pin1 is connected to a LED, when sensor nearby a candle, the voltage from pin1 is 3.298V and the LED light up. I replace the LED with a small motor, the motor cannot be turned on and voltage is only 0.026V, the small motor can be turned on with 3V.
Below please find the code
basic.forever(() => {
if (pins.analogReadPin(AnalogPin.P0) < 20) {
pins.digitalWritePin(DigitalPin.P1, 1)
} else {
pins.digitalWritePin(DigitalPin.P1, 0)
}
})
How can I turn on a motor when a flame sensor is closed to a fire?
Best regards,
Kelvin