Announcement

Collapse
No announcement yet.

555 countdown timer design question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Re: 555 countdown timer design question

    btw, the ch341 adapters/chips are the best IMO, so tell your m8 to fuckoff!

    Comment


      Re: 555 countdown timer design question

      Originally posted by stj View Post
      isp needs a dedicated programmer - preferably a USBasp
      Dumb question, but if they don't work for the purpose of programming the arduino, what are the MISO/MOSI etc pins on the CH341 adapter for ?

      Caps ? Yeah I do (that would be 0.1uF right ? I suck at these )...I knew it from the start there's something fishy about that reset pin and even read something along those lines....

      Yes, no question about it - that CH341 "crap" helped me a lot in the past years, ever since I became more confident in using it and discovered it can do many other things besides programming SPI chips (which might actually answer my first question right there), so I too didn't agree with him.
      Wattevah...

      Comment


        Re: 555 countdown timer design question

        The schematic you posted also confirms I got the pinning right: TX to RX and vice versa, instead of RX to RX etc.
        Wattevah...

        Comment


          Re: 555 countdown timer design question

          Originally posted by Dannyx View Post
          Dumb question, but if they don't work for the purpose of programming the arduino, what are the MISO/MOSI etc pins on the CH341 adapter for ?
          oh, you have the black eeprom programmer?
          yes, that can do isp - if you use the right software.
          (or maybe avrdude does that hardware - never looked!)

          Comment


            Re: 555 countdown timer design question

            Well it's not really black, but sure It's this. Still, I wanted to keep it as simple as possible, so I'll push on with the serial method since ISP seems tough to achieve with the arduino IDE...or at least I THINK so.

            Back to that cap you asked about: should it go between RST and GND or something ? This programmer doesn't have a RST pin so I'm guessing that's the issue....
            Wattevah...

            Comment


              Re: 555 countdown timer design question

              on the serial adapter it goes to one of the handshake lines.
              your adapter is a bit lacking so you may need to solder to the chip pin.

              what's the exact part number of the chip on that adapter?
              Attached Files

              Comment


                Re: 555 countdown timer design question

                Originally posted by stj View Post
                on the serial adapter it goes to one of the handshake lines.
                your adapter is a bit lacking so you may need to solder to the chip pin.

                what's the exact part number of the chip on that adapter?
                I'll have a look...soldering won't be a problem, but can I continue to use it like normal like I have been so far even with that "cap hack" in place ? I don't want to "commit" the programmer solely for programming the arduino. I understand where you're going with this and I'm sure it'll eventually work, but I don't claim I 100% know what to do
                Wattevah...

                Comment


                  Re: 555 countdown timer design question

                  no answers till i know what chip it uses - some dont have the extra signals

                  Comment


                    Re: 555 countdown timer design question

                    It is a CH341A and here are some pics up close...damn I need a macro lens for my DSLR >_>
                    Attached Files
                    Wattevah...

                    Comment


                      Re: 555 countdown timer design question

                      you need to connect the 100n cap between your programmer pin20 which usefully appears to connect to the green socket, to the reset pin on the arduino.

                      Comment


                        Re: 555 countdown timer design question

                        btw, second picture, lower left.
                        5.1ohm resistor looks burned - did you try to power something big through the programmer, or short something??

                        Comment


                          Re: 555 countdown timer design question

                          Originally posted by stj View Post
                          btw, second picture, lower left.
                          5.1ohm resistor looks burned - did you try to power something big through the programmer, or short something??
                          Yes it does look like sh!t, I agree....never even noticed now that you mention it. No, I don't believe it got overloaded in any way and the resistor checks fine on my meter, so it's not faulty, plus the programmer works.

                          So I should place the cap between pin 20 and the reset pin ? Dumb question again, but what does the cap actually do ? Why not a piece of wire for instance ? Is a ceramic capacitor with 104 on it the right one ? I suck at these, I told you that
                          Last edited by Dannyx; 12-07-2017, 03:46 AM.
                          Wattevah...

                          Comment


                            Re: 555 countdown timer design question

                            Ok, works perfectly now: that cap between pin 20 and the reset pin did the trick. Big shoutout to STJ for the help...here's the setup: the gray piece of wire stuck into the ZIF socket corresponding to pin 20 of the CH341 on the bottom goes to the cap and then the other end of the cap has another piece of wire stuck into the breadboard on the RST pin. A CD ROM audio cable came in very handy for fashioning a "programming cable" because I could just insert it straight into the TX/RX male headers on the CH341 without having to run individual jumpers and make a mess of wires everywhere
                            Attached Files
                            Wattevah...

                            Comment


                              Re: 555 countdown timer design question

                              the real question is why you got this:
                              https://www.ebay.co.uk/itm/181894982202

                              instead of this:
                              https://www.ebay.co.uk/itm/191773759569
                              ?????
                              it's worth the extra 60c for the onboard programmer!

                              Comment


                                Re: 555 countdown timer design question

                                Space is at a premium and I'm trying to keep the whole project as small as possible, even if it meant a more complicated setup...there's actually something satisfying about having a functional mess of wires on your worktop
                                Wattevah...

                                Comment


                                  Re: 555 countdown timer design question

                                  Started messing around with the code and adapting it to my needs, but I'm only able to follow up to a point. Just a quick question: whenever an IF.....ELSE statement occurs, I'm having trouble following which "else" belongs to which "if", for instance here:

                                  if (digitalRead(button) == HIGH) {if (buttonActive == false) {buttonActive = true; buttonTimer = millis();}

                                  if ((millis() - buttonTimer > longPressTime) && (longPressActive == false)) {
                                  longPressActive = true;
                                  relayState = !relayState;
                                  digitalWrite(relayOUT, relayState);} }

                                  else {if (buttonActive == true) {if (longPressActive == true) {longPressActive = false;}

                                  else {LED2State = !LED2State; digitalWrite(LED2, LED2State);} buttonActive = false; } } }

                                  The two elseS at the bottom: which one belongs to which of the IF statements above...if that makes any sense ? Sorry for posting a wall of text

                                  My idea is the following: If the press is longer than "longPressTime", the code does one thing (turn on the light permanently) and if it's shorter, the Else should take over and do something else (in my case activate the 60s timer which I haven't implemented yet because I don't know where to drop it), so my guess is that the second Else belongs to the IF statement which checks the press time.
                                  Wattevah...

                                  Comment


                                    Re: 555 countdown timer design question

                                    the shortest distance is the first pair.
                                    if that makes sense.

                                    and the first "if" and last "else" are the second pair.

                                    Comment


                                      Re: 555 countdown timer design question

                                      Originally posted by stj View Post
                                      the shortest distance is the first pair.
                                      if that makes sense.

                                      and the first "if" and last "else" are the second pair.
                                      Ok, but I believe the very first IF, the one that checks the button being pressed, doesn't have an else, since it doesn't expect to do something else if the button ISN'T pressed.
                                      Wattevah...

                                      Comment


                                        Re: 555 countdown timer design question

                                        Originally posted by Dannyx View Post
                                        WAY overkill for what this thing needs to do
                                        But you've really not indicated exactly what it must do.

                                        What does "60 seconds" mean? 60 +/- 0.5 sec? 60.0000 sec? "About a minute"?

                                        Will it always be "60" or will you later decide that you'd like it to be 70? Or 120?

                                        Getting reliable, repeatable long delays from an RC delay is tricky. What are teh tolerances on your components? Operating temperature range? etc. Do you plan on "select at test" -- or, worse, adding a trim pot? -- to tweek the delay to the desired accuracy?

                                        While a < $1 MCU might seem like overkill, it can give you the benefit of a highly repeatable and alterable design. What if you want to inhibit the light from being retriggered within 37 seconds of extinguishing? What if you want to start your 60 second interval when a button is released instead of when it is initially depressed (or vice versa)? Or, if you want to adjust the duration of the period based on how long the button is held depressed? etc.

                                        Comment


                                          Re: 555 countdown timer design question

                                          Originally posted by eccerr0r View Post
                                          And another reason why microcontrollers are preferred, if you're using a crystal oscillator, it can be accurate down to parts per million, and even using the onboard oscillators in some even newer microcontrollers they have errors of only 1% or so. Using 5% resistors and +80-20% electrolytics, know knows what your real time constant will be
                                          You don't need a crystal (adds cost). Use the AC mains as your timebase. Crudely rectify it and count 50 cycles for each second of delay that you want. In this way, you don't care how "fast" the processor clock happens to be.

                                          Comment

                                          Working...
                                          X