Electronic – arduino – Attiny85 for wireless communication

arduinoattiny85nrf24l01

I'm a very beginner in electronics. I'm trying to make a system which transmits a tank chemical level to a distant system.

Remote system is an Arduino.

For the tank unit I have 4 float switches. Whenever one is triggered (close/open) I need to transmit this to remote system. For that I'd like to use an NRF24.

But my question is, will it possible using an Attiny85? I mean 4 switches and wireless communication.

Best Answer

That's going to be very difficult to accomplish with an ATtiny85's limited pin count given that the nRF24 needs SPI, and given that you have four sensors to somehow scan. It might be somewhat easier with the low pin count version of the XN297, but probably not worth the bother.

(If you really wanted to over-optimize you might decide you could ignore the nRF24's extra SPI signal, ignore its SPI MISO, and use resistors on the switches to allow overriding CLK and MOSI when you take CSN high and set the other pins as inputs... but then you have to disconnect it all to ISP firmware into the chip...)

If you want to keep the sort of approach you are on, an ATmega-based solution would give you a similar architecture with enough pins. Or there are ATtiny varients with more pins like the `861 but it's unclear you need anything that offers which the more widely known and supported ATmegas do not support.

As mentioned there are also various other-protocol chips potentially integrating both the MCU and radio - not only the ESP series, but also many BLE MCUs are closely related to the nRF24 and Nordic's in particular can speak the nRF24 protocol instead of BLE if you like.

There are also simpler, less reliable radios. For example a lot of domestic remote controls and status senders use OOK/ASK protocols in the 302-434 MHz range. These would require only a single wire from the MCU to activate/modulate the radio, but the signals and receivers tend to be more primitive, requiring more in the way of a software algorithm on the receiving side to distinguish valid signals from noise. Transmission in the reverse direction is not typically supported.

Related Topic