Im having trouble controlling relays for a automated bar project
Im attempting to follow the instructions on the website bellow
problems im facing
i can only seem to switch 4 relays of the 8 relay board
*i placed a switch instead of a doorbell switch that he used. But either its picking up emf of usb cable and reading that as the analogue input(which i most likely suspect) or i have loose connect. to save the code dumping website above has code
*i think im meant to connect the switch across AO and A1 but im not sure
sorry for the very dumb questions, first time ive gotten arduino out in 4 years bit rusty.,
thanks you
i can only seem to switch 4 relays of the 8 relay board
Please provide more details:
Do you mean you can only switch any 4 relays at the same time or that there are 4 specific relays on the board that don't switch, even individually?
dodgy688:
*i placed a switch instead of a doorbell switch that he used. But either its picking up emf of usb cable and reading that as the analogue input(which i most likely suspect) or i have loose connect. to save the code dumping website above has code
*i think im meant to connect the switch across AO and A1 but im not sure
That code is complete garbage. The author's use of analogRead() was pointless. To understand the correct way to handle a button, please study File > Examples > 02.Digital > DigitalInputPullup and the associated tutorial: https://www.arduino.cc/en/Tutorial/InputPullupSerial
Note also the use of delay() in that code to make the LEDs strobe will make it very unresponsive to button presses. You'll need to hold the button down for as much as 1000 ms before it will be registered. The proper way to handle this is to write non-blocking code using millis() instead of delay(). A basic demonstration of this is File > Examples > 02.Digital > BlinkWithoutDelay and the tutorial: https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
I would recommend looking for a higher quality barbot project to follow. It seems that people are now preferring to use "optics" over pumps, at least for the liquor. With an optic, the bottle sits upside down on a special valve that dispenses a precise amount of liquid when it's pressed. It might have troubles with something thick or with pulp like the pineapple juice used in that tutorial's drink so other dispensing methods could still be necessary for certain drink components. Not being a drinker, I'm not very knowledgeable on the topic.
I’m making a automated bar where I press a button and it mixes drinks together
I’m trying to get a switch to control 5 relays that will later control 5 pumps
I’m not sure about how to go about coding
So basically
Switch momenterally pushed
Relay 1 on (certain amount of time)
Relay 1 off
I basically need this for 5 different relays
If you have any leads for how to code it like tutorials or examples of coding
Would be awesome thank you
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
All the pipes and pumps have to be "food" quality to be biologically safe.
As suggested by @pert, an actuator pushing a standard spirit dispenser would be better for control and health factors.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
The one good thing I'll say about that tutorial is they used peristaltic pumps, which is a good choice as long as the tubing is food safe (there is no liquid contact with the actual pump mechanism). I'm more skeptical about that submersible pump.
Other barbot projects I've seen use compressed gas instead of pumps to dispense drink components. That's nice because there is nothing but tubing in contact with the liquid. Compressed gas is used with beer on tap and soda fountains. It does require that the drink containers be airtight and capable of handling the pressure.
Another flaw with that tutorial is the way the liquids all funnel into the Nalgene bottle before draining into the glass. If you wanted to make the bar bot capable of serving multiple drink options this would not be good because the residue from the prior drink will contaminate the next one. The machine in the tutorial is made to only serve a single drink but that's not as much fun as offering a menu of drinks.
For dispensing I'd suggest you look into peristaltic pumps. They're quite precise (volume is directly related to the run time), and again the drinks come in contact with only the tubes. They should have no problem with thicker liquids, provided the tubes are large enough.