I can´t find the problem the project has

I´ve been working in an automated fan, solenoid, waterpump system for cows. During the past 6 months I learned a lot about cattle, arduino, coding. Most of this, because that forum. So I decided to build an prototype to help my office partner with his cattle milk farm and maybe to start helping our neighbors that produces milk too.

I have built 2 prototypes. Both of them have the same parts.

The parts are: arduino nano, LCD display, encoder module, thermometer module, 4 channel relay module, RTC module, i2C module, 850mA cellphone power source.

1st ptototype running OK (Just hooked up all the modules together)

2nd prototype - weird things happen ( designed pcb)

I attached below all the data I find usefull

https://1drv.ms/u/s!ArqhChDKteGQkGNzSFlo5k3qP1K4

Ps: I found that I inverted RX and TX pins. So I had to upload the code to ATMEGA328P before soldering in PCB, otherwise, it would be impossible to get the sketch uploaded to the board.

I did some experiences.

I took CH340G chip away and the board remains with the same problem. So, it couldn´t be RX and TX inverted pins the problem.

I also changed the power source cable and its source to a higher current. It remained the same.

I did a multimeter check in chip pins trying to find any bridge in chips legs. I found nothing.

Someone has any tip to begin with?

Rafael:

I attached below all the data I find usefull

https://1drv.ms/u/s!ArqhChDKteGQkGNzSFlo5k3qP1K4

I looked over your pictures and you may not like my suggestion... but I think since you have already looked for obvious issues that you should assemble a 3rd unit. Hopefully you have 5 or 10 boards from your order.

It is not uncommon for boards to be faulty and finding the issue is terribly time-consuming. Since you know that the circuit works and the software works there is obviously something weird going on.

One thing you can do in the future is to consider building some diagnostic code in your software ... bridge a jumper on your board, power up, and the diagnostics can be very useful. Power off and remove the jumper for normal use. A little software can save you hours with a DVM.

Ray

Given you're using the same hardware and software it's either a wiring fault or a problem with psu's / interference - are you decoupling adequately? are you you using star earthing? what's different? are components faulty?

regards

Allan

mrburnette: Rafael: I looked over your pictures and you may not like my suggestion... but I think since you have already looked for obvious issues that you should assemble a 3rd unit. Hopefully you have 5 or 10 boards from your order.

It is not uncommon for boards to be faulty and finding the issue is terribly time-consuming. Since you know that the circuit works and the software works there is obviously something weird going on.

One thing you can do in the future is to consider building some diagnostic code in your software ... bridge a jumper on your board, power up, and the diagnostics can be very useful. Power off and remove the jumper for normal use. A little software can save you hours with a DVM.

Ray

Hi Ray, thanks for the advice. Considering I have 4 more boards to go, so I will take your suggestion and I will assemble one more.

I am concerned about ATMEGA328P 16MHZ smd resonator and CH340G 12MHZ smd resonator. Maybe I can assembled them upside down or they don´t have any orientation? I have purchased nano boards with different label orientation, so I assume it does not matter.

Another thing, LCD display is not as bright as in the 1st prototype, and the relays coils don´t get energized, only the led for each relay turns on. So, it seems that the current isn´t enough to activate the optocoupler I assume.

could it be current problem? I use a standard 16mil traces in all the board to draw 500mA - 600mA.

allanhurst: Given you're using the same hardware and software it's either a wiring fault or a problem with psu's / interference - are you decoupling adequately? are you you using star earthing? what's different? are components faulty?

regards

Allan

Hi Allan,

I can tell you the components aren´t the same. I desoldered the chips from brand new modules. Resistors, capacitors are new and never desoldered from anywhere. The changes I made was in the power connection. The original arduino nano comes with a USB miniB connection. I changed to a USB microB connection to be able to use cellphone chargers. I didn´t put any capacitor right after the power gets into the board. I just put the capacitor right before each chip. Could be the lack of that capacitor?

what I did was to get all the modules together in a single unit and link them with a power line and ground planes, one in the top, and another, in the bottom, connected through vias. But something went wrong.

Sorry, I don´t know what is star earthing. I will attach an image of the power line. the bright red line is the power line. The red circle at the right picture is where I didn't put the capacitor (I didn´t have 10uF cap) so I left it opened.

power line

Rafaelmec2013:
<…>
I assume. could it be current problem? I use a standard 16mil traces in all the board to draw 500mA - 600mA.

Very likely something is drawing too much current and causing a voltage slump … Often, a short will just pop the Polly fuse, but a component drawing too much current is hard to find unless it gets hot. Honestly, I would rather see magic smoke than have to run arround part by part looking.

Ray

Video doesn't show enough.. Do you have enough decoupling caps close to the cpu in your PCB.

Rafaelmec2013: Another thing, LCD display is not as bright as in the 1st prototype, and the relays coils don´t get energized, only the led for each relay turns on. So, it seems that the current isn´t enough to activate the optocoupler I assume.

Could the snubbing diodes be in backward? That would short out the relay coils and prevent the relays from activating. Could the optocouplers be mounted backward? That would also keep the relays from activating.

johnwasser:
Could the snubbing diodes be in backward? That would short out the relay coils and prevent the relays from activating.
Could the optocouplers be mounted backward? That would also keep the relays from activating.

You´re right! your first question proceed. I don´t know why silkscreen diode symbol got back to front. I ended up soldering backwards all 3 diodes. I will get it done the right way and I will share the results here!

lastchancename:
Video doesn’t show enough…
Do you have enough decoupling caps close to the cpu in your PCB.


schematic

decoupling caps positioning

arduino nano schematics

|500x249

schematics for cpu

Good catch on the diodes!

lastchancename: Good catch on the diodes!

I love it when an educated wild-ass guess pans out. :)

I inverted the diodes but nothing happens. Lcd display shows a blank string in the first and third line. Lcd isn´t initializing, don´t know why.

Hi;
Very worried about solder quality/quantity of LCD pins to PCB.
pcb_bottomgg.jpg

Tom… :slight_smile:

Hi,
On your PCB I cannot see the gnd connections to Q12, Q13 and Q14 emitters.
pdbgg.jpg
Tom… :slight_smile:
Have you done voltage checks with a DMM, basic stuff.

TomGeorge:
Hi,
On your PCB I cannot see the gnd connections to Q12, Q13 and Q14 emitters.
pdbgg.jpg
Tom… :slight_smile:
Have you done voltage checks with a DMM, basic stuff.

Hi Tom, I didn´t check yet. I will check and post here results.
A better print from the pcb showing ground plane.
pcb print