Compare the two sketches. What libraries and functions are used in relation to the sensor? What parameters are given? Are they the right ones, now you understand the difference between i²c and SPI?
1. This is (Fig-1) the one that takes time to establish connection either as I2C deice or SPI device. It contains 3.3V sensor, no 5V/3.3V voltage regulator, no 5V/3.3V level sifter.
Figure-1:
2. Table (Fig-2) to be consulted to wire it either as I2C device or SPI device.
Figure-2:
3. I2C Connection (Fig-3) based on Table of Fig-2 (not tested)
Fgure-3:
4. SPI connection (Fig-4) based on Table of Fig-2 (not tested)
Figure-4:
5. 5V/3.3V Level sifter
Figure-5:
Compare the two sketches?! I lifted the dozen lines of the functional sketch VERBATIM. I added one #include. The wiring is correct because it works perfectly under the TWOWIRE test.
The module has for lines. vcc, gnd, sda, sdc. no jumpers, switches, or wiring options.
I posted 2500 lines of code because I was told just posting the added code wasn't sufficient. And now your only advice is "compare the code"? That is NOT helpful. I understand you're a boss here, but have you any more practical advice other than "compare the code"? I posted the ENTIRE "two wire" sketch here. A pointer in the right direction is what I need, not a generic non-response "compare the code", don't you think that I already thought of that?!
I have a four wire +5vdc module. vcc, gnd, scl, sda. No jumpers, no options. it works when i run the TWOWIRE diag, but when i copy to the larger sketch the sketch DIES.
Good luck with your project.
Compare the sketches...
From my experience that mess cannot work as a system unless the OP plans to gradually reduce the jumpers wires by putting the modules onto a PCB.
You mean like THIS?
Everything is mounted on a panel with a holder, the wiring is neatly dressed out. This is the dev box. All the stuff that is hanging loose will mount on the front panel, that is why they have long service loops. The power leads are all soldered and the signal leads go into the terminal shield.
The cables use HS tubing to separate out power and signal leads. Everything is covered in HS tubing so there are no exposed pins anywhere. Cable ends are labelled and each device has a 3D printed mount.
Just what exactly would you do differently?
GolamMostafa: Please show me your construction techniques so I can learn how to do it properly. I checked your PROJECT HUB page and you don't show any projects.
those were failed variants. I didn't just holler for help on the first fail. What is commented out wouldn't compile or was part of what crapped out.
That's the most helpful thing you've said.
Your makeup of post #28 may work except that you have to shorten the inter-wiring help of grid board (Fig-1), soldered jumpers or wire-wrapping.
1. Get a suitable sized grid board (Fig-1) or place together a number of grid boards.
Figure-1:
2. Test a sensor-1 or an input devic-1 or an output device-1. Place it on the grid board. Test device-2. Place it on the grid board. You can use holding panel as you have done in post #28. Connect device-1 and device-2 together with short jumpers which needs to be wire-wrapped or soldered. Test them.
3. Next connect device-3 and test them.
4. Keep connecting device one-by-one and test them. At a stage, we will see that adding the next device prevents the whole system from working. Now, troubleshoot the system and devise the solution.
Thats a great idea, but the devices don't have mounting holes. You can't solder the module to the bread board without a cable since there would be no way to replace a module without unsoldering and possibly causing more damage. The panels need to be separable and each module needs to be swappable without soldering. This is important for long term maintenance and servicing.
Additionally several of the components need to be oriented looking one way or the other. The IR, the LED matrix, the traffic light, the LDR. The buttons and pot all need to be on the front panel looking out.
Great plan for a home project, but not really practical for production.
How do you mount speakers and what do you do for power distribution? How do you label connectors? How do you connect from the perf board to the CPU? Still use the terminal shield or straight into dupont pins?
What makes you think I haven't been adding one item at a time already? How do you think I got all this stuff working as well as it does? The BME280 was just the latest item to be added. Do you expect me to build a completely new system every time a part that I try doesn't work as expected? How do you swap modules for test?
These are going into limited production for sale in stores. They MUST be self sufficient in that once programmed, it NEVER has to be plugged into a computer again. I'm trying to build an appliance, NOT a "one off". Gotta plan for manufacturing even in low volumes. I can't fly out to solder a replacement whatever, but I can mail a module that the user can change with just a screwdriver.
What are you going to do for packaging? I've got a wood shop on standby with exotic woods just waiting for final specs.
If the device does not have mounting holes, then probably it has long pins which will easily go through the holes of the grid board. Or as you have done in post #28, put the device on a panel, engage it with the grid board by screws, and connect with other device using short wires/jumpers.
Are you making a hobbyist project or a useable/commercial grade system? Then the approaches would be totally different.
Again. soldering the modules to the grid board is not an option as they need to be swappable without soldering. If you use short wires you're back to my design.
You also didn't address the other issues for fab.
I have considered your project as a one time hobby project.
It isn't. Unit #3 is waiting on parts. Once the protos are made they're going into a shop in town.
Check out the level of detail in the schematics and other sections of the project over in my section of the PROJECT HUB.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.