loading

Donation boxes can be much more interesting and attractive when you combine them with electronics and a little bit of programming. This instructable will show you how to. As the name explains, making donation boxes interactive can help you gain much more attention and make people happy at the same time! Indeed, and awesome way to set up a charity and help the needed ones by installing it in shopping complexes and other public places (if a bigger version of the same is made). This was just a prototype to present the basic idea which when modified and used at a bigger level, can definitely help.

The following project uses an arduino for all it's processing. The RGB LEDs installed inside the box keep on flashing and changing colors which can attract much attention. When a person donates a coin, the ultrasonic sensor installed just on the box detects that and the servo present at the top waves 2-3 times with a 'Thank You' message displayed. This feature can surely bring a smile on the person's face who just donated that coin! Using only arduino and some other basic parts, you can make this project within 3-4 hours max. without the need of hunting the parts. Although a bigger version of the same would be much better, but that doesn't mean that this small one is useless. Even this one can be put at various places.

Here is a short video of the project:

For any doubts related to this instructable, you are free to ask it in the comment section below. Don't forget to follow and vote.

Subscribe to my YouTube channel here:

Step 1: Parts and Tools

The following parts and tools are required to make this project:

______________________

Parts/Materials:

  • 1x Arduino UNO or Nano (any other compatible would work)
  • 1x Servo motor (standard size)
  • 1x Ultrasonic sensor
  • 4x RGB LEDs
  • 1x Cardboard box (approx 6" x 6" x 6" or a shoe box)
  • Brown paper
  • Transparent sheet
  • Jumper wires
  • Perforated board
  • Male headers
  • Female headers
  • Rainbow wire

Tools:

  • Soldering iron
  • Solder wire
  • Hot glue gun
  • Paper glue
  • Wire cutter/stripper
  • Pliers

_____________________

Total cost of Parts/Materials: $20 (1200 INR)

Step 2: Make a Shield for Arduino

The very first step to start this build is to make a shield for arduino. As I do for all of my projects, making such a shield will greatly help you to make all the connections easy by use of jumper cables. This also eliminates the need of soldering everything up which can sometimes be time consuming. You can just plug in and out your arduino to be used in other projects at the same time. However, this won't be mandatory for UNO users.

For making the shield, just check for the number of pins on your arduino and solder the same number of female headers on a piece of perforated board. Check if your arduino fits in easily. Now solder male headers corresponding to each pin on your arduino. Add some extra headers 5v and Gnd pins which are more frequently used.

Step 3: Cover Your Box

Now moving a little away from electronics, here comes some craft work. You have to now cover your box with some colored paper. But before that, it can be sometimes difficult to find the correct box to suit your needs. If you want to make it just as a project, then the best way is to hunt for shoe boxes, courier boxes or you can even make one from some scrap cardboard. I used a camera box which was just the perfect one.

You can cover the box with any colored paper you want. For making it simple, I used plain brown paper as I don't have much experience and designing skills in art and craft. You can even add some patterns, decorations to make it look more attractive. As for mine, I simply took the measurements, cut the paper and covered all the sides of the box with it.

Step 4: Make the Front Side Transparent

A pretty interesting feature, this can make the box look much better and will also allow to add some LED lighting inside the box. So I chose to cut the front part and cover it with transparent sheet.

You just have leave some of the cardboard to the front side and cut the rest of it (dimensions depend on the size of your box). Cover the cut part with transparent sheet which should be tight and shouldn't sag.

Instead of that thin sheet, you can use acrylic/plexiglass or even ordinary glass to cover the front portion to make the project more permanent. I have no experience on working with glass so chose an easier option.

Step 5: Cut a Coin Slot

This one's very easy. You just have to cut a big coin slot for the coins to be donated inside. Simply cut out a rectangular part measuring about 1.4" x 0.3". It should be big enough for all types of coins to pass through.

Step 6: Mount and Connect the Servo

Now again coming to the electronics part, you have to now mount and connect the servo motor. The purpose of it was to wave whenever a person donated a coin to the box. The best option is to use a standard servo but as you don't have to lift a large weight, even micro servo would work. Also, attach a proper attachment to your servo before connecting it. I used a one sided rotating shaft for the purpose. Connect it to arduino as per the following:

  1. Vcc (red) of Servo to 5v of Arduino
  2. Gnd (black) of Servo to Gnd of Arduino
  3. Signal (yellow) of Servo to Arduino digital 3 (PWM)

Finally, mount the servo at the top using zip ties or hot glue. While mounting, you must take care that the attachment connected to the servo doesn't bang with the cardboard box while moving. In other words, check the angles before mounting it.

Step 7: Solder and Connect the RGB LEDs

Some RGB LEDs are added inside the cardboard box to glow permanently and flash when a coin is added. This makes the box look more cool and adds and awesome feature to it. The light, when glows becomes visible through the front, transparent part thus making the inner coins visible as well. Since one LED would be too dim, I used 4 of them.

First solder all the four LEDs to a piece of perfboard. Connect all the four terminals of each LED in parallel. Please note that the LED type used here is common cathode. Then, connect the LEDs to arduino as per the following:

  • Red pin to Arduino digital 9
  • Green pin to Arduino digital 10
  • Blue pin to Arduino digital 11
  • Cathode (gnd) to Arduino Gnd

Step 8: Connect the Ultrasonic Sensor

The most important component if this project, this ultrasonic sensor detects when a person donates a coin. Since it can detect distance, when your hand comes near the coin slot, the distances detected by the sensor becomes much less as compared to earlier when there was no obstacle in front of the sensor. For the particular project, we can say that someone donated something when the distance detected by this sensor becomes less than 4cm.

Please note that the sensor used here is NOT HC-SR04 type (the one with four pins). I have used a Ping ultrasonic sensor which has 3 pins connected instead of 4. You can also use the earlier one but only with some modifications in the code. The Ping type sensor can give you much accurate measurement at a faster reaction rate. Anyways, connect it as per the following:

  • Vcc of Sensor to Arduino 5v
  • Gnd of Sensor to Arduino Gnd
  • Signal of Sensor to Arduino Digital 6

Finally, mount the sensor at a distance of approx 2-3cm. Make sure that the sensor doesn't completely touch the base.

Step 9: Upload the Code

Now, upload the code given in the ino file below to your arduino. Be sure to set the correct board and serial port in your IDE before uploading.

<p>#include <Servo.h><br>Servo myServo;</p><p>const int pingPin = 6;
const int redPin = 9;
const int grnPin = 10;
const int bluPin = 11;</p><p>void setup() 
{
 pinMode(redPin, OUTPUT);
 pinMode(grnPin, OUTPUT);
 pinMode(bluPin, OUTPUT);
 myServo.attach(3);
 myServo.write(100); 
}</p><p>void loop()
{</p><p>  
  while(true)
 { 
  long duration, inches, cm;
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  
   if(cm <= 4 && cm >= 1)
   { break; }
   
   redtoyellow();
   
   
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  
   
   if(cm <= 4 && cm >= 1)
   { break; }
    
    
 yellowtogreen();
  
  
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  
   
   if(cm <= 4 && cm >= 1)
   { break; }
    
    greentocyan();
   
  
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  
   
   if(cm <= 4 && cm >= 1)
   { break; }
    
    
    cyantoblue();
 
 
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  
 
   if(cm <= 4 && cm >= 1)
   { break; } 
    
    
    bluetomagenta();
    
  
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  cm = microsecondsToCentimeters(duration);
  
   
   if(cm <= 4 && cm >= 1)
   { break; }
    
   magentatored();
 
 } 
 myServo.write(130);
 delay(500);
 myServo.write(70);
 delay(500);
 myServo.write(130);
 delay(500);
 myServo.write(70);
 delay(500);
 myServo.write(130);
 delay(500);
 myServo.write(100);
 delay(500);</p><p>}</p><p>long dist()
{
  long duration;
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  return duration / 29 / 2;
  
}</p><p>void redtoyellow()
{
  digitalWrite(redPin, LOW);
  digitalWrite(bluPin, HIGH);
  for(byte i=1; i<50; i++) {
    byte on  = i;
    byte off = 100-on;
    for( byte a=0; a<100; a++ ) {
      digitalWrite(grnPin, LOW);
      delayMicroseconds(on);
      digitalWrite(grnPin,HIGH);
      delayMicroseconds(off);
    }
  }
}</p><p>void yellowtogreen()
{
  digitalWrite(grnPin, LOW);
  digitalWrite(bluPin,HIGH);
for(byte i=1; i<50; i++) {
    byte on  = 100-i;
    byte off = i;
    for( byte a=0; a<100; a++ ) {
      digitalWrite(redPin, LOW);
      delayMicroseconds(on);
      digitalWrite(redPin, HIGH);
      delayMicroseconds(off);
    }
  }
}</p><p>void greentocyan()
{
  digitalWrite(grnPin, LOW);
  digitalWrite(redPin, HIGH);
  for(byte i=1; i<50; i++) {
    byte on  = i;
    byte off = 100-on;
    for( byte a=0; a<100; a++ ) {
      digitalWrite(bluPin, LOW);
      delayMicroseconds(on);
      digitalWrite(bluPin, HIGH);
      delayMicroseconds(off);
    }
  }
}</p><p>void cyantoblue()
{
  digitalWrite(bluPin, LOW);
  digitalWrite(redPin, HIGH);
for(byte i=1; i<50; i++) {
    byte on  = 100-i;
    byte off = i;
    for( byte a=0; a<100; a++ ) {
      digitalWrite(grnPin, LOW);
      delayMicroseconds(on);
      digitalWrite(grnPin,HIGH);
      delayMicroseconds(off);
    }
  }
}</p><p>void bluetomagenta()
{
  digitalWrite(bluPin, LOW);
  digitalWrite(grnPin,HIGH);
for(byte i=1; i<50; i++) {
    byte on  = i;
    byte off = 100-on;
    for( byte a=0; a<100; a++ ) {
      digitalWrite(redPin, LOW);
      delayMicroseconds(on);
      digitalWrite(redPin, HIGH);
      delayMicroseconds(off);
    }
  }
}</p><p>void magentatored()
{
  digitalWrite(redPin,LOW);
  digitalWrite(grnPin, HIGH);</p><p>  for(byte i=1; i<50; i++) {
    byte on  = 100-i;
    byte off = i;
    for( byte a=0; a<100; a++ ) {
      digitalWrite(bluPin, LOW);
      delayMicroseconds(on);
      digitalWrite(bluPin, HIGH);
      delayMicroseconds(off);
    }
  }
}</p><p>long microsecondsToCentimeters(long microseconds)
{
  return microseconds / 29 / 2;
}</p>

Step 10: Finishing Touches

Although not very necessary, it can be worthwhile to add some finishing touches to your project so as to give it a batter look. The only thing that must be added is a little message fixed to the servo which would wave along with the servo shaft. As for me, I used a simple 'Thank You' made using some white paper and stuck to the servo shaft.

Any other quotations, messages, boards and other modifications can be made as well. That depends upon you. Usually, adding some interesting quotes can give you more attention. I tried to keep mine as simple as possible.

Step 11: Powering the Project

The last step is to find a good power source to power your project. The best option is to use a USB charger and connect it straightaway to your arduino with a USB cable. This would eliminate the need of using a battery and would give you a non-exhausting power supply.

There are various other options as well, like using a 9v battery or a powerbank (as in the image above) to make the project portable. For the battery, connect the positive terminal to Arduino vcc whereas negative terminal to Arduino gnd. Powerbank simply needs to be connected with a USB cable.

Step 12: You're Done!

That's it for this instructable. Now you're finally done making your own interactive donation box! Since this project uses an Arduino, it's completely open-source which means you can make as many modifications as you want. You can even make a bigger version of the same and install it in exhibitions, shopping complex etc. This was just a way to present the basic idea which can be very interesting and beneficial when done on a large scale.

You are free to ask any questions if you want. Don't forget to vote, like, follow, comment and share it with your friends!

Please have a look to my new blog- SirKit Studio and do subscribe to my YouTube channel for some more 'simple' projects.

Thanks for watching :)

