# Piggy Bank with sound

**URL:** <https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599>\
**Category:** Uncategorized\
**Created:** [6 August 2024 04:28 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599 "2024-08-06T04:28:34Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel209871](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@Daniel209871](https://forum.core-electronics.com.au/u/Daniel209871)\
**Post date:** [6 August 2024 04:28 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/1 "2024-08-06T04:28:34Z")

</div>

Hi,

I’m looking to make a piggy bank that makes a sound when you put a coin in for a gift. I’ve got the sound module and speaker already but just wondering what the best way to trigger the module is. The obvious answer would be a limit/Microswitch but I can’t get it to work it’s quite inconsistent. I thought this may have been done before but couldn’t see anything via the search option. I’m open to any suggestions or ideas.

Thanks

Daniel

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [6 August 2024 04:42 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/2 "2024-08-06T04:42:36Z")

</div>

Hiya @Daniel209871

What is the size of your piggy bank?  
i.e. How much room do we have to put in a sensor?  
For instance, Is there any room inside the coin slit for a beam break sensor like this?

> **[IR Break Beam Sensor - 5mm LEDs](https://core-electronics.com.au/ir-break-beam-sensor-5mm-leds.html)**
>
> Infrared (IR) break-beam sensors are a simple way to detect motion. They work by having an emitter side that sends out a beam of human-invisible IR light, then a...

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/aaron/32/9861_2.png) [@Aaron](https://forum.core-electronics.com.au/u/Aaron)\
**Post date:** [6 August 2024 05:05 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/3 "2024-08-06T05:05:24Z")

</div>

Hi @Daniel209871,

Another version of the IR Break Beam sensor @Pixmusix shared could be an [IR object presence sensor.](https://core-electronics.com.au/line-sensor-adjustable-threshold.html)

I can also think of a few different ways of doing this as well that might start overcomplicating this involving different types of sensors but they’d likely be less reliable than a simple beam break.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [6 August 2024 05:07 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/4 "2024-08-06T05:07:38Z")

</div>

> [@Aaron](#):
>
> Another version of the IR Break Beam sensor @Pixmusix shared could be an [IR object presence sensor.](https://core-electronics.com.au/line-sensor-adjustable-threshold.html)

Oh this IR sensor is so cheap and cute! I love it. ❤

---

<div class="post-metadata">

**Author:** ![Jeff105671](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jeff105671/32/3729_2.png) [@Jeff105671](https://forum.core-electronics.com.au/u/Jeff105671)\
**Post date:** [6 August 2024 07:06 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/5 "2024-08-06T07:06:43Z")

</div>

This

> **[Gravity: Digital Shake Sensor](https://core-electronics.com.au/gravity-digital-shake-sensor.html)**
>
> Do you want to switch lights by just shaking your hand? However, you may don't want to use a complicated and costly triple axis accelerometer. This digital shake...

could be set up with a finely balanced tilting tray so it responds to the smallest coin.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [6 August 2024 09:20 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/6 "2024-08-06T09:20:31Z")

</div>

Couldn’t Dan get a sweet payday by just rolling the piggy down a hill? 🐖 🗻  
Can he set a max response?

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [6 August 2024 09:29 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/7 "2024-08-06T09:29:09Z")

</div>

Hi Pix

> [@Pixmusix](#):
>
> Oh this IR sensor is so cheap and cute! I love it.

Would an IR sensor detect coins??? I would not think a coin would have much in the way of IR to detect.  
Just a thought.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [6 August 2024 09:49 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/8 "2024-08-06T09:49:11Z")

</div>

I think it’s got an IR Led on the board and a sensor that looks fro the reflections off an object. Is that right @Aaron

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [6 August 2024 10:10 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/9 "2024-08-06T10:10:42Z")

</div>

Hi Pix  
Yes, that would probably explain it  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Daniel209871](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@Daniel209871](https://forum.core-electronics.com.au/u/Daniel209871)\
**Post date:** [6 August 2024 11:16 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/10 "2024-08-06T11:16:33Z")

</div>

Thanks for everyone’s help I’ve got some things to work with now and some great ideas.

Daniel

---

<div class="post-metadata">

**Author:** ![Michael99645](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael99645/32/11893_2.png) [@Michael99645](https://forum.core-electronics.com.au/u/Michael99645)\
**Post date:** [7 August 2024 10:39 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/11 "2024-08-07T10:39:52Z")

</div>

I have used this sort of thing in the past.

There are different size and shapes for the slot part.  
In short you power the “IR LED” then the coin would break the beam.

> **[GP1S094HCZ0F | DigiKey Electronics](https://www.digikey.com.au/en/products/detail/sharp-socle-technology/GP1S094HCZ0F/720400)**
>
> Order today, ships today. GP1S094HCZ0F – Optical Sensor Through-Beam 0.118" (3mm) Phototransistor PCB Mount from SHARP/Socle Technology. Pricing and Availability on millions of electronic components from Digi-Key Electronics.

You would need to shop around to find the best size/shape and beam location in the sensor to match your setup such that the coin would always break the beam.

---

<div class="post-metadata">

**Author:** ![Daniel209871](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@Daniel209871](https://forum.core-electronics.com.au/u/Daniel209871)\
**Post date:** [7 August 2024 11:39 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/12 "2024-08-07T11:39:22Z")

</div>

Hi Michael. Thanks for that. That option also seems feasible. But excuse poor understanding but would you just cut a slot in the bottom of the “ U piece” so the coin could go through?

Thanks

Daniel

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jack/32/9287_2.png) [@Jack](https://forum.core-electronics.com.au/u/Jack)\
**Post date:** [8 August 2024 00:52 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/13 "2024-08-08T00:52:47Z")

</div>

Hi Daniel,

> [@Daniel209871](#):
>
> would you just cut a slot in the bottom of the “ U piece” so the coin could go through?

That is certainly one option but that is also what is keeping the beam alligned with the detector.

> **[H22A1 | DigiKey Electronics](https://www.digikey.com.au/en/products/detail/isocom-components-2004-ltd/H22A1/5036870)**
>
> Order today, ships today. H22A1 – Optical Sensor Through-Beam 0.118" (3mm) Phototransistor Slotted, PC Pins from Isocom Components 2004 LTD. Pricing and Availability on millions of electronic components from Digi-Key Electronics.

This one is the same type of sensor with a slot a bit wider (0.2mm) than a $2 coin. With the tolerances on the drawing, it could end up on the smaller side.

If you’re searching through [DigiKey there are many different photointerrupters in stock](https://www.digikey.com.au/en/products/filter/optical-sensors/photointerrupters-slot-type-transistor-output/548?s=N4IgjCBcoLQExVAYygFwE4FcCmAaEA9lANogCsIAugL61A) and you can optimise your search with a sensing distance. Just check the datasheets to make sure that it isn’t too large to fit into your piggy bank.

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [8 August 2024 01:09 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/14 "2024-08-08T01:09:07Z")

</div>

Hi all,

Jumping on the IR photointerrupter bandwagon we also stock this one: [https://core-electronics.com.au/ir-break-beam-endstop-sensor.html](https://core-electronics.com.au/ir-break-beam-endstop-sensor.html)

Should be plenty enough for any coins!

Liam

---

<div class="post-metadata">

**Author:** ![Michael99645](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael99645/32/11893_2.png) [@Michael99645](https://forum.core-electronics.com.au/u/Michael99645)\
**Post date:** [8 August 2024 01:22 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/15 "2024-08-08T01:22:00Z")

</div>

there are a few ways and options, just need to ensure it works in your case.  
But in short it would mount sideways.  
Sorry for my very rough image…

But something like this… box with slot, Just under the slot (inside the box), you place the sensor (red) with the wires going back to the controller/sound board etc.  
then as the coin (orange) is dropped it cuts the senor/beam.

Note: The challenge is the size of the coin (slot) v the bit of the beam that needs to be cut; so checking actual specs will be important. e.g. you could have a small coin miss the beam cut while bigger ones work.

there are designs for the slot that can also deal with it.  
e.g. Coin drops onto a ramp, then “rolls” past the sensor.  
so maybe some cad work and a 3d print ?

So just some idea that may or may not work in your use case.

![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/5/594f565b3317d9dfb6c9fbc3b6597d8cea112597.png)

---

<div class="post-metadata">

**Author:** ![Daniel209871](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@Daniel209871](https://forum.core-electronics.com.au/u/Daniel209871)\
**Post date:** [8 August 2024 02:07 UTC](https://forum.core-electronics.com.au/t/piggy-bank-with-sound/20599/16 "2024-08-08T02:07:32Z")

</div>

Cheers everyone for their input. Super helpful. I’m pretty sure I should be able to sort something out with all this info
