Modular decade box - Page 1
Forum section: electronics / projects

author: MrWizerd
author_rank: Contributor
timestamp: October 23, 2016, 11:12:58 am
content: So I wanted to learn more about microcontrollers and programming as well as circuit layout and figure the best ways to learn is to do. To this end I wanted to take something simple and make it.... Not I suppose. When I purchased an old Leeds & Northrop decade box on eBay to have as something of a workable museum piece, I thought of my idea to have a steampunk style electronics bench with most things looking steam punkish while being functional. The simplistic beauty of the brass contacts wooden case and bakalite face plate and dials appeals to some fantasy geek in me obsessed with things like rigid airships.While a healthy fantasy is one thing (the ride loathes my clutter now and I doubt she would respond favorably to a steam punk theme in her house she sustains things that are not real, no imagination that one) reality and part of that being a lack of space made me think this could be a great project. I have since searched many different schematics of decade boxes for inspiration when this one caught my good friend liquibyte's attention.https://www.eevblog.com/forum/projects/digital-decade-resistance-box-25684/It did this because I wanted mine to be modular and this one posted by kzenos is. His schematic uses an extensive logic system instead of a microcontroller for a few reasons he stated and after contacting him he sent over all of what he had and I of course promised that credit would be given. With that bit of business done I looked into how I could go about doing this and I will be ordering parts including an i2c i/o expander as well as a component to work as a switch. My idea is to minimize moving parts and reduce part numbers to bare minimum for size concerns. I am hoping of the possibly of designing a tiny surface mount version but that will need to wait.PartsMain components for the project will be...Main control board and dock:Amtel microcontrollerVacuum tube displayKeypadDecade cards:Pcf8574a - 8 bit w/o expander2 - assr-1520 - 1a solid state relay 0-60vResistors/capacitors/inductors variedThis list is by no means comprehensive as this is what I believe I will need to prove the digital switching system with the microcontroller. If I can get one to function then I will add a second to prove it will work before a scale up to individual breadboard to mimic the expansion system. I don't forsee many problems with the circuit, my biggest learning curves will be the programming and learning to address i2c properly and figuring a way for the microcontroller to detect at least on boot what boards are detected. For Instance in the beginning it will need to know that the ones ohm board is connected as well as the tens ohm board and so on so it can properly set resistance. I would also like to have capacitance and possibly inductance boards as well, possibly with separate outputs that are programmable to each type. This way if you needed 333ohms and 75uf you would put in the 1,10, and 100 ohm boards as well as the 1 and 10uf boards. The issue is the microcontroller needs to be able to know intuitively what type of board is installed and what ranges and values (i.e. pf, uf, ohm, k-ohm, m-ohm, as well as ones tens etc. This is important so it doesn't always read in one scale like reading in ohms at the mega ohm level) are installed. This is my second learning curve and while the programming side I have tutors for I have no idea how this will work.At first we figured maybe an extra connected wire/path for the different types like the connection to the resistance boards is six wire and capacitance right wires with a resistor or something that is used to set the value that the microcontroller then reads. This may work perfectly I am not sure, I like it because it seems simple but it seems to simple and I am unsure how a microcontroller even would behave trying to look at and decide how to classify things this way. I know how computers do this sort of thing software wise with different id numbers and such, is the there a way/component that I can get that just sends a digital id to a microcontroller? I know that the i2c bus is addressable but commonly sensors and such are only capable of setting a few addresses with a set of resistors or something. Which worries me because that may mean I can only use two or three of any given chip.This is where my knowledge or lack there of begins to fail me in a big way. Can anyone point in the right direction? I am not looking for full answers here more of how to find the answer or an explanation of why our where I have gone wrong and a point in the right direction as well as thoughts and or suggestions. Remember this is mostly an academic project to learn something and expand from somewhere I am comfortable with starting and into new realms. I understand decade boxes and that simple switches and or adjustable resistors in a dial make simple and cheap decade boxes. I own one that's older than I am. The point is to use this as a spring board for future projects both in programming and board layout as well as circuit design.Please try not to smash me to badly I know I have much to learn and I am hoping that a little donation of time from the wonderful eev community will help to return large dividends in furthering my knowledge in electronics and programming. So, thank you in advance for any time you can spare me. I know it's one of the things many of us have precious little to spare

author: ebclr
author_rank: Super Contributor
timestamp: October 23, 2016, 11:56:55 am
content: I guess that's not the modern patchtake a demo on labcenter.comalso look athttp://salmanarif.bitbucket.org/visual/Even Arduino can be a choiceOnly after you ok with the demos you must to on real hardware, It's better to learn microprocessor basics, on thing that dont need solder and don't burn. Latter you can play with the real thing

author: MrWizerd
author_rank: Contributor
timestamp: October 24, 2016, 10:26:29 pm
content: Oh, I have all the arduino's I am just not the greatest programmer. I can hack things together and I understand the basics but I do not have all of the skills I need. I will likely be using a full arduino for the proof of concept so I don't have to build a power supply for it and such. But I have the chips and uart programmers and everything else. I have built a great deal of things so far, but most of them are kits, and I have been repairing board level problems on through hole boards for years and just recently started on surface mount stuff about a year ago. I have a fully grounded workstation and have been working on a power supply design with another forum member as well. But this is my first project that I am trying to go from conception to working product, and making the thing properly modular with the microcontroller is what I need to learn about and I am not sure where to find that info.

author: C
author_rank: Super Contributor
timestamp: October 25, 2016, 12:02:24 am
content: If you are thinking of a decade box for ____ and adding a CPU you can gain a lot by going binary.For decimal you would use 10 relays or switches to select 1 of 10 values ___ to cover this range.Or BCD input to drop this to 4 values of ____ to cover range.If you replace BCD input to binary your 4 values of ____ gives you 16 values.So just by changing 2 BCD inputs to binary you get 8 values of __ gives you 256 values.Your CPU just needs to convert human two digit decimal to binary and it functions the same. A third digit in range of 0-2 gives all 256 possible.A stack of 8 modules would give you a choice of 4,294,967,296 values, and here other parts of circuit would probably prevent this range.You can lower your parts count by using how ___ value changes in series or parallel.Or you could do R–2R resistor ladder network.https://en.wikipedia.org/wiki/Resistor_ladderKeep in mind that a resistor decade box has many uses other then just being a resistor.A old time cal lab volt meter was a stable high voltage power supply, A decade box & sensitive center reading volt meter. You matched a voltage with a known voltage to measure it.To set the high voltage power supply then becomes. measure your voltage standard and adjust high voltage power supply to match standard's value.To know what a module is, read some jumpers from the board or add a memory chip you can read this from board. When you connect a module, use the actual connection to change jumpers.If you are using I2C think about an I2C bus switch to make things scale.

author: MrWizerd
author_rank: Contributor
timestamp: October 25, 2016, 02:38:46 am
content: Quote from: C on October 25, 2016, 12:02:24 amThanks for the quiz that actually had me looking up some informationYeah the main thing that I am adopting for the older project is the R-2R resistor ladder network, which leaves me with 4 solid state relays per decade. The assr-1520 contains two solid state relays that are optically controlled. With two 2r resistors in parallel for 1r and then one 2r resistor on two other relays and the last relay two 2r's in parallel for a total of 4r and all four relays in series allows me to close relays 2 3 and 4 to achieve 1r, close 1, 2 and 4 or 1, 3, and 4 to achieve 2r close 3 and 4 to achieve 3r and close 1, 2 and 3 to achieve 4r and then on and on opening all four relays to achieve a path that is 9r. This is then repeated on the tens card with 20r's and the hundreds card with 200r's and then 2k's then 20k's and so on and so forth. That part I have, and the solid state relays can handle up to 1 amp at up to 60v. I will need to verify thermal performance issues and such, at those levels but since the relays operate with an led inside the chip driving them will be very simple. Heck initial tests can use the arduino to drive the SSR directly for proof of concept with just the relays. I should be able to drive the LEDs straight from the I/O expander instead of using an older style max7219. The 7219 would be a great option if I were JUST doing a decade box that was not modular but in this case due to the modularity of the resistance cards as well as the added capacitance AND inductance it simply is not smart enough to do the trick IMO, I could be wrong. But when I have tried to program the max7219's you have to know every address specifically and while its not terribly hard to chart out say a display, its a different matter when the cards are being plugged in wherever, so addressing becomes an issue.As for your suggestion on the bus switch, I did a search on multiplexing and it appears something like the PCA9515Ahttp://www.ti.com/lit/ds/symlink/pca9515a.pdfwill allow me to multiplex the 8bit I/O expanders driving the LED's this will allow thankfully the use of more than eight I/O expanders. I also read in a whitepaper AN255http://www.nxp.com/documents/application_note/AN255.pdfpage 8 that the PCA951x series also allows for a hot swappable I2C interface which is more than I had hoped for so hopefully with the proper engineering I can make this a hot swappable card unit and that really gets me excited. As for using a chip to address the boards, do you know of anywhere I can read more about that? Liquibyte suggested that the backplane connections be setup with differnt connections used to differentiate between the resistance, capacitance, and inductance boards, which I think is a great idea, because that way the controller is not confused as to what is plugged in, but addressing individual boards from the .01? to 100M? would be problematic hard coding the connectors so it wont work there. It would maybe be possible to address them in the I2C octets after the multiplexer but that means that they would have to be plugged into specific multiplexers and that would defeat the modularity to some degree. While you could do that for each decimal place it would only do one type of the three decade types I am hoping to achieve.I would like to find something somewhere that better explains I2Chttp://www.ti.com/lit/an/slva704/slva704.pdfthis paper by TI tells me most of what I already know, and while its a good primer it doesn't go into the more advanced parts of I2C. I also don't think I2C will really solve the identification problem either, and that is really what I need to figure out, and I don't know how to even search for more information about if anyone knows I would be eternally grateful for the point in the right direction.

author: C
author_rank: Super Contributor
timestamp: October 25, 2016, 08:39:13 am
content: Ok just see a couple of things.If you really want to make most of relays used, use binary steps for all.First card does 0-15, second card 16-255 and so on.Human is decimal, computers think in binary.Change your thinking some.You could think of a tree or your directory tree on computer.Notice that some I2C devices have jumpers to select address.Quick read of Pcf8574a states 8 addresses via jumpers, lets label addresses with E0 to E7If you had a switch IC that used 8 addresses via jumpers, lets label addresses with S0 to S7Think of your AVR that has one connector.When a board is plugged in a Pcf8574a gets strapped for E0 and is used to ID the board.When a switch board is plugged in straps set Pcf8574a to E0. Reading data at E0 gives board''s ID as a switch. First level switch IC is at S0.When you plug a board in to switch board straps set Pcf8574a to E1 for ID. All boards connected to switch board use same address for ID with switch preventing two matching addresses. All switch boards can use S1 for switch.Each layer adds addresses that lower level layers can not use, but adds addresses that can be shared.All boards connected to a second level switch board can use any address but E0,E1,S0,S1.A third level of switch boards and all boards connected to this third level switch can use any address but E0,E1,E2,S0,S1,S2.If your decade boards are using 4 bits of the ID to control relays, you only have 4 bits left(16 values) for ID and a switch board uses one value for it's ID. If you think of big picture one value of the 16 could allow lower 4 bits to ID many different boards like a switch board where no bits are needed in ID for control.In hex, 00h to 0Fh is boards like a switch board. this leaves 1xh to fxh for decade boards.ID of R, L & C needs 2 bits and leaves one unused.This could be the msb two bits, with 0 the boards like switch board.You have two bits left for what decade.Moving the 4 bits controlling the relays to second Pcf8574a makes programing easer and leaves more bits for what decade.A two decade control board needs two Pcf8574a, One for ID(E6) and One for work(E7) so you could have five levels of switches from this board to AVR.When you plug in a card you are strapping address jumpers of card plugged in.With 8 bits for ID you have many options.Plan it out so that changing a switch never makes two addresses active at same time.Now go big time, you have an ID per board and were thinking of R, L & C boards. Go the next step and allow for more types of boards. You could have a display board, a input board & a _____ board.Next step up is to replace the ID Pcf8574a on each board with a eeprom memory chip. You gain a lot of space to store data about a board with little cost, with just one part of data the ID. You could have a list of addresses used on the board and what IC is at that address.Things like is that Pcf8574a controlling decimal, bcd or binary based relays.

author: rstofer
author_rank: Super Contributor
timestamp: October 25, 2016, 03:23:56 pm
content: You can put a small I2C EEPROM on each card (8 pin dip) and program a bunch of information related to the board if you wish. You would simply write a little program to talk to the EEPROM after assembly to set the parameters. The addresses for the EEPROMs will probably not interfere with the addresses for the IO expanders.

author: ebclr
author_rank: Super Contributor
timestamp: October 26, 2016, 02:29:56 am
content: You can use this relayand 2 buttons one to increase other to decrease