Splashboard V 2.0 IoT


#81

Oscar, This design of push button input is really smart!

I suppose it works on the principle of potential division through the ladder of series resistors. Sw5 gives 0V when pressed, SW4 gives 2.5V to the analog input pin when pressed and so on… am I right?

If so, I have tried locating the 1K pull-up resistor to complete the network, I think it is missing. Is it there?


#82

Hi. The idea is to use an ADC pin on the MCU. Since the AVR has a 10-bit ADC, you have 1024(1024=2^10) possible output values (from 0 to 1023). So, if vin is equal to 0V, the result of the conversion will be 0, if vin is equal to vref, it will be 1023. Each button changes the value of vin because of that button’s circuit resistance. The thing to note is that the resistor values shown are place holders - I haven’t worked out the real values to enable good separation of voltages on the input pin. The gaol should be that any ADC value 0-250 is button 1, 250-500:2, 500-750:3, and 750-1023:4. I hope this helps clarify the idea.

There is a pull up missing (When no button is being pressed the value would be floating otherwise - good call). Sorry - to be added to the next drawing. Thanks


#83

True. ADC resolution is critical. Another factor i suppose is key to note in this design is environmental noise, too small a voltage margin for a button, the more likely the noise say from a nearby cellphone is likely to tamper with the system operation. I suppose it may be subject to further research. 4 buttons in this ladder i think is fine. More buttons in one branch may possibly bring problems


#84

Correct. The reference voltage is critical too. it has to be very stable - we would probably need a separate regulator for it. The ladder system is also influenced by temperature, so while it would probably be reasonably reliable with the four buttons and not more, now that we have more pins available we do not need to use it.


#85

Something else I noticed later is that the slide on/off switch in front of the LM2576 regulator needs to handle up to 4A. I cannot find any such switch online. (Anybody know one?). Otherwise we need to make a latching circuit for the ON/OFF, don’t we?


#86

I think there is another way. I’ve been looking at the datasheet of the LM2576 SMPS and found that the Manufacturer has simplified everything for us. http://www.ti.com/lit/ds/symlink/lm2576.pdf

we can make use of the ~ON/ OFF pin to control the regulator. The pin uses a maximum of 30uA input current to enable/disable the 3Amps regulator. We can have a small switch here with a 10k Pull-up instead, what do you think Oscar?


#87

I agree. Would a switch such as Digikey Part Number CKN1813CT-ND ( http://www.digikey.com/product-detail/en/c-k-components/ES02MSABE/CKN1813CT-ND/717131 )work for us? I think we’ll need a right angle switch. What do you think?


#88

Michael, I’d like to suggest that we begin a list of the components we have locked down. All components on this list should have at least a part number from a supplier. While we can use different suppliers, especially local if available, this exercise will help us design a better schematic by using correct values for required capacitors, resistors and inductors. So, I’ll begin by adding:

  1. MCU: Atmega2560 Supplier:Digikey #:ATMEGA2560-16AURCT-ND Package:100-TQFP
  2. LCD: GDM12864H Supplier: Sparkfun #:LCD-00710

What do you think?


#89

I use this tool/app to quickly test values when designing: http://www.ee-toolkit.com. I find that it really helps work out correct values quickly.


#90

Thanks Oscar, I think its very wise to begin the list now. I have found a Slide Switch SPDT Surface Mount, Right Angle >> http://www.digikey.com/product-detail/en/nkk-switches/SS312SAH4-R/360-2924-1-ND/1051215

Great Tool. Sadly I am in Android OS. I suppose a closer Version of this toolkit in Android is ElectroDroid >> http://electrodroid.it/electrodroid/


#91

an Sd card is a very important and nice feature to add to our second version


#92

This layouting is fine .I like but i wish all buttons were aligned together like close to each other


#93

Bob, you mean same pattern but closer to each other?
Anyway, well get to deeper details of layout when we get to PCB design very soon


#94

We have upgraded microcontroller to 2560, but let us look into this interesting configuration so we transfer some concepts

So oscar, question. why do we have the small capacitors shunting the Vcc lines to the ground? - to be more specific, why do we have 3 100nF capacitors instead of 330nF for the Vcc. is there a design reason?

I suppose they may be for filtering transient surges that cause brownout >> http://electronics.stackexchange.com/questions/37561/what-is-a-brownout-condition


#96

#97

#98

Very true Cyrus. Great point. Splash board 1.0 had the bypass capacitors, but the microcontroller was resetting every time the relays operated. we realized it is because the Storage capacitors in the PCB needed to be Very close to the microcontroller Vcc/Gnd pins to keep the Voltage constant. a small capacitor soldered at the uC IC power pins solved the case.

Check this Link >> http://www.hottconsultants.com/techtips/decoupling.html


#99

Michael, I noticed that the LCD display dimmed each time the relays closed, which indicated to me that the power supply was not completely adequate. Thus each time the relay closed, there was a voltage drop across the board and this could be causing the uC reset.
Effects of decoupling caps demonstrated: http://hackaday.com/2011/10/25/do-you-know-why-youre-supposed-to-use-decoupling-capacitors/
Two useful references I use WRT to decoupling are:
http://www.atmel.com/Images/Atmel-8580-TPM-Power-Supply-Decoupling-ApplicationNote.pdf and http://www.atmel.com/Images/Atmel-2521-AVR-Hardware-Design-Considerations_ApplicationNote_AVR042.pdf.
Note the info about the RESET switch.
Furthermore, I understand that the capacitors also serve to reduce the switching noise (voltage spikes) from the uC messing up the supply. This is critical in cases where you have other IC’s using the same Vcc but doing analog work. While they are there primarily to keep the noise at bay, providing voltage support for the uC is a nice side benefit. Either way, use bypass caps. :slight_smile:
Another interesting read is : http://web.archive.org/web/20060621061926/http://www.dvanhorn.org/Micros/All/Bypass.php and https://www.avrprogrammers.com/articles/basic-hardware explains a lot of my circuit design choices.
Sizes: Larger caps have larger inductance, many times that of the smaller value cap, so their inductance limits the frequency range that they will effectively filter, while smaller caps react to voltage spikes faster. So generally,
the best is a .1uf smd cap right at the supply pins as well as the 10uf electrolytic a bit further off.

From http://forum.arduino.cc/index.php?topic=120796.0

" In theory any cap bypass cap has less and less capacitance reactance (AC resistance) to ground (which is good , acts like a high pass filter to ground) as the frequency of the noise or spike increases. However in practice different capacitor’s dialectic material used for a specific kind of cap can have different ESR (equivalent series resistance) values at same frequencies. So larger electrolytic caps are favored for their effectiveness at lower frequencies (for say AC power ripple frequencies) while ceramic caps are better at higher frequencies. Also where the caps are placed can have a big effect on how well bypass filtering work. The larger caps work better by placement at where power enters the board or right at the output of a voltage regulators, where as the smaller popular .1ufd caps are usually more effective mounted right at the Vcc terminals of any ICs being protected. You will note that the arduino board design for a 328p chip has 3 .1ufd caps wired close to the chip at the Vcc, Avcc, and Aref pins, all used for bypass filtering. "


#100

Very True Oscar, Thanks for the References

You have explained the concept very well, and clear


#101

I’m glad it helps. Thanks