Regarded as a
conjunction particle by itself,
のに is simply a fusion of the
case marking particles の and に.
のに has two primary functions in Japanese. It can be used to show that something is the opposite of what is expected for (A) (translated as 'despite'), or it can be used to show that something is required for (A) to be realized (translated as 'in order to'). We will focus on the 'in order to' meaning in this lesson.
To use
のに, simply attach it to the base (non-past) form of a verb that you would like to express as being the 'goal', before following it with the conditions required to meet that goal.
トラックは車(くるま)と違(ちが)って、ブレーキをかけてから止(と)まるのに時間(じかん)がかかる。
Unlike cars, trucks take longer to stop after stepping on the brakes.
風(かぜ)が強(つよ)すぎて、ピクニックシートを広(ひろ)げるのに苦労(くろう)した。
The wind was so strong that I struggled to spread out the picnic blanket.
Although
のに can be translated as 'despite', or 'in order to', it actually has the same meaning in each of these situations. の nominalizes what comes before it (turning it into a noun-phrase), while に converts that new noun-phrase into a 'location', or 'goal'. In this way,
のに always means 'to that which is (A), (B)'.
さっき食(た)べたばかりなのに、またお腹(なか)が空(す)いた。
I just ate earlier, but I am hungry again.
食(た)べるのに時間(じかん)をかけすぎて寝(ね)る時間(じかん)が遅(おそ)くなった。
I took so long to eat, so I slept at a later time.