Code Monkey home page Code Monkey logo

Comments (12)

geerlingguy avatar geerlingguy commented on July 18, 2024 1

(Idea from comment: https://www.youtube.com/watch?v=Etr7uIL9spg&lc=UgxKTLrzPYfF4dLlNcR4AaABAg.9HHklQ8r4_v9HI7jTzobpe)

from pi-bell-slapper.

geerlingguy avatar geerlingguy commented on July 18, 2024

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.

geerlingguy avatar geerlingguy commented on July 18, 2024

A couple more things I've seen recently, for inspiration:

from pi-bell-slapper.

geerlingguy avatar geerlingguy commented on July 18, 2024

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.

geerlingguy avatar geerlingguy commented on July 18, 2024

This circuit looks like a good guide: Pi 3 B+ 5v solenoid push-pull.

Screen Shot 2021-06-13 at 5 07 22 PM

from pi-bell-slapper.

geerlingguy avatar geerlingguy commented on July 18, 2024

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

image

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.

geerlingguy avatar geerlingguy commented on July 18, 2024

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.

geerlingguy avatar geerlingguy commented on July 18, 2024

It verks!

IMG_4526

from pi-bell-slapper.

geerlingguy avatar geerlingguy commented on July 18, 2024

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.

geerlingguy avatar geerlingguy commented on July 18, 2024

Next step: Learning OpenSCAD...

Found Mastering OpenSCAD (paperback version here) after a mention by @rcarmo on Twitter.

from pi-bell-slapper.

geerlingguy avatar geerlingguy commented on July 18, 2024

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.

geerlingguy avatar geerlingguy commented on July 18, 2024

DSC01506

from pi-bell-slapper.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.