WORKING FINAL DESIGN
Use my designs at your own risk they are with out warranty and I am not to be held responsible for any damages, injuries' or fire etc.... this is a DIY for educational purposes only disclaimer. Please make sure to DBL check your 78l05 pinout, if its backwards you will pass 11.5v to the "+5v vdd" of the attiny85 socket. That may or may not damage the 78l05 regardless its a pain to de-solder and turn around. PLease use a DMM digital multi meter and check all traces and connections and test the working voltages with a 12v psu seated into the screw terminal, before plugging in the attiny85, fans or any thing into the jumpers.
This zip file has working code for one output for the attiny85, I'm having some trouble getting the dual independent control working I'm not that great at coding. And there are other features that are not even implemented yet! if anyone is good at arduino coding please let me know. This file contains the final KICAD pcb artwork, my working GCODE file, and the attiny85 INO code. Things to be aware of. currently the code is only using A3-PIN#2 analog input, and D0-PIN#5 output to drive the fan(s). A2 input and d1 output are not setup and coded fully yet, there is code that has been commented out for anyone who knows what they are doing There is no phase correcting, or MAP() function to scale ranges of values as of yet. My kicad pcb artwork has the final corrections in it for anyone wanting to build my project, it also has all labels of all headers and connections. Please be aware my GCODE REQUIRES OR EXPECTS a 5mm rotary rasp for cnc PCB milling. These bits will mill the traces drill holes, mill larger holes and cut out the PCB board. FYI THEY ARE SLOW and do not ware out but break very easy if careless. My cnc machine spindle runs at 15k-rpm 50mm/min with these bits, sorry any faster and they break. The top of the PCB is work plane zero X0Y0Z0, which means my gcode z axis works in negative space or subtractive machining.
If anyone is able to help with the coding the overall working plan is this:
two independent pwm signals D1, D0 OUTPUT. with there own POT inputs A3, A2. D2 is laser activity input with a jumper for a switch to control manual on or auto activity. All outputs run at there set POT values when laser activity is detected and continues running at set speeds for 10 seconds after loss of input. If the value of the POT(s) is/are adjusted the device will run at the adjusted speed for 10 seconds after adjustments changes have settled/stopped with no laser activity input high. when the time out event happens the fan(s) should drop to a minimum rpm and compressor should turn off. A future desire would be to add serial intput with hand shaking for serial control of speed values with gcode if the motion controller supports it. Pin1 RST is tied to a button for reset, there is also a header on the board to make use of the last I/O if someone wants to add code for it.
PHP Code:
/*
* ATtiny85
* -------u-------
* RST - A0 - (D 5) --| 1 PB5 VCC 8 |-- +5V
* | |
* POT A3 - (D 3) --| 2 PB3 PB2 7 |-- (D 2) - A1 AUTO LASER INPUT/MANUAL INPUT
* | |
* POT A2 - (D 4) --| 3 PB4 PB1 6 |-- (D 1) - PWM --> Pump or air assist flow control
* | |
* Gnd ---| 4 GND PB0 5 |-- (D 0) - PWM --> Fan Blue wire
* -----------------
*/