Automatic Halloween Dispensor

Hi I am a Noob. I was doing some tutorials on arduino a couple of years ago. I followed a step by step tutorial on building an automatic Hallowen candy dispenser and used the code provided. The tutorial is here schematics are here and the code is here. After assembling it I can't get it to work. I think the issue maybe with the IR sensor but I am not sure how to troubleshoot or correct the problem (if that is even the problem). Wiring the switch was not clear but I tried wiring it both NO and NC. When I do hit the button 2 green lights on the IR sensor turn on but the stepper motor will not turn. Any help would be greatly appreciated. Last couple of years we have not handed out candy as we take our little ones out. We usually leave a bowl that is taken by some greedy kids. It would be great to give some out to all the kids this year.

Define "working" (do this, get that, et c.).

  • Check your power supply is providing the power, and is correctly connected.
  • Verify the stepper motors are connected to external power, and the control wire is connected to the Arduino.
  • Take a picture of your switch wiring.

Describe what you find next.

Thanks for your reply. When I say it is not working the turntable that is connected to the stepper motor does not move. There is power to the arduino and the components that have lights. I have connected stepper motor to the terminals that are connected to the pcb board. I have attached a picture of the switch wiring. The wiring is just temporary to test I will install terminals for the final installation.

[edit] The temporariness of the wires might be the problem

Oh, gosh... that switch... with POWER OFF, please, tighten those wires, and if you have a soldering iron (or friend who can solder), please solder the wires and protect the connections (heat shrink tubing, electrical tape, anything to keep wires from touching)

There should be a "stepper motor driver" on a PCB between the stepper motor and the Arduino. Can you identify the model number of the driver board (A4988, DRV8825, 28BYJ-48 TB6600)? The Arduino controls the driver, and the driver board controls the motor.

I will be placing heat shrink terminals on the finished product. They are just on the switch for testing. I will need a much longer wire on the finished product. They are not touching at the moment. The driver is a DRV8825.

This will sound strange, but, smell the DRV8825. Do you smell burnt, unbuttered, unsalted, popcorn?

If you can post a photo of the DRV8825 for a look how it is wired, that would be nice.

If you have the equipment (a power supply, a multimeter, a phillips screwdriver), perform this DRV8825 current limit setup:

I am don't smell anything from the driver. I have attached some images below of the wiring. I can try to get a multimeter to setup the current limit but my stepper motor's rating is 2.8 which is below the limit of the driver so not sure if that is the problem. Right now when I press the button the light of the ir sensor goes on but only when it is pressed. I don't think it is getting power unless the button is pressed. But I believe the stepper motor is supposed to run until the ir sensor senses something.



To verify the DRV8825 has an output.... usually the device under test is removed to not get any external interference... like loads or other bad devices shorting the outputs.

Try to observe the other devices. Does the motor hum (with your ear against the motor)?

I am not sure how it is supposed to operate. My guess is; the light indicates it "sees" the IR controller. Do you have reference material, like a link to a user manual?

I do not hear a hum. I will get a multimeter tomorrow to test. I am not able to find a manual for the IR sensor it is a Oiyagai TCRT5000. The video tutorial I followed shows a red light on at all times and a green light when it senses something. Seen at 25:38 [here].(https://youtu.be/NNeSOPg2tVk?t=1538) Mine turns on two green lights when the button is pressed or if I wire it to the NO terminal both lights stay on and off when the button is pressed. Neither changes when I wave something in front of it. I have tried a different sensor as well to rule it out but it behaves the same.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.