Per questo ho fatto un piccolo switch che posso comandare da PC che toglie alimentazione quando serve.
Ho utilizzato un convertitore USB-RS232 (4€ su eBay) sfruttando la tensione che si genera sul piedino del DTR al momento in cui da programma su PC si apre la relativa porta seriale, la tensione và ad disattivare un Triac che bypassava precedentemente la tensione di rete che alimentava l'Arduino (o quello che vi pare). La porta seriale sarà quella assegnata automaticamente dal chip FTDI e sarà sufficente aprire la porta seriale, anche senza impostare nessun parametro, che sul DTR si troverà la tensione per pilotare il TRIAC.
I had the need to reset the Arduino when I realize that does not properly send the data to the personal through the LAN or serial. And 'possible to implement a kind of software watchdog in' Arduinico 'code but the reset is always software. Some shield board, for example, the shield lan, if you have problems on sharing or access to ports can reset the Arduino all you want but the LAN is not restored until you cut power to the board.
This is why I made a small switch that can be controlled from a PC that cuts power when you need it.
I used a USB-RS232 converter (4 € on eBay), exploiting the tension that is generated on pin DTR at the time when from a PC-program opens its serial port , the voltage goes to deactivate a Triac that previously bypassed the line voltage that fed the Arduino (or whatever you want). The serial port will be automatically assigned by the FTDI chips and will be sufficient to open the serial port, even without setting any parameters, which will be located on the DTR voltage to drive the TRIAC.
es.VB classic:
una option con 2 pulsanti
Private Sub Option1_Click(Index As Integer)
If Index = 0 Then
.CommPort = 2 'quello che sarà
.Settings = "9600,N,8,1"
.PortOpen = True
Else
If .PortOpen = True Then
.PortOpen = False
End If
End If
End With
End Sub
Modulo USB-TTL
2x FTDI FT232RL 5V 3.3V Modulo Adattatore USB a TTL Seriale Convertitore Arduino
Schema dello switch Triac, trovato su Internet, ringrazio l'autore (www.sigmatone.com).
The Triac switch scheme, found on the Internet, thanks to the author (www.sigmatone.com).
Il modulo adattatore nel case di un alimentatore da parete bruciato.
The adapter module in case of a burned wall power supply.
The adapter module in case of a burned wall power supply.
Il circuito del commutatore cablato 'volante'
Tutto il circuito è un pò sovradimensionato nel caso un giorno a qualcuno venisse in mente di attaccarci la stufetta :).
Ad ogni buon conto il TRIAC che ho usato, che non è quello riportato nello schema elettrico, viene dato per 8A, le resistenze sono da 1W, per un Arduino dovrebbe essere sufficente.
The wired 'steering switch circuit'
The entire circuit is a bit oversized if one day someone would come to mind to attack the heater :).
In any event the TRIAC I used, which is not the one shown in the circuit diagram is given to 8A, the resistors are 1W for an Arduino should be sufficient.
I pin del fotoaccoppiatore vanno al GND e al DTR del modulo TTL
The optocoupler pin goes to GND and DTR of the TTL logic device
Il 'prodotto' finito.
The 'product' ended.
'In azione'
'In action'
Il circuito è normalmente chiuso perchè io voglio togliere tensione aprendo la seriale.
The circuit is normally closed because I want to cut power by opening the serial.