Comments (12)
(Idea from comment: https://www.youtube.com/watch?v=Etr7uIL9spg&lc=UgxKTLrzPYfF4dLlNcR4AaABAg.9HHklQ8r4_v9HI7jTzobpe)
from pi-bell-slapper.
Going to try my luck with this soon. I have a solenoid, but forgot to order a second call bell since the first is still in continuous operation :)
from pi-bell-slapper.
A couple more things I've seen recently, for inspiration:
from pi-bell-slapper.
To provide the ~600mA current at 5V for the solenoid, I'll probably need to power it off the Pi's 5V rail instead of through GPIO directly, since according to this answer, the 3.3V rail can only drive ~50mA... more research required.
from pi-bell-slapper.
This circuit looks like a good guide: Pi 3 B+ 5v solenoid push-pull.
from pi-bell-slapper.
I'm also needing to design a new enclosure/case for the thing... was going to do some measurements and start building things up by hand... but it looks like @tenderlove already did some of that work for me: https://github.com/tenderlove/analog-terminal-bell/tree/master/case
I'm thinking of modifying that design to house everything below/inside the bell... if I can route the solenoid that way.
from pi-bell-slapper.
Some code:
import RPi.GPIO as GPIO
import time
# Use GPIO pin numbers instead of physical pin numbers.
GPIO.setmode(GPIO.BCM)
# Set GPIO pin 4 as the output.
GPIO.setup(4, GPIO.OUT)
# Set GPIO 4 high and then back low to ding the bell.
GPIO.output(4, GPIO.HIGH)
time.sleep(0.05)
GPIO.output(4, GPIO.LOW)
# Cleanup.
GPIO.cleanup()
Save that to a file like ding.py
and also make sure your user has permissions to control GPIO with sudo adduser pi gpio
and logging out and logging back in (else you'll get a warning RuntimeError: Not running on a RPi!
).
Then run:
python ding.py
This should light up GPIO pin 4, and cause a ding, using the circuit in this comment: #2 (comment)
from pi-bell-slapper.
It verks!
from pi-bell-slapper.
Just noting this for myself: For the Pi Zero W, it requires 32-bit Pi OS (since the CPU is not 64-bit capable), and it only works on 802.11b/g/n at 2.4 GHz (no 5 GHz networking). With that out of the way, I can get it tested and working now :)
from pi-bell-slapper.
Next step: Learning OpenSCAD...
Found Mastering OpenSCAD (paperback version here) after a mention by @rcarmo on Twitter.
from pi-bell-slapper.
Almost everything is perfect... but the USB port in the current version (above commit) is a hair off center to the right. Have to move it back left so larger USB cables fit through correctly.
Someday if I design a proper PCB / HAT, I can make the tolerances much slimmer. For now it works with a simple small hacked-together protoboard.
from pi-bell-slapper.
from pi-bell-slapper.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi-bell-slapper.