Strange issues with new project - Page 1
Forum section: electronics / projects

author: mal-c
author_rank: Newbie
timestamp: November 17, 2015, 03:17:13 pm
content: Guys I need to pick your brains.I'm developing a project that uses a PIC 18F4620, DS1307 a standard 16 x 2 LCD and an 18B20 sensor. I use an Easypic 5 development board, and a solderless breadboard to test and debug the code. Everything was working fine on the system so I drew up a schematic and had 5 boards made by PCBway.Having built one board I tested the unit using a bench supply made from an old PC power supply. Connecting the 5v up to the board, I was pleased to see it ran correctly, displaying the time, temperature and other data on the LCD. I had ordered a 240vc to 5v DC from e-bay, which arrived the following day and so I connected a mains cable and tested the output using a UNI-T UT30B DVM - 5.83v unloaded. I hooked it up to the board I had made and all I got was 00:0: on the LCD and that was it...Since then I've tried various means of powering the board with different resultsA small mains transformer 12-0-12v, bridge rectifier (both descrete and one made from 4 x 1N4001's) connected between 0-12 taps, 2200uf Cap and a 7805 - Board fails to runConnected to the 5v supply to my breadboard which is hooked up to the EasyPIC5 board - Board runs fine240v ac to 5v DC "buck" type PSU - Board fails to run5Vdc "phone charger" type plug supply - Board fails to run5v from a PC power supply - Board works fineI've checked the output from all devices for ripple etc and the trace is perfectly flat on the scope.Any ideas ?

author: McBryce
author_rank: Super Contributor
timestamp: November 17, 2015, 03:23:46 pm
content: How much current does your board need and how much can each of the supplies supply? On those that don't run, is the PIC actually getting 5V or is something pulling so many amps that VCC has dropped below what the PIC needs?McBryce.

author: mich41
author_rank: Regular Contributor
timestamp: November 17, 2015, 04:19:49 pm
content: Quote from: mal-c on November 17, 2015, 03:17:13 pmHalf of my brain says that the working supplies have earthed grounds and the others (most likely) don't. The other half has no idea why the circuit would care.Quote from: mal-c on November 17, 2015, 03:17:13 pmKnowing what the software is supposed to do next could offer some clues.Quote from: mal-c on November 17, 2015, 03:17:13 pmWith load or without? You aren't clear.BTW, I find it hard to believe that the PSU sitting in your PC (and USB) is perfectly flat. Did you try AC coupling and high sensitivity?

author: mal-c
author_rank: Newbie
timestamp: November 18, 2015, 01:28:47 am
content: Thanks for the replies. Let me try and clear up some of the points raised.The project is a pulse proportional thermostat. It uses a clock to allow for programable drop / rise in temperatures for a given time period. The code runs on an 18F4620, uses a DS1307 for the RTC, and a DS18B20 to obtain the temperature. On powerup the default time is set to 14:00 hrs. This and the current temperature, along with the set temperature I want to maintain is displayed on a 16 x 2 charater LCD. The pulses are sent to an SSR which switches the mains on and off to control the heater, but in testing no mains has been connected. The board was designed using Diptrace and no ERC errors were reported prior to exporting gerbers to have the boards made. I don't have any ground plane on the board, mainly due to having ac mains on the board, even though there are cutouts in the board to prevent any risk of the two sides connecting... but like I said I have no mains connected at this moment in time.I have three input switches that are pulled to GND when I need to enter the menu options to program. These inputs are pulled high via 10k pull-ups. There is just two outputs, one for the heater the other for lights. A monitor LED is connected across the heater output and GND via a 1K series resistor.The bench supply is made from an old 500w PC power supply to give me 3.3v , 5v and 12v output. The easypic5 board has the option to power itself from the USB cable, or by changing a jumper, and external 9-12v AC or DC supply. When powered from an external supply, the power goes through a bridge rectifier, 470uf cap across +ve and GND, then into a 7805, with a 0.1uf and another 470uf capacitor across the 5v and GND. This 5v is connected to all the port extension headers on the board, one of which I use to connect to a solderless breadboard via an header cable. My thermostat PCB has a +v and GND rail connection, and when I connect the board via two 6" lengths of wire to either the breadboard fed via the easyPIC5 board, or the 5volt and GND from the PC-PSU bench supply the thermostat board runs fine, displaying text on the LCD as it is intened. However if I use any other form of supply, be that a transformer with a bridge, smooting cap (like 2200uf) and 7805, or a switch mode power supply (both purpose build "buck" type unit or a "plug" type wall socket adaptor) the thermostst fails to run, displaying 00:0: on the LCD, and no illumination of the monitor LED or responce to touching the temperature probe....I'm limited to testing. I have a basic but good quality DVM, and a Hantex PC scope. My experience of using this scope is limited, so I would need some guidance on how to check for AC coupling etc. Could someone explain what earthed GNDs are, and if this would be the case from a PC power supply. Whilst I can see that powering the EasyPIC 5 via USB and a converted PC PSU have the fact that both the PC and bench supply are in effect the same type of unit (ie both 5v sources are derived from a PC Power supply), that wouldn't explain the fact the thermostat worked when I powered the EasyPIC5 board from an external 12v supply (an old 12v wall adaptor used to power an old network switch).Hopefull this additional information will help answer some of the points raised, and I look forward to hearing suggestions on what the cause migth be, or further things to test.

author: crazy horse
author_rank: Contributor
timestamp: November 18, 2015, 04:47:38 am
content: Is your new board that you have built just the temperature sensor, or does it include PIC and power supply?Because when you say you apply 5V supply, on the EasyPIC that has to go through a diode bridge and 7805.Do you have decoupling cap for ds1820? Posting schematic would be helpful.

author: promacjoe
author_rank: Regular Contributor
timestamp: November 18, 2015, 05:11:22 am
content: first of all, using a PC power supply that can potentially supply 20 A or more, on a project that may only require 1A is not only a bad idea, it can be dangerous if something goes wrong. you would be better off with a wall wart power supply. PC power supplies are great for PCs But I must caution you not to use them for anything else. it is just not a good, safe idea. Only use a power supply that will supply approximately 1.5 maybe 2 times the current needed. I personally have a large selection of wall wart power supplies, both transformer type and switching type to select from. I also have a couple of lab grade regulated power supplies, and several larger power supplies, If I need them. years ago I did use a PC power supply on one project That required a high current. but I found it very unsuitable for the project, and its safety was questionable.If your project is not working, start by using the proper power supply. Check the voltage that is coming in to the circuit board along with the current. Check it at each point. Entry point, rectifier, regulator input and output. Be methodical about your testing. Test every point and make sure it has the expected voltage. And that the current is not exceeding what you expected to be. follow the voltage all the way through the circuit, until you find a problem. And let us know what you find.also note, Most PC power supplies only regulate one voltage. this means that the other voltages that are not regulated will go up when a load is applied to the regulated circuit. It also means that when using the Unregulated voltage, The voltage will drop Under load. You will have to put an equal load on the regulated circuit to raise the voltage. This means using load resistors. and lots of wasted energy.

author: mal-c
author_rank: Newbie
timestamp: November 18, 2015, 09:42:12 am
content: @ Crazy Horse. I've attached the schematic of the easyPic5 power supply option. When on USB it simply takes the 5v coming in and connects it to one side of a three pin header. The centre pin then goes to the switch, which then connects to the Vcc nets on the EasyPic5 board. When the jumper is set to external supply, it uses the on-board rectifier, regulator and caps before connecting to the other side of the three pin header.@promacjoe. Define "proper power supply". As mentioned I have tried various "proper" power supplies from a module purchased off e-bay that resembles a buck converter with isolation transformers chokes etc that takes 240vca and gives out 5v DC, to a linear trasnformer with a bridge rectifier, caps and 1 amp 7805. The only time the board runs is when I use my bench supply made from an old computer power supply, or when 5v is taken off the Easypic5 board (regardless if the Easypic 5 is fed from USB or external wall wart power block.I've measured the current, it's 25mA when the device is running and that is with the monitor LED illuminated, so there would appear to be no issue with shorts etc drawing excessive current and bring down the voltage.Whilst I can appreciate suggestions for decoupling caps etc, if this was the issue then surely it would cause the unit not to work when fed off my bech supply or USB

author: mal-c
author_rank: Newbie
timestamp: November 18, 2015, 11:26:29 am
content: Mich41 seems to of steered me in the right direction.I received my order from RS containing more 7805's. I made up a supply from 4 x 1n4001 diodes, 2200uf cap across the positive and GND lines, into a 7805, and a 0.1uf and 470uf across the +5v and GND out from the regulator. On powerup I got the same issue as before, so I powered down and connected a link between GND and mains Earth... powered back on and the board functions perfectly... seems my project doesn't like floating power supplies.

author: McBryce
author_rank: Super Contributor
timestamp: November 18, 2015, 11:37:40 am
content: Quote from: mal-c on November 18, 2015, 11:26:29 amOk. But why?McBryce.

author: Delta
author_rank: Super Contributor
timestamp: November 18, 2015, 11:45:48 am
content: What decoupling have you got across Vdd and Vss on the PIC?The lcd that you're using, does it show if 00.0 if powered up on its own, or does it need the PIC to send it something before it displays anything?Have you go anything connected to the mains terminals? (I know you said it's not powered yet, but is anything wired up yet?PS. Are you switching the neutral for the heater? Tut tut tut...

author: mich41
author_rank: Regular Contributor
timestamp: November 18, 2015, 05:08:43 pm
content: Maybe there's some IO (or reset) line left floating and when the ground picks up noise it registers spurious state transitions which confuse the hardware and/or software.I'd try to figure out what exactly is going on when it locks up - what needs to happen for software to end up printing 0:00, what are possible continuations from this state and where they lead (nowhere good, apparently). Trace code execution with blinking LED or whatever. Be grateful that it always hangs at the same point; things could have been worse.Quote from: mal-c on November 18, 2015, 01:28:47 amProbably Hantek, not Hantex, although with Chinese gear you never know...Read the manual, it's always useful to know what the thing can do for you.

author: promacjoe
author_rank: Regular Contributor
timestamp: November 18, 2015, 06:31:24 pm
content: Quote from: mal-c on November 18, 2015, 09:42:12 amA proper power supply is one that is rated for the Item being powered. To run a 7805, 5 V, Linear regulator, you need a power supply that will supply at least 7 V. And up to 12 V. at the needed current. but a higher voltage will create more heat and wasted energy. You also need enough current to allow for this heat/wasted energy and still power the unit. As I said earlier, using a power supply with too much current can be dangerous. Select a power supply that supplies at least 1.5X The current needed. But you should not go over 4X the current needed. In this case, a switching regulated power supply is your friend. They put out a steady known voltage and if the short does occur, most will shut down.you mentioned you were using a "240vca and gives out 5v DC, to a linear trasnformer with a bridge rectifier, caps and 1 amp 7805. " is the voltage output Of this transformer a regulated 5V, Or is it a unregulated transformer. what is the current rating of this transformer. An unregulated transformer power supply should be about the rated voltage at the rated current. An unregulated 5 V transformer will produce Approximately 7.2 V at no-load. The voltage will drop depending on the current rating of the transformer. The voltage drop through the rectifier will leave you with approximately 6.6 V, No load. This is not enough power to properly power the regulator. The minimum voltage for the regulator is approximately 7 V, under load.For this application, I recommend a 9 V Switching regulator power supply at 1 A. or a 7.5 V 1A unregulated Transformer power supply at 1 A' max. this is considering the stated current of less than 500ma.