Announcement

Collapse
No announcement yet.

Getting started with microcontrollers.

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

    Getting started with microcontrollers.

    Fed up with my "sinewave" inverter i decided to build a better one, but i need a stable 50Hz source. Upon giving it some thought... i finally decided to go with a micro. One of my mates at uni built a LC meter for a contest, using a PIC, so that's what i'm going to use as well. So i can bother this guy with stupid questions.

    I'll be buying a Pickit 2 clone. The reason i'm not building it myself is that the Pickit itself needs to be programmed by other means before it can be used.
    Originally posted by PeteS in CA
    Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
    A working TV? How boring!

    #2
    Re: Getting started with microcontrollers.

    Originally posted by Th3_uN1Qu3 View Post
    Fed up with my "sinewave" inverter i decided to build a better one, but i need a stable 50Hz source.
    Isn't the electricity over there 50Hz? So what's wrong with using the voltage out of your wall sockets? Most large scale power systems have extremely stable frequencies. It might be a bit noisy, but you can always put a filter on it.

    Comment


      #3
      Re: Getting started with microcontrollers.

      Um, why would i use an inverter to generate 230v when i have working mains? The inverter is of course to be used when power goes down.
      Originally posted by PeteS in CA
      Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
      A working TV? How boring!

      Comment


        #4
        Re: Getting started with microcontrollers.

        Originally posted by Th3_uN1Qu3 View Post
        The inverter is of course to be used when power goes down.
        So you're talking about a UPS, or is it something much bigger, enough to run the whole house/apartment on?

        For the former I'd say, just get a UPS and go with that. It doesn't have to be new. I have seen many of them thrown out when the batteries died because the cases are stamped with "no user serviceable parts". But that's usually nonsense and on opening them one finds standard lead acid batteries which are easy to replace. I suppose there may be some with one of a kind oddly shaped and oddly volted batteries, but so far, I have not run into one.

        Comment


          #5
          Re: Getting started with microcontrollers.

          Originally posted by mathog View Post
          is it something much bigger, enough to run the whole house/apartment on?
          You got it. Blackouts haven't happened in a while (knock on wood), but brownouts that last just enough to shut down some stuff are quite frequent. I also plan to add some solar panels later on. Not necessarily as an alternative energy source, just to not use utility power to keep the batteries charged.
          Last edited by Th3_uN1Qu3; 05-22-2011, 08:19 AM.
          Originally posted by PeteS in CA
          Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
          A working TV? How boring!

          Comment


            #6
            Re: Getting started with microcontrollers.

            Originally posted by Th3_uN1Qu3 View Post
            You got it. Blackouts haven't happened in a while (knock on wood), but brownouts that last just enough to shut down some stuff are quite frequent.
            For short brownouts you might want to consider putting in a cutout circuit to protect refrigerators and other devices that are unhappy when the power isn't what it should be, but can be safely turned off for a few minutes at a time. That shouldn't be very complicated, all it needs is a voltage measurement on the mains side, a big enough relay to handle the open/close current for the device, and a tiny bit of control electronics to drive the relay. The control circuit will need a fair bit of hysteresis, so that it doesn't toggle the relay on and off quickly if the mains voltage wanders around near the cutoff.

            Comment


              #7
              Re: Getting started with microcontrollers.

              Well, my fridge doesn't complain. Anyway. The Pickit 2 clone is here. It works. I managed to blink a couple LEDs. On to more interesting stuff.
              Originally posted by PeteS in CA
              Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
              A working TV? How boring!

              Comment


                #8
                Re: Getting started with microcontrollers.

                Originally posted by Th3_uN1Qu3 View Post
                Well, my fridge doesn't complain.
                I'm not sure I could hear the difference on my fridge even if it never got up to speed. Anyway, just stumbled on this (only the first page is free), which is a circuit that does what I was suggesting:

                http://www.siliconchip.com.au/cms/A_111036/article.html

                Comment


                  #9
                  Re: Getting started with microcontrollers.

                  Sounds like too much hassle for something that this inverter will accomplish anyway.

                  Progress on the microcontroller side of things. I successfully used up all 6 I/O pins available on this PIC. I put four LEDs two by two, and two push buttons. The LEDs continuously transition from one another, making a spinning effect. The buttons change the speed of the spinning. PIC assembler is really easy to learn. I ran into a few snags but it's looking good so far.

                  I also found a Microchip appnote, complete with source code, which does - guess what? Software PWM generation. Unfortunately MPLAB tells me the code won't fit in this little bugger i have (a PIC12F675), so i'll have to cook my own. Shouldn't be too hard tho.

                  This chip's quite impressive - it's even got a 3-channel ADC onboard. Mmm. I smell cap torture device with LCD readout.
                  Originally posted by PeteS in CA
                  Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
                  A working TV? How boring!

                  Comment


                    #10
                    Re: Getting started with microcontrollers.

                    I'm back on it... I have switched to a larger PIC btw, a 16LF876A. More outputs, more ADC channels, a built-in PWM module... neat. That's old news though - i bought that PIC like a month ago - but i think i posted about it in another thread not in this one.

                    I've written my own LCD routine out of bits and pieces i found on the internet (since none of the ones i found actually worked by themselves), but i hadn't figured out how to deal with strings, and sending data letter by letter (and in ASCII codes at that), quickly got annoying.

                    That is, until now. Looky what i've accomplished.
                    Attached Files
                    Last edited by Th3_uN1Qu3; 07-10-2011, 05:23 AM.
                    Originally posted by PeteS in CA
                    Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
                    A working TV? How boring!

                    Comment


                      #11
                      Re: Getting started with microcontrollers.

                      How do you know that ........>

                      Well, my fridge doesn't complain.
                      Did you ask the fridge if it matters ....>

                      I can tell you it dose MATTER and over time your fridge will complain and may be to late for you to help it and will be DEAD

                      I am a refrigeration / air conditioning technician by trade and one of the most
                      comman problem is brown outs and the compressor try s to restart and can not this is hard the strating up parts of the fridge

                      You might want to consider putting in a cutout circuit to protect refrigerators
                      I have one these on my fridge and they do help
                      Last edited by sam_sam_sam; 07-10-2011, 07:30 PM.

                      Comment


                        #12
                        Re: Getting started with microcontrollers.

                        MMMMMMM microcontrollers I started working with them last year. what got me into it was i needed a fail safe for me rc car.
                        My pc
                        CPU : AMD PHENOM II x4 @ 3.5Ghz
                        MB : ASUS M4A89TD PRO USB3
                        RAM : Kingston ValueRAM 16gb DDR3
                        PSU : Cooler Master 850W Silent Pro
                        GPU : ATI Radeon HD 6850

                        Comment


                          #13
                          Re: Getting started with microcontrollers.

                          Originally posted by sam_sam_sam View Post
                          comman problem is brown outs and the compressor try s to restart and can not this is hard the strating up parts of the fridge
                          That's something to keep in mind, thanks. For now the brownouts never lasted long enough for the fridge to stop - yes i did happen to be in the kitchen on a few occasions - but thanks for the warning.
                          Originally posted by PeteS in CA
                          Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
                          A working TV? How boring!

                          Comment


                            #14
                            Re: Getting started with microcontrollers.

                            Alright, movin' on. Tonight i will set up a TL431 as reference for the ADC, and start getting some readings.

                            The plan is to be able to measure the ripple applied to the cap under test, in my upcoming capacitor load tester. And there will also be a couple linear regs i will need to monitor and adjust by the means of digital pots. While the PIC's ADC is certainly too slow to sample a 100kHz signal - and i have my eyes on a dedicated chip already - there is a possibility that i will be able to cheat and do by without the help of an external chip.

                            Here's why. I am not interested in "seeing" the signal, like an oscilloscope would. I know how the signal will look like, i don't care whether the PIC sees its shape or not. All i care about is the peak-to-peak value, and the signal is repetitive... and that means i can make several readings over a longer period of time and just pick the highest values.

                            I will only update the LCD display every 200ms (as it's so slow it gets blurry at 100ms refresh, and starts displaying garbage at 50ms) - and that's a crapload of time to do stuff even with that slow ADC.
                            Originally posted by PeteS in CA
                            Remember that by the time consequences of a short-sighted decision are experienced, the idiot who made the bad decision may have already been promoted or moved on to a better job at another company.
                            A working TV? How boring!

                            Comment

                            Working...
                            X