michelerubino96
Allowing Ads
I started thinking about this combination to have in just one device the multiple things that now i do with different ones to develop my film with a cpp2 jobo, for example: checking the water temperature for washing, opening the water, and start-stop the timers with the phone for every steps ( I usually do E6).
Hi everyone, Michael from Italy here,
first of all happy New Year to all forum friends,
As per the title, I’m developing a small project to (hopefully) improve my experience during the development process. I’ll briefly explain:
A brain box containing: 6 buttons, a rotary encoder, a 20x04 display, a buzzer, a relay, and a temperature probe.
The code allows setting the various steps with development times, washing, etc., using the encoder. With one button (reset) all values are cleared; with the up and down buttons you can move between the steps (I set 8 steps). When the start button is pressed, the program starts the cycle, always from the first step, and it can be stopped and restarted by pressing the same Start/Pause button.
During the program, two buttons manage the following functions:
Now, I developed the code with the help of ChatGPT (I admit it—otherwise I wouldn’t be honest), I designed the PCB, ran some tests, and everything seems to be working. Would anyone be willing to review the code and the electronic part (components, traces, resistors, and capacitors)?
- Temperature probe: connected to a T pipe after a thermostatic valve to regulate the temperature of the water coming out of a heater. While the button is pressed, the temperature appears on the display.
- Water button: while it is held down, it opens a solenoid valve to let thermostated water flow and fill tanks or chemical containers, and the word “water” appears on the display.
Obviously, if you’re interested, the project is open to everyone, and I can also send you the files to print the adhesive skin that I designed using InDesign.
The code is here:
pastebin.com/gYnG1PpC
If needed, I can also share the PCB file.
Thanks in advance to anyone who replies,
Michael
Hi,OK, so to clarify - presently, the valve really only toggles on/off on user input and it's not associated with process timing in any way?
I've not gone through your code in detail, but adding to the issues I mentioned above:
* Response of the rotary encoder is likely poor. I expect it easily misses clicks if it's turned too fast or too slow.
* The system won't respond to user input during execution of functions, including when e.g. the buzzer beeps, due to the locking nature of these functions.
* The state machine logic prevents the 'config' mode to be entered once the system as proceeded to another state; the project needs to be hardware reset to go back there.
There are numerous quirks and oddities in the code. As said before, it won't scale well and it's fundamentally flawed in various ways. Again, if it works for you, that's fine. Sometimes a solution doesn't have to be elegant to be effective. I'd personally find this timer unit to be awkward and irritating to use.
For the electronics - I wonder why you're not simply using the internal pullups on the microcontroller instead of pulling up all buttons externally. Your solution isn't wrong - it just involves a bunch of unnecessary components and makes routing unnecessarily complex. For each button you only really need a single signal line and GND; no external resistor, no VCC.
There's a mystery footprint J14 that doesn't seem to do anything. There appears to be two dangling nodes here as well:
View attachment 415066
I can't say much about the electronics otherwise lacking a proper schematic. A PCB layout only goes a limited way in giving insight into the switching logic. Overall, it's a fairly simple & straightforward project. The main question with projects like these is how the power supply is handled and whether there's proper handling of the discharge of a valve coil when it opens; this can result in spurious resets or even damaged components if it's not handled well. Problems in this area are very common.
I see no traces that I would find suitable to carry the supply power (and GND) for a typical water valve, so I assume only the switching logic is on this board and all power circuitry for the valve is handled externally. If this is not the case, the board is fundamentally flawed in its design, even though it may work.
Overall the routing is awkward, but may still work other than the oddities I indicated above.
Your project illustrates that it's feasible for someone without prior experience to build something that in principle functions as desired. That's a major leap from where we were 10-20 years ago and recent developments in AI have accelerated things massively. At the same time, it also demonstrates that a little help form AI is not a substitute from learning the basics of electronics and software engineering, and that doing a proper job still requires actual human learning and logic. Of course, this may (likely will) also change in years to come.
PS: as to the quality of the code of the software, in my experience Copilot (which AFAIK comes with a free-to-use plan if you have an MS Office license) produces code of much better quality than this.
super idea,uch luck with the project, and don't feel bad about using ChatGPT for help. Every inventor through history has always made use of the best tools available to them. By being open about it, you are doing the right thing.
Here's a good primer: https://arduinogetstarted.com/tutorials/arduino-rotary-encoder2) could you fix and explain me the logic of the encoder ?
The list would be too long...4) I agree with you that until now, human is necessary to develop something, and I would like to know better what you think is strange in the code, what could be fixed or changed.
5) You said "I'd personally find this timer unit to be awkward and irritating to use", what you would change if you were me ?
How do you manage the kickback of the solenoid?7) The power comes from 5A 12v, from this I create a separate pcb with a step down 5v to power the main board with arduino. So yes, this pcb is only for buttons and encoder, buzzer and probe wiring.
Here's a good primer: https://arduinogetstarted.com/tutorials/arduino-rotary-encoder
Here's an Arduino library that you could use: https://github.com/sigmdel/mdRotaryEncoder I've not used this particular one, but in the past I used the one by Buxton that this one is based on. It's robust.
The list would be too long...
Really, it would take me longer to explain than to just re-do the whole thing.
How do you manage the kickback of the solenoid?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?