I have been trying to create a completely automated watermelon/pumpkin farm, mainly with observer blocks. However all of my attempts so far have caused the harvesting to trigger an infinite redstone loop when the observer block detects the piston moving. Is there any good way to make an automated farm without commands that can infinitely harvest melons/pumpkins? (At least until storage runs out.)
If you wire the circuit without observers to make the melon a conductor, completing the redstone flow, then you can have a piston to crush it then go into a hopper minecart. Voila!
Example: BR R
When the melon grows: BRMR
Then the piston crushes the melon since the circuit is completed.
B: redstone block
RR XX OP S DD
R=Redstone dust, X=Solid Block, O=Observer (face pointing down), P=Piston (also facing down), S=Stem (Watermelon or Pumpkin), D=Dirt. This is a sideview, and is tileable.
This works under the premise that the vine itself updates when a watermelon/pumpkin is produced. To make it fully automatic, run a hopper minecart underneath the dirt to suck up drops, and place glass around the front so the drops don't fall somewhere they shouldn't.