anetC4K
Posts: 7
Joined: Tue May 09, 2023 5:05 pm

confetti canon + fan

Sun Oct 29, 2023 5:31 pm

Hi all,

I'm researching how to create a class for my students (6-8th graders) to create a simple confetti canon device using found parts. The idea is to have a button to trigger the thing, which turns on a fan. Then a servo opens and closes the cover on the confetti container letting out some confetti which the fan blows all over. (Yup the janitorial folks will hate us!)

We will be writing Python code and using Pi4s. Wiring up and running a button and servo is straightforward.

The question I have is where to find a fan that can be controlled by the code? All I've been able to find are the fans for cooling the Pi which only has power and ground wires and appear to be temperature controllable. That won't work for this - at least I don't think it will. Is there such a thing as a fan with a data wire?

If anyone has a pointer or some code, please send it along.

Annette
Coding for Kids, Montana

ame
Posts: 8704
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: confetti canon + fan

Sun Oct 29, 2023 7:48 pm

You could drive a relay or a MOSFET with the GPIO pin. Then use the relay or MOSFET to drive the fan.

Here's an example, with a schematic and code:
https://github.com/cnaslain/pwm_mosfet_GPIO_17

It's a common technique, so there are many more examples out there. Find one that matches your expectations and have a go. You might want to use a12v fan for more air power.

PWM (with a MOSFET) is a great way to vary the fan speed, but not strictly necessary here I think. If you turn the GPIO on or off it will turn the fan fully on or off. If you can't find any non-PWM examples then just set PWM to 100% for on, and 0% for off.

With a relay you basically get on or off as your two choices.
Oh no, not again.

ame
Posts: 8704
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: confetti canon + fan

Sun Oct 29, 2023 7:49 pm

Also,

* cannon
Oh no, not again.

anetC4K
Posts: 7
Joined: Tue May 09, 2023 5:05 pm

Re: confetti canon + fan

Sun Oct 29, 2023 8:47 pm

Thank you! This is very helpful. I will see what I can get running. I like the idea of just turning the GPIO pin on and off. And I was going to order some MOSFETs for related project to power LED light strips.

And maybe next time, I'll learn to spell cannon? Grin.

Annette

User avatar
B.Goode
Posts: 16238
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: confetti canon + fan

Sat Nov 25, 2023 6:07 pm

If you are resuming your interest in this topic you might like to see this RPi News Blog post - https://www.raspberrypi.com/news/confet ... magpi-136/
Beware of the Leopard

anetC4K
Posts: 7
Joined: Tue May 09, 2023 5:05 pm

Re: confetti canon + fan

Thu Nov 30, 2023 5:28 pm

Hi,

I am now attempting to get the fan to work using a MOSFET. I did see that post but we do not have access to 3D printed parts at this time. Maybe in the future. Right now my goal is to get the fan to the point I can turn it on and off. I have most of the parts - what I need is some straightforward python code. Your prior link is very helpful....

Annette

anetC4K
Posts: 7
Joined: Tue May 09, 2023 5:05 pm

Re: confetti canon + fan

Fri Dec 01, 2023 10:00 pm

A questions of resistors. When I review the schematic in the link (https://github.com/cnaslain/pwm_mosfet_GPIO_17), I have most of the parts in the starter kit we are using for the class. What I do not have are 440 ohm resistors. The kit only has 224 ohm resistors. Would there be a way to use these instead of the 440 resistors? Rather not order yet more parts if I don't have to.

ame
Posts: 8704
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: confetti canon + fan

Fri Dec 01, 2023 10:30 pm

You could probably get away with the smaller resistor, but in order to be confident that you didn't make any changes then you can make use of the fact that resistors in series add up their values. So, two 224R resistors in series will be 448R, which is definitely close enough to the specified value to have no negative effect.

Incidentally "R" is a handy alternative for ohms, particularly on keyboards that can't type "Ω" or lazy people like me. When you get to kilohms and megohms you just write k and M.
Oh no, not again.

ame
Posts: 8704
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: confetti canon + fan

Sun Dec 03, 2023 12:45 am

What other resistor values are in your kit? Or can you link to the vendor's page and we can see what you have?
Oh no, not again.

User avatar
rpdom
Posts: 23326
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: confetti canon + fan

Sun Dec 03, 2023 7:53 am

anetC4K wrote:
Fri Dec 01, 2023 10:00 pm
The kit only has 224 ohm resistors.
224 Ohm is an unusual value for resistors, although not unheard of. Are you sure about that?

What colour codes are on the resistor?
Unreadable squiggle

ame
Posts: 8704
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: confetti canon + fan

Sun Dec 03, 2023 8:26 am

rpdom wrote:
Sun Dec 03, 2023 7:53 am
anetC4K wrote:
Fri Dec 01, 2023 10:00 pm
The kit only has 224 ohm resistors.
224 Ohm is an unusual value for resistors, although not unheard of. Are you sure about that?

What colour codes are on the resistor?
Eek! Yes, well, ahem.
Oh no, not again.

ame
Posts: 8704
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: confetti canon + fan

Sun Dec 03, 2023 8:31 am

I expect it's 220k.
Oh no, not again.

User avatar
DougieLawson
Posts: 42847
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: confetti canon + fan

Sun Dec 03, 2023 9:29 am

anetC4K wrote:
Fri Dec 01, 2023 10:00 pm
A questions of resistors. When I review the schematic in the link (https://github.com/cnaslain/pwm_mosfet_GPIO_17), I have most of the parts in the starter kit we are using for the class. What I do not have are 440 ohm resistors. The kit only has 224 ohm resistors. Would there be a way to use these instead of the 440 resistors? Rather not order yet more parts if I don't have to.
You can make 440 ohms from two 220 ohm resistors wired in series. Or 110 ohm with two in parallel.

If they're surface mount they aren't labelled with stripes. They have two digits for value and one digit that tells you the number of zeros to add to the number. So 220 means 22 plus 0 zeros (22ohms). 224 means 22 plus four zeros (220000 = 220kohms).
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Return to “Staffroom, classroom and projects”