<p>Wow , Nice Project</p>
Great!
<p>Super cool! Love it.</p>
<p>Very cool. But it doesn't seem very secure...</p>
Agreed. But as already told, this was just a way to present the basic idea. Of course, when making it for real use, a cardboard box wouldn't work.
excellent. you may use slotted phototransistor. you may place it inside and it simplifies the code as well
<p>Very cool idea. But for your 2.0 you really should have a security feature. So if anyone try's to make off with the box, the box goes crazy with some kind of noise. For your 3.0 maybe something to track it if it does get pilfered. :)</p>
<p>Oh that's amazing! Thanks for the ideas, you can try them as well :)</p>
<p>Cool Donation Box. You could also add a really simple coin sorter to it: <a href="https://www.instructables.com/id/Self-sorting-Wooden-Coin-Bank/">https://www.instructables.com/id/Self-sorting-Wooden-Coin-Bank/</a></p>
<p>Nice idea! Could be added to v2...</p>
<p>And I thing you can use Grove - Distance Sensor to detect the coin, and put it inside box, may better. </p>
<p>Yaa, good idea for better looks but not sure if the sensor would react so fast to detect a falling coin...</p>
I think the answer is yes, I had user this sensor to detect the speed of a dc motor before, you know, dc motor is much faster than the coin.
Oh, maybe I have to try it then!
<p>This is a nice school project! I'll remember that for the next event :-)</p>
Thanks :)
<p>Good work!! Cool donation box in place of camera box :-P !! I will vote when it approves!!</p>
<p>Voted!!</p>
Thank you so much :)
<p>A funny and useful box. Am going to make one for my son :)</p>
<p>That's great :)</p>

About This Instructable

8,061views

140favorites

License:

Bio: I am Saiyam, currently studying in 12th standard and soon going to complete high school. I like to make random DIY projects whenever free. I ... More »
More by Saiyam:CleanSweep- the Floor Cleaning Robot! Grove Smart Plant Care Kit- Assembly Wireless Earphones To Bluetooth Speakers 
Add instructable to: