1

So - i started a project at my civil-service. I want to fill a old snack-machine with things we need in the ambulance (bandages, cool-packs, etc.)

In order to get the current amount of everything without counting everything all these things should be stored in the snack-machine. The Arduino should be attached to the signal wires of the machine. If a signal is firing (when a button is pressed) the microcontroller should decrease the current amount of the item in the connected database.. so it is easy to see if some product is running low.

The machine itself works with AC. now the problem: I'm not that professional with microcontrollers/hardware and this is my first big project.

If the Arduino is connected between the motherboard of the machine and the buttons the Arduino won't interrupt when something is pressed. I attached a picture of the circuit. (The only thing what's not on the picture are resistors between arduino and the buttons). The voltage on the wires is about 7.5-8 Volts alternative current. enter image description here

4
  • So, your idea is to count the number of times that an item has been released, and use that to calculate the number of items left in the machine? This does not seem very foolproof. Is the database updated in real time? – MichaelT Dec 27 '18 at 10:11
  • 2
    7.8V AC connected to arduino ... that doesn't seem safe – Jaromanda X Dec 27 '18 at 10:45
  • 2
    I think you might get a problem with checking the button matrix. A matrix is typically checked by giving a HIGH consecutively to each row and checking the states of the columns. So the machine will drive some of the lines HIGH in it's own pace and you would have to synchronize to that, so that you don't disturb it, and only read the machines output voltage (not generating your own). It would also be possible to intercept the lines to the matrix and activating the corresponding lines on the machine with the Arduino, but I think you would have to use more external parts for that. – chrisl Dec 27 '18 at 11:00
  • 1
    Even if you solve somehow the multiplexed keyboard input pointed by @chrisl still somebody can push the a key multiple times while dispensing an item counting as fake dispenses. Reliable reading of the multiplexed keyboard is tricky even for an experienced programmer, you need a different approach, I would think of lever switches or optos on the dispensing mech. Can you post a picture of the dispensing mechanism? – Dorian Dec 27 '18 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.