I have Arduino Pro Mini and DS1302 Module.
And I setted arduino going to sleep mode.
How can I wake arduino with DS1302?
First of all, Is that a possible?
(use interrupt code?)
The DS1302 does not have any alarm capability, therefore it can not be used to wake up your Arduino.
You would have to switch to an DS3231 for example, which has two programmable alarms. Those alarms will pull a pin on the DS3231 low, which you can use as an interrupt to wake up your Arduino.
Related
I am programming an Arduino Uno. The board is connected to my PC via USB cable. I run the following code with pin 8 wired to an external LED. The program boots and the LED turns on.
Code
If I open the serial monitor in the Arduino IDE, the LED turns off for ~2 seconds and then turns on again.
Why would opening the serial monitor affect the state of the pins on the Arduino? Is the chip faulty or am I missing something obvious?
By default, arduino boards will reset whenever a serial connection is established with them. So when the IDE is started, a new serial conection is established, which restarts the program, causing ~2 seconds of 'down time'. It is possible to disable this setting https://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection
I am working on a project which involves to power on/off a Raspberry Pi with an Arduino. In fact the project contains several sensors like a motion sensor and the Arduino will be supplied with a 10kmA battery.
The motion sensor is connected on the Arduino device.
Once the sensor detects a movement, the Arduino will receive the instruction to deliver the 5V to the Raspberry Pi.
How can I supply the Raspberry Pi with the Arduino? GPIO? USB?
I have already seen solutions to power an Arduino with a Raspberry Pi, but never the opposite.
Powering on is easy: just use a small relay that you control with your Arduino, and which switches the 5v from the battery to the RPi.
Shutting down the Pi should be done in two steps:
Setting a GPIO connection to the GPIO header of the Pi, that "sends" the signal to shut down. The RPi must receive this signal as an interrupt on the GPIO and can execute a shutdown-script
The second step should be to wait until the RPi has completely shut down. Maybe you can observe that with the help of the RPi LEDs or something like that (otherwhise, an unclean solution would be to wait XX seconds). After you know that the Pi is shut down, you can open the 5V relay again.
I recently bought this Arduino Relay module (http://www.ebay.com/itm/400757832363?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT) and it hasn't been working. I have tested it with batteries, and connecting it directly to the battery does function. However, when I connect to the Arduino Leonardo board, the indicator lights come on for both the In pin and the VCC pin, but the electromagnet does not function and the circuit does not complete. There is no click when connected to Arduino. Any suggestions would be greatly appreciated.
While this is not the right place to post about electronics, It appears that your relay only triggers at 12V, Arduino supplies 3.3V and 5V, not enough to trigger your relay.
I have an external power source (6v) that is connected to a motor and a servo, and on my arduino board I have a couple of LEDs which are powered by the onboard 5v. The external power is connected to a switch so I can turn on the motor and servo (to save battery). My main board just blinks the different LEDs. What I want to happen is that the moment my external power is switched on, the LEDs stop blinking and the code to move the servo and motor is executed. As a result I have a boolean called intro. When it is true, the LED code executes, when it is false the motor and servo code will execute. The only problem I am having is that how can the Arduino know if the external power is switched on so that the boolean can be set to false? Is there a way that the arduino can detect if the external power is on (for example checking the pins of the motor/servo?)?
The general idea is to connect the external power to an I/O pin so you can read its status. You'll also want a pull-down on the I/O pin so that it doesn't float and give random values when power is not connected.
Don't connect 6V directly to an Arduino I/O pin, it will be far enough above Vcc that the clamp diodes on the pin will activate. A series resistor like 10K to reduce the clamp current will probably be OK but still isn't the best design practice. I'd recommend a 3V3 zener diode clamp such as that on this page:
http://www.kevinmfodor.com/home/My-Blog/microcontrollerinputprotectiontechniques
Check the max input voltage on the IO pins, but you should be able to connect the external power to a pin and drive an interrupt.
The interrupt can then be used to decide if the power is on (rising edge) or off (falling edge).
Is it possible to wake a Microchip PIC16F1825 from sleep using RS232 without looking characters?
Because one of the permissible RX pins supports interrupt on change, I thought this might be possible.
Has anybody implemented this successfully?
Sure!
From datasheet PIC16(L)F1825/1829:
9.1 Wake-up from Sleep
The device can wake-up from Sleep through one of the following events:
1. External Reset input on MCLR pin, if enabled
2. BOR Reset, if enabled
3. POR Reset
4. Watchdog Timer, if enabled
5. Any external interrupt
6. Interrupts by peripherals capable of running
during Sleep (see individual peripheral for more information)
So you can use:
1)External interrupt INTERRUPT-ON-CHANGE, if you are connecting RX pin with one of other pins which is configured as interrupt-on-change.
2)Peripheral interrupt RCIF: USART Receive Interrupt Flag bit. When receiver buffer is full (one UART word is received), an interrupt is pending and your CPU should wake up